birth-rate is initialized with negative values

78 views
Skip to first unread message

Timo Hellwig

unread,
Feb 16, 2021, 9:15:31 AM2/16/21
to beast-users
I am trying do a model comparison with the MODEL-SELECTION application in BEAST2 (using the GUI). Sometimes it works well, but in 90% of the times it crashed with the following error:

====================================================================
Start likelihood: NaN 
P(posterior) = NaN (was NaN)  **
P(prior) = -18.720687463855143 (was NaN)  **
P(BirthDeath.t:taxa_R_conSeq_cut1-650_noGap) = -16.700710862857115 (was NaN)  **
P(BirthRatePrior.t:taxa_R_conSeq_cut1-650_noGap) = -0.12278545219055993 (was NaN)  **
P(DeathRatePrior.t:taxa_R_conSeq_cut1-650_noGap) = -0.2876384540535581 (was NaN)  **
P(ClockPrior.c:taxa_R_conSeq_cut1-650_noGap) = 0.0 (was NaN)  **
P(PropInvariantPrior.s:taxa_R_conSeq_cut1-650_noGap) = 0.0 (was NaN)  **
P(fulv.prior.prior) = -0.37459347672487053 (was NaN)  **
P(vav.prior) = -1.2349592180290387 (was NaN)  **
P(likelihood) = NaN (was NaN)  **
P(treeLikelihood.taxa_R_conSeq_cut1-650_noGap) = NaN (was NaN)  **
Fatal exception: Could not find a proper state to initialise. Perhaps try another seed.
java.lang.RuntimeException: Could not find a proper state to initialise. Perhaps try another seed.
====================================================================


I saw in an earlier post, that "the birth-rate is initialised automatically, and gets assigned a value outside the range 0 to 10000 specified in the XML" (see: https://groups.google.com/g/beast-users/c/zPsX19Hd93Q/m/VGCn3kcPAAAJ). It seems like this is the problem in my case (see red text in the error). However, his fix (increasing the upper bound) does not work for me and the post is from 2014 when he said this issue will be fixed in the next release. 
So now I am wondering what is going on? Is there another issue or maybe another fix? 

Thanks in advance.


========================= XML file ====================================
<run id="PathSamplingStep" spec="beast.inference.PathSamplingStep" chainLength="500000" preBurnin="500000">
    <state id="state" spec="State" storeEvery="5000">
        <tree id="Tree.t:taxa_R_conSeq_cut1-650_noGap" spec="beast.evolution.tree.Tree" name="stateNode">
            <taxonset id="TaxonSet.taxa_R_conSeq_cut1-650_noGap" spec="TaxonSet">
                <alignment idref="taxa_R_conSeq_cut1-650_noGap"/>
            </taxonset>
        </tree>
        <parameter id="BDBirthRate.t:taxa_R_conSeq_cut1-650_noGap" spec="parameter.RealParameter" lower="0.0" name="stateNode" upper="1e10">213.2021</parameter>
        <parameter id="BDDeathRate.t:taxa_R_conSeq_cut1-650_noGap" spec="parameter.RealParameter" lower="0.0" name="stateNode" upper="1.0">0.5</parameter>
        <parameter id="clockRate.c:taxa_R_conSeq_cut1-650_noGap" spec="parameter.RealParameter" name="stateNode">1.0</parameter>
        <parameter id="proportionInvariant.s:taxa_R_conSeq_cut1-650_noGap" spec="parameter.RealParameter" lower="0.0" name="stateNode" upper="1.0">0.01</parameter>
        <parameter id="mutationRate.s:taxa_R_conSeq_cut1-650_noGap" spec="parameter.RealParameter" name="stateNode">1.0</parameter>
    </state>

    <init id="RandomTree.t:taxa_R_conSeq_cut1-650_noGap" spec="beast.evolution.tree.RandomTree" estimate="false" initial="@Tree.t:taxa_R_conSeq_cut1-650_noGap" taxa="@taxa_R_conSeq_cut1-650_noGap">
        <populationModel id="ConstantPopulation0.t:taxa_R_conSeq_cut1-650_noGap" spec="ConstantPopulation">
            <parameter id="randomPopSize.t:taxa_R_conSeq_cut1-650_noGap" spec="parameter.RealParameter" name="popSize">1.0</parameter>
        </populationModel>
    </init>

    <distribution id="posterior" spec="util.CompoundDistribution">
        <distribution id="prior" spec="util.CompoundDistribution">
            <distribution id="BirthDeath.t:taxa_R_conSeq_cut1-650_noGap" spec="beast.evolution.speciation.BirthDeathGernhard08Model" birthDiffRate="@BDBirthRate.t:taxa_R_conSeq_cut1-650_noGap" relativeDeathRate="@BDDeathRate.t:taxa_R_conSeq_cut1-650_noGap" tree="@Tree.t:taxa_R_conSeq_cut1-650_noGap"/>
            <prior id="BirthRatePrior.t:taxa_R_conSeq_cut1-650_noGap" name="distribution" x="@BDBirthRate.t:taxa_R_conSeq_cut1-650_noGap">
                <Exponential id="Exponential.4" name="distr">
                    <parameter id="RealParameter.62" spec="parameter.RealParameter" estimate="false" name="mean">1.0</parameter>
                </Exponential>
            </prior>
            <prior id="DeathRatePrior.t:taxa_R_conSeq_cut1-650_noGap" name="distribution" x="@BDDeathRate.t:taxa_R_conSeq_cut1-650_noGap">
                <Exponential id="Exponential.5" name="distr">
                    <parameter id="RealParameter.63" spec="parameter.RealParameter" estimate="false" name="mean">1.0</parameter>
                </Exponential>
            </prior>
            <prior id="ClockPrior.c:taxa_R_conSeq_cut1-650_noGap" name="distribution" x="@clockRate.c:taxa_R_conSeq_cut1-650_noGap">
                <Uniform id="Uniform.8" name="distr" upper="Infinity"/>
            </prior>
            <prior id="PropInvariantPrior.s:taxa_R_conSeq_cut1-650_noGap" name="distribution" x="@proportionInvariant.s:taxa_R_conSeq_cut1-650_noGap">
                <Uniform id="Uniform.2" name="distr"/>
            </prior>
            <distribution id="fulv.prior.prior" spec="beast.math.distributions.MRCAPrior" monophyletic="true" tree="@Tree.t:taxa_R_conSeq_cut1-650_noGap">
                <taxonset id="fulv.prior" spec="TaxonSet">
                    <taxon id="P.a." spec="Taxon"/>
                    <taxon id="P.s.e." spec="Taxon"/>
                    <taxon id="P.s.h.h." spec="Taxon"/>
                    <taxon id="P.s.h.s." spec="Taxon"/>
                    <taxon id="P.s.s." spec="Taxon"/>
                </taxonset>
                <LogNormal id="LogNormalDistributionModel.5" meanInRealSpace="true" name="distr">
                    <parameter id="RealParameter.45" spec="parameter.RealParameter" estimate="false" name="M">1.7</parameter>
                    <parameter id="RealParameter.46" spec="parameter.RealParameter" estimate="false" lower="0.0" name="S" upper="5.0">0.4</parameter>
                </LogNormal>
            </distribution>
            <distribution id="vav.prior" spec="beast.math.distributions.MRCAPrior" monophyletic="true" tree="@Tree.t:taxa_R_conSeq_cut1-650_noGap">
                <taxonset id="vav" spec="TaxonSet">
                    <taxon idref="P.a."/>
                    <taxon id="P.f." spec="Taxon"/>
                    <taxon idref="P.s.e."/>
                    <taxon idref="P.s.h.h."/>
                    <taxon idref="P.s.h.s."/>
                    <taxon idref="P.s.s."/>
                </taxonset>
                <LogNormal id="LogNormalDistributionModel.4" meanInRealSpace="true" name="distr" offset="3.78">
                    <parameter id="RealParameter.43" spec="parameter.RealParameter" estimate="false" name="M">3.4</parameter>
                    <parameter id="RealParameter.44" spec="parameter.RealParameter" estimate="false" lower="0.0" name="S" upper="5.0">0.5</parameter>
                </LogNormal>
            </distribution>
        </distribution>
        <distribution id="likelihood" spec="util.CompoundDistribution" useThreads="true">
            <distribution id="treeLikelihood.taxa_R_conSeq_cut1-650_noGap" spec="ThreadedTreeLikelihood" data="@taxa_R_conSeq_cut1-650_noGap" tree="@Tree.t:taxa_R_conSeq_cut1-650_noGap">
                <siteModel id="SiteModel.s:taxa_R_conSeq_cut1-650_noGap" spec="SiteModel" mutationRate="@mutationRate.s:taxa_R_conSeq_cut1-650_noGap" proportionInvariant="@proportionInvariant.s:taxa_R_conSeq_cut1-650_noGap">
                    <parameter id="gammaShape.s:taxa_R_conSeq_cut1-650_noGap" spec="parameter.RealParameter" estimate="false" name="shape">1.0</parameter>
                    <substModel id="JC69.s:taxa_R_conSeq_cut1-650_noGap" spec="JukesCantor"/>
                </siteModel>
                <branchRateModel id="StrictClock.c:taxa_R_conSeq_cut1-650_noGap" spec="beast.evolution.branchratemodel.StrictClockModel" clock.rate="@clockRate.c:taxa_R_conSeq_cut1-650_noGap"/>
            </distribution>
        </distribution>
    </distribution>

    <operator id="BirthDeathTreeScaler.t:taxa_R_conSeq_cut1-650_noGap" spec="ScaleOperator" scaleFactor="0.5" tree="@Tree.t:taxa_R_conSeq_cut1-650_noGap" weight="3.0"/>

    <operator id="BirthDeathTreeRootScaler.t:taxa_R_conSeq_cut1-650_noGap" spec="ScaleOperator" rootOnly="true" scaleFactor="0.5" tree="@Tree.t:taxa_R_conSeq_cut1-650_noGap" weight="3.0"/>

    <operator id="BirthDeathUniformOperator.t:taxa_R_conSeq_cut1-650_noGap" spec="Uniform" tree="@Tree.t:taxa_R_conSeq_cut1-650_noGap" weight="30.0"/>

    <operator id="BirthDeathSubtreeSlide.t:taxa_R_conSeq_cut1-650_noGap" spec="SubtreeSlide" tree="@Tree.t:taxa_R_conSeq_cut1-650_noGap" weight="15.0"/>

    <operator id="BirthDeathNarrow.t:taxa_R_conSeq_cut1-650_noGap" spec="Exchange" tree="@Tree.t:taxa_R_conSeq_cut1-650_noGap" weight="15.0"/>

    <operator id="BirthDeathWide.t:taxa_R_conSeq_cut1-650_noGap" spec="Exchange" isNarrow="false" tree="@Tree.t:taxa_R_conSeq_cut1-650_noGap" weight="3.0"/>

    <operator id="BirthDeathWilsonBalding.t:taxa_R_conSeq_cut1-650_noGap" spec="WilsonBalding" tree="@Tree.t:taxa_R_conSeq_cut1-650_noGap" weight="3.0"/>

    <operator id="BirthRateScaler.t:taxa_R_conSeq_cut1-650_noGap" spec="ScaleOperator" parameter="@BDBirthRate.t:taxa_R_conSeq_cut1-650_noGap" scaleFactor="0.75" weight="3.0"/>

    <operator id="DeathRateScaler.t:taxa_R_conSeq_cut1-650_noGap" spec="ScaleOperator" parameter="@BDDeathRate.t:taxa_R_conSeq_cut1-650_noGap" scaleFactor="0.75" weight="3.0"/>

    <operator id="StrictClockRateScaler.c:taxa_R_conSeq_cut1-650_noGap" spec="ScaleOperator" parameter="@clockRate.c:taxa_R_conSeq_cut1-650_noGap" scaleFactor="0.75" weight="3.0"/>

    <operator id="strictClockUpDownOperator.c:taxa_R_conSeq_cut1-650_noGap" spec="UpDownOperator" scaleFactor="0.75" weight="3.0">
        <up idref="clockRate.c:taxa_R_conSeq_cut1-650_noGap"/>
        <down idref="Tree.t:taxa_R_conSeq_cut1-650_noGap"/>
    </operator>

    <operator id="proportionInvariantScaler.s:taxa_R_conSeq_cut1-650_noGap" spec="ScaleOperator" parameter="@proportionInvariant.s:taxa_R_conSeq_cut1-650_noGap" scaleFactor="0.5" weight="0.1"/>

    <operator id="FixMeanMutationRatesOperator" spec="DeltaExchangeOperator" delta="0.75" weight="2.0">
        <parameter idref="mutationRate.s:taxa_R_conSeq_cut1-650_noGap"/>
        <weightvector id="weightparameter" spec="parameter.IntegerParameter" estimate="false" lower="0" upper="0">652</weightvector>
    </operator>

    <logger id="tracelog" spec="Logger" fileName="taxa_R_conSeq_cut1-650_noGap.log" logEvery="5000" model="@posterior" sanitiseHeaders="true" sort="smart">
        <log idref="posterior"/>
        <log idref="likelihood"/>
        <log idref="prior"/>
        <log idref="treeLikelihood.taxa_R_conSeq_cut1-650_noGap"/>
        <log id="TreeHeight.t:taxa_R_conSeq_cut1-650_noGap" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.t:taxa_R_conSeq_cut1-650_noGap"/>
        <log idref="vav.prior"/>
        <log idref="fulv.prior.prior"/>
        <log idref="BirthDeath.t:taxa_R_conSeq_cut1-650_noGap"/>
        <log idref="BDBirthRate.t:taxa_R_conSeq_cut1-650_noGap"/>
        <log idref="BDDeathRate.t:taxa_R_conSeq_cut1-650_noGap"/>
        <log idref="clockRate.c:taxa_R_conSeq_cut1-650_noGap"/>
        <log idref="proportionInvariant.s:taxa_R_conSeq_cut1-650_noGap"/>
        <log idref="mutationRate.s:taxa_R_conSeq_cut1-650_noGap"/>
    </logger>

    <logger id="screenlog" spec="Logger" logEvery="5000">
        <log idref="posterior"/>
        <log idref="likelihood"/>
        <log idref="prior"/>
    </logger>

    <logger id="treelog.t:taxa_R_conSeq_cut1-650_noGap" spec="Logger" fileName="combined.trees" logEvery="5000" mode="tree">
        <log id="TreeWithMetaDataLogger.t:taxa_R_conSeq_cut1-650_noGap" spec="beast.evolution.tree.TreeWithMetaDataLogger" tree="@Tree.t:taxa_R_conSeq_cut1-650_noGap"/>
    </logger>

    <logger id="Logger" spec="Logger" fileName="likelihood.log" logEvery="500">
        <log idref="likelihood"/>
    </logger>

    <operatorschedule id="OperatorSchedule" spec="OperatorSchedule"/>

</run>
Reply all
Reply to author
Forward
0 new messages