Closed YunDeng98 closed 3 months ago
Hi Yun!
mn = n.metadata['mn'] vr = n.metadata['vr'] alphas.append(vr/mn) thetas.append(mn*mn/vr)
I think you want $\alpha = m^2 / v$ and $\theta = v / m$? So that $m = \alpha \theta$ and $v = \alpha \theta^2$.
But in general, yes, the actual coverage is going to be less than the nominal coverage for a given interval width (the posterior will be too concentrated), even on true trees. AFAICT this is an issue with expectation propagation: it generally does a great job at matching the mean, but underestimates the variance. Increasing max_iterations
can help, as it takes longer for higher order moments to converge.
Here's your fig with that change to $\alpha$ and $\theta$:
Thanks a lot! Sorry for the coding bug of mine.
Hi developers, I've been having great experience with tsdate 0.2.0 so far. There is one thing which I don't fully understand: associated with each node there is a gamma distribution (with mean and variance in the metadata). This distribution should stand for the estimation uncertainty in the algorithm about node ages. I am personally interested in evaluating the goodness of the uncertainty (as to whether the distribution is too wide or too narrow). As such, I simulated with high mutation rate (4 times recombination rate) and feed the true topology into tsdate. For each node, I computed the CDF of the true node age in the associated gamma distribution. Ideally it should be uniform between 0 and 1 if the distribution is "at the right width". Here is the code:
and the result:
which is of a weird shape. I wonder if the developers have any ideas about this. Thanks a lot!