Open avish96 opened 1 week ago
I have reproduced this and it is a bug. I agree that this is probably due to very low rate variation and divergence of the rate variation parameter. While I investigate further, there is a workaround: You can use the 'additive' clock model which will also give you an estimate of rate variation but seems to not have this bug.
Sounds good, thanks so much!
The following code results in an error that I am unable to pinpoint the cause of. Any help would be appreciated!
I first load my sample simulated time tree and simulate a rate tree from it, with one branch having a 10x higher rate than the rest.
I then calculate the substitution tree with my simulated time and rate trees, with the desired number of sites. I apply treedater to this substitution tree, using the root-to-tip distances for the sampling times, to obtain the inferred rate and time trees. I perform this operation 100 times.
This results in the following error message in some simulations:
Notes from preliminary investigations on my end: it seems like the
pnbinom
term returns NaN becauseintree$edge.length
is a vector filled with NaN.pp
is also NaN, as arep
andtd
. I believe the size parameterr
is infinity here, indicating the negative binomial converges to a poisson; I am unsure if this case is unaccounted for, and also wonder if this observation has anything to do with the shape of the likelihood landscape.