Problem with Sample from Prior

790 views
Skip to first unread message

piw...@gmail.com

unread,
Dec 6, 2013, 4:53:15 AM12/6/13
to beast...@googlegroups.com

Dear Users,


I'm trying to run BEAST 2.0 with flag sampleFromPrior="true" using Calibrated Yule Model. However, I'm getting the following warnings:


Sample from prior flag is set, but distribution with id 'likelihood' is not an input to posterior.

or

WARNING: StateNode (freqParameter.s:Character_Matrix) found that has no effect on posterior! WARNING: StateNode (proportionInvariant.s:Character_Matrix) found that has no effect on posterior!

WARNING: StateNode (rateCategories.c:Character_Matrix) found that has no effect on posterior! Start likelihood: -Infinity after 11 initialisation attempts


Is it mean that I have to comment out some additional lines (like parameters of substitution model) in xml?


Thanks for any comments.


Best

Marcin


Remco Bouckaert

unread,
Dec 6, 2013, 7:38:24 AM12/6/13
to beast...@googlegroups.com
Hi Marcin,

To sample from the prior, you should not have to do anything other than setting the flag in BEAUti.
Does the XML run when you do not sample from the prior?

Remco

piw...@gmail.com

unread,
Dec 6, 2013, 9:36:33 AM12/6/13
to beast...@googlegroups.com
Hi Remco,

I solved the problem. I just switched from 1.0 to BEAST 2.0 and made a couple of stupid mistakes. Sometimes it's useful to read before submitting questions :-)))

Best
Marcin

Anon Ymous

unread,
Nov 29, 2015, 11:01:12 AM11/29/15
to beast-users
Hi Marcin,

Can I ask how you figured out how to solve this? I am getting these errors in Beast 2 using an xml file generated by the mos recent version of Beauti.

Thank you,
Rachel 

alicia alvarez

unread,
Apr 27, 2016, 9:58:51 AM4/27/16
to beast-users
Hi all!
I am having the same trouble, running 2.3.1 version
Additionally, I have some other warnings
I copy the output:


File: Eumy-especificaciones-monofil-prior.xml seed: 1461764858989 threads: 1

Random number seed: 1461764858989



  Ignoring ambiguities in tree likelihood.

  Ignoring character uncertainty in tree likelihood.

  With 29 unique site patterns.

  Using rescaling scheme : dynamic

java.lang.NullPointerException

    at beast.evolution.likelihood.BeagleTreeLikelihood.setUpSubstModel(Unknown Source)

    at beast.evolution.likelihood.BeagleTreeLikelihood.initialize(Unknown Source)

    at beast.evolution.likelihood.BeagleTreeLikelihood.initAndValidate(Unknown Source)

    at beast.core.BEASTInterface.initByName(Unknown Source)

    at beast.evolution.likelihood.TreeLikelihood.initAndValidate(Unknown Source)

    at beast.util.XMLParser.initPlugins(Unknown Source)

    at beast.util.XMLParser.parse(Unknown Source)

    at beast.util.XMLParser.parseFile(Unknown Source)

    at beast.app.BeastMCMC.parseArgs(Unknown Source)

    at beast.app.beastapp.BeastMain.main(Unknown Source)

    at beast.app.beastapp.BeastLauncher.main(Unknown Source)

  Ignoring ambiguities in tree likelihood.

  Ignoring character uncertainty in tree likelihood.

  With 8 unique site   Using BEAGLE version: 2.1 resource 0: CPU
    with instance flags:  PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL SCALING_MANUAL SCALERS_RAW VECTOR_SSE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU

  Using BEAGLE version: 2.1 resource 0: CPU
    with instance flags:  PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL SCALING_MANUAL SCALERS_RAW VECTOR_SSE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU

patterns.

  Using rescaling scheme : dynamic

java.lang.NullPointerException

    at beast.evolution.likelihood.BeagleTreeLikelihood.setUpSubstModel(Unknown Source)

    at beast.evolution.likelihood.BeagleTreeLikelihood.initialize(Unknown Source)

    at beast.evolution.likelihood.BeagleTreeLikelihood.initAndValidate(Unknown Source)

    at beast.core.BEASTInterface.initByName(Unknown Source)

    at beast.evolution.likelihood.TreeLikelihood.initAndValidate(Unknown Source)

    at beast.util.XMLParser.initPlugins(Unknown Source)

    at beast.util.XMLParser.parse(Unknown Source)

    at beast.util.XMLParser.parseFile(Unknown Source)

    at beast.app.BeastMCMC.parseArgs(Unknown Source)

    at beast.app.beastapp.BeastMain.main(Unknown Source)

    at beast.app.beastapp.BeastLauncher.main(Unknown Source)

  Ignoring ambiguities in tree likelihood.

  Ignoring character uncertainty in tree likelihood.

  With 6 unique site patterns.

  Using rescaling scheme : dynamic

java.lang.NullPointerException

    at beast.evolution.likelihood.BeagleTree  Using BEAGLE version: 2.1 resource 0: CPU
    with instance flags:  PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL SCALING_MANUAL SCALERS_RAW VECTOR_SSE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU

Likelihood.setUpSubstModel(Unknown Source)

    at beast.evolution.likelihood.BeagleTreeLikelihood.initialize(Unknown Source)

    at beast.evolution.likelihood.BeagleTreeLikelihood.initAndValidate(Unknown Source)

    at beast.core.BEASTInterface.initByName(Unknown Source)

    at beast.evolution.likelihood.TreeLikelihood.initAndValidate(Unknown Source)

    at beast.util.XMLParser.initPlugins(Unknown Source)

    at beast.util.XMLParser.parse(Unknown Source)

    at beast.util.XMLParser.parseFile(Unknown Source)

    at beast.app.BeastMCMC.parseArgs(Unknown Source)

    at beast.app.beastapp.BeastMain.main(Unknown Source)

    at beast.app.beastapp.BeastLauncher.main(Unknown Source)

  Ignoring ambiguities in tree likelihood.

  Ignoring character uncertainty in tree likelihood.

  With 450 unique site patterns.

  Using rescaling scheme : dynamic

  Ignoring ambiguities in tree likelihood.

  Ignoring character uncertainty in tree likelihood.

  With 366 unique site patterns.

  Using rescaling scheme : dynamic

  Ignoring ambiguities in tree likelihood.

  Ignoring character uncertainty in tree likelihood.

  With 248 unique site patterns.

  Using rescaling scheme : dynamic

  Ignoring ambiguities in tree likelihood.

  Ignoring character uncertainty in tree likelihood.

  With 400 unique site patterns.

  Using rescaling scheme : dynamic

  Using BEAGLE version: 2.1 resource 0: CPU
    with instance flags:  PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL SCALING_MANUAL SCALERS_RAW VECTOR_SSE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU

  Using BEAGLE version: 2.1 resource 0: CPU
    with instance flags:  PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL SCALING_MANUAL SCALERS_RAW VECTOR_SSE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU

  Using BEAGLE version: 2.1 resource 0: CPU
    with instance flags:  PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL SCALING_MANUAL SCALERS_RAW VECTOR_SSE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU

  Using BEAGLE version: 2.1 resource 0: CPU
    with instance flags:  PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL SCALING_MANUAL SCALERS_RAW VECTOR_SSE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU


WARNING: StateNode (rateCategories.c:Eumy-beast-morph58-d) found that has no effect on posterior!



WARNING: StateNode (rateCategories.c:12S) found that has no effect on posterior!



WARNING: StateNode (rateCategories.c:GHR) found that has no effect on posterior!



WARNING: StateNode (rateCategories.c:rag1) found that has no effect on posterior!



WARNING: StateNode (rateCategories.c:vWF) found that has no effect on posterior!



WARNING: StateNode (freqParameter.s:rag1) found that has no effect on posterior!



WARNING: StateNode (freqParameter.s:GHR) found that has no effect on posterior!



WARNING: StateNode (freqParameter.s:vWF) found that has no effect on posterior!



WARNING: StateNode (freqParameter.s:12S) found that has no effect on posterior!


Start likelihood: -137.49192049464133

What do those warnings mean?
Thanks,
Alicia

Remco Bouckaert

unread,
Apr 27, 2016, 3:54:45 PM4/27/16
to beast...@googlegroups.com
Hi Alicia,

When you sample from the prior, the likelihood is removed from the posterior, which means there can be some parameters that only affect the likelihood, but not the prior, that have no effect on the posterior any more. One example is the rate category paramater used in relaxed clocks. When not sampling from the prior, you should look at these warnings, but when sampling from the prior, these warnings can be ignored.

You may try to run without beagle (use the -java option) to prevent the NullPointerException errors when sampling from the prior.

Cheers,

Remco



--
You received this message because you are subscribed to the Google Groups "beast-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beast-users...@googlegroups.com.
To post to this group, send email to beast...@googlegroups.com.
Visit this group at https://groups.google.com/group/beast-users.
For more options, visit https://groups.google.com/d/optout.

alicia alvarez

unread,
Apr 28, 2016, 4:19:00 PM4/28/16
to beast-users
Dear Remco
thank you so much for your answer!
I have similar warning when running the matrix (not from the prior)
I´m attaching the output of BEAST. The results I have obtained looks pretty well, but I am not sure to have confidence on them because of these warnings.
I am sorry about my questions that surely are really basic, but I don´t have too much experience with this software...

Thanks again
Best,
Alicia
out-monof70-warnings.txt

Remco Bouckaert

unread,
May 2, 2016, 2:24:47 PM5/2/16
to beast...@googlegroups.com
Hi Alicia,

Thanks for the file —  you are using the LewisMK model, which at the moment cannot be used with BEAGLE. What happens is that an attempt is made to initialise BEAGLE for the partitions using the MK model, and when that fails a Java based TreeLikelihood is used instead. In v2.4.1, it reports just after the error message related to BEAGLE initialisation:
TreeLikelihood(morphTreeLikelihood.Eumy-beast-morph58-d5) uses BeerLikelihoodCore
so your analysis is valid and the error message can be ignored.

Cheers,

Remco


<out-monof70-warnings.txt>

alicia alvarez

unread,
May 3, 2016, 1:41:40 PM5/3/16
to beast-users
Dear Remco
thank you so much for your help!

I have another question, regarding the FBD analysis...does it make sense to use this approach with one fossil (and 26 extant species) and to include MCRA calibrations for some nodes?

Best
Alicia

Guillaume L

unread,
Feb 19, 2024, 12:26:17 PM2/19/24
to beast-users
Hi everyone,

I had the same problem: "Sample from prior flag is set, but distribution with id 'likelihood' is not an input to posterior".
For the record, the XML produced by Beauti was indeed incorrect. I don't know why, but version 2.6.3 produces the right XML, while version 2.6.6 produces the incorrect output.

If you want to edit it by hand, you can take the incorrect XML, and look for this block:

    <log id="likelihood" spec="util.CompoundDistribution" useThreads="true">
        ...
    </log>

You must move this block back into the block <distribution id="posterior" >, and substitute the "log" tag by a "distribution" tag:
   
    <distribution id="likelihood" ...>
        ...
    </distribution>

So it appears that the simplest to sample from the prior is either to run the original XML with `beast -sampleFromPrior`, or to edit the XML at the single line that is supposed to change, by adding sampleFromPrior="true":

    <run id="mcmc" ... sampleFromPrior="true">

Cheers,

Guillaume

Guillaume L

unread,
Feb 20, 2024, 12:13:30 PM2/20/24
to beast-users
Small Erratum:

None of my versions of Beauti creates a valid parameter file, I had to manually fix the files in both cases.
Reply all
Reply to author
Forward
0 new messages