The initial model is invalid because state has a zero probability.

174 views
Skip to first unread message

Dmitry Biba

unread,
Jan 24, 2021, 6:05:19 PM1/24/21
to beast-users
Hi, all,
I think, I've posted this already, but I can't see it in the conversations... Sorry if it's a duplicate.
I try to run a xml file generated from the template from this tutorial:
http://beast.community/thorney_beast
Here they use some coronavirus data. And so do I. When I use their data it goes well, but when I use mine - it throws an error "The initial model is invalid because state has a zero probability." (see below). I've read that it might be caused by too large tree. To rule that out I've tested the xml on a small tree (500 leaves). The error persists. Next up, I've read that the reason might be that my initial tree doesn't satisfy some constraints from the prior distributions of parameters. And I fail to find the parameters responsible for this error. However, I actually not convinced that these priors are necessarily wrong - after all, I use the coronavirus data tree, same as the authors of the tutorial, and I think that my tree should have roughly the same parameters as theirs (like branch lengths, dates, etc.), or I am wrong?
I'd much appreciate if someone explained me what's going on. I use BEASTv1.10.5pre_thorney (again, from the tutorial). I didn't manage to attach my xml file, so I'll put it on the google drive:
https://drive.google.com/drive/folders/16KAgwSpGgLOS5wanGprv-Mr3_iVsVSgq?usp=sharing
Thanks in advance!
Here is the full error:
Creating the MCMC chain:
  chain length = 100000000
  operator adaption = true
  adaptation delayed for 1000000 steps
Jan 21, 2021 11:24:51 PM dr.app.beast.BeastMain <init>
SEVERE: Error running file: run_1.3.xml
Jan 21, 2021 11:24:51 PM dr.app.beast.BeastMain <init>
SEVERE: The initial model is invalid because state has a zero probability.

If the log likelihood of the tree is -Inf, this may be because the
initial, random tree is so large that it has an extremely bad
likelihood which is being rounded to zero.

Alternatively, it may be that the product of starting mutation rate
and tree height is extremely small or extremely large.

Finally, it may be that the initial state is incompatible with
one or more 'hard' constraints (on monophyly or bounds on parameter
values. This will result in Priors with zero probability.

The individual components of the posterior are as follows:
The initial posterior is zero:
  CompoundLikelihood(compoundModel)=(
    Gamma(clock.rate)=-4.3265,
    Gamma(skygrid.precision)=-4.6139,
    GMRFSkygridLikelihood(gmrfSkyrideLikelihood[skygrid])=-517658.2807
    Total = -517667.221054205
  ),
  CompoundLikelihood(compoundModel)=(
    ThorneyTreeLikelihood(thorneyTreeLikelihood[treeLikelihood])=-Inf
    Total = -Infinity
  )
  Total = -Infinity
For more information go to <http://beast.community>.

Dmitry Biba

unread,
Jan 24, 2021, 6:05:19 PM1/24/21
to beast-users

Hi all!
A very inexperienced BEAST user over here... I'm trying to run an xml file generated based on this tutorial
http://beast.community/thorney_beast
on  my coronavirus data. And I keep getting this error message about zero probability (at the end). I've read that zero probability of the initial model might be a result of too large tree, so to rule that out I run the analysis on a sample tree containing 500 leaves. Still get the message. The next thing they suggest in the FAQ is that my priors are not compatible with my initial tree, so it yields zero probability. But I fail to figure out which parameters are wrong. In fact,  I am surprised that some parameters might be wrong,  because both me and Thorney run this on coronavirus data, and, I guess, coronavirus data should have more or less the same properties in terms of dates and branch lengths.

I use BEASTv1.10.5pre_thorney and generate xml with the help of BEASTGen like this (by analogy with the tutorial):
./beastgen -date_order -1 -date_prefix "_" -date_precision -D "outputStem=run_1.3" SG-thorney.template tree.nexus run_1.3.xml

I can't see how to attach the xml file :O. So, I'll upload it to the google drive. Here:
https://drive.google.com/drive/folders/16KAgwSpGgLOS5wanGprv-Mr3_iVsVSgq?usp=sharing

I would much appreciate if someone explained me what's going on and possibly pointed out how I need to change my priors, if that's really a problem. Thank you in advance!

Dmitry Biba

unread,
Jan 25, 2021, 12:20:08 PM1/25/21
to beast-users
Solved this one, thanks :)
My branch lengths were in number of substitutions, and their - in substitutions per site.

Ufuoma Babatunde

unread,
Jul 20, 2022, 3:07:00 AM7/20/22
to beast-users
Hello.
May I ask how did you solve this one? I also have this problem.

Thank you.

Dmitry Biba

unread,
Jul 20, 2022, 11:30:24 AM7/20/22
to beast-users
Hi!
Sure, as I have written, the problem was in branch lengths of my input tree. They were supposed to be in number of substitutions per site (e.g. 1/29000), but mine were in number of substitutions (e.g. 1). But I think this was a very specific case, so unless you also try to reproduce the runs from the Thorney tutorial, this will likely not be applicable to you.
Hope this helps,
Dmitry

Ufuoma Babatunde

unread,
Jul 22, 2022, 2:32:24 PM7/22/22
to beast-users
Hello, Dmitry.

Thank you for this. I am now able to run it but got confused for a bit what you meant about the number of substitutions per site. Nevertheless, your suggestion helped me pinpoint which parameter in my xml file caused the -infinity error.

Ufuoma

Reply all
Reply to author
Forward
0 new messages