evolvedmicrobe / beast-mcmc

Automatically exported from code.google.com/p/beast-mcmc
GNU Lesser General Public License v2.1
0 stars 1 forks source link

-Infinity value always come out when i try to load xml #750

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1 why it always offer -Infinity value when i try to beast in beagle? This can  
be solved by few attempts. But i wonder how to fix it for ever. maybe i set 
some wrong prior?  

here is the problem, you see "-Inf"
##########################################################################
  CompoundLikelihood(compoundModel)=(
    BeagleTreeLikelihood(treeLikelihood[treeLikelihood_6])=-9190.03, 
    BeagleTreeLikelihood(treeLikelihood[treeLikelihood_6])=-Inf, 
    BeagleTreeLikelihood(treeLikelihood[treeLikelihood_6])=-Inf, 
    BeagleTreeLikelihood(treeLikelihood[treeLikelihood_6])=-Inf, 
    BeagleTreeLikelihood(treeLikelihood[treeLikelihood_6])=-Inf, 
    BeagleTreeLikelihood(treeLikelihood[treeLikelihood_6])=-9317.2341
    Total = -Infinity
  )
  Total = -Infinity

#######################################################################
What version of the product are you using? On what operating system?

beast 1.8 and beagle 2.1.2
##########################################################################
Please provide any additional information below.

sing discretized relaxed clock model.
  over sampling = 1
  parametric model = logNormalDistributionModel
   rate categories = 1
Creating state frequencies model 'frequencies': Initial frequencies = {0.25, 
0.25, 0.25, 0.25}
Creating HKY substitution model. Initial kappa = 2.0
Creating site model: 
  4 category discrete gamma with initial shape = 0.5
  initial proportion of invariant sites = 0.5
Using BEAGLE TreeLikelihood
  Branch rate model used: discretizedBranchRates
  Using BEAGLE resource 0: CPU
    with instance flags:  PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL SCALING_MANUAL SCALERS_RAW VECTOR_NONE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU
  Ignoring ambiguities in tree likelihood.
  With 56 unique site patterns.
  Using rescaling scheme : dynamic (rescaling every 100 evaluations)
Using BEAGLE TreeLikelihood
  Branch rate model used: discretizedBranchRates
  Using BEAGLE resource 0: CPU
    with instance flags:  PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL SCALING_MANUAL SCALERS_RAW VECTOR_NONE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU
  Ignoring ambiguities in tree likelihood.
  With 56 unique site patterns.
  Using rescaling scheme : dynamic (rescaling every 100 evaluations)
Using BEAGLE TreeLikelihood
  Branch rate model used: discretizedBranchRates
  Using BEAGLE resource 0: CPU
    with instance flags:  PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL SCALING_MANUAL SCALERS_RAW VECTOR_NONE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU
  Ignoring ambiguities in tree likelihood.
  With 56 unique site patterns.
  Using rescaling scheme : dynamic (rescaling every 100 evaluations)
Using BEAGLE TreeLikelihood
  Branch rate model used: discretizedBranchRates
  Using BEAGLE resource 0: CPU
    with instance flags:  PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL SCALING_MANUAL SCALERS_RAW VECTOR_NONE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU
  Ignoring ambiguities in tree likelihood.
  With 56 unique site patterns.
  Using rescaling scheme : dynamic (rescaling every 100 evaluations)
Using BEAGLE TreeLikelihood
  Branch rate model used: discretizedBranchRates
  Using BEAGLE resource 0: CPU
    with instance flags:  PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL SCALING_MANUAL SCALERS_RAW VECTOR_NONE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU
  Ignoring ambiguities in tree likelihood.
  With 56 unique site patterns.
  Using rescaling scheme : dynamic (rescaling every 100 evaluations)
Using BEAGLE TreeLikelihood
  Branch rate model used: discretizedBranchRates
  Using BEAGLE resource 0: CPU
    with instance flags:  PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL SCALING_MANUAL SCALERS_RAW VECTOR_NONE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU
  Ignoring ambiguities in tree likelihood.
  With 56 unique site patterns.
  Using rescaling scheme : dynamic (rescaling every 100 evaluations)
Creating swap operator for parameter branchRates.categories (weight=10.0)
Optimization Schedule: default
Likelihood computation is using a pool of 6 threads.
Creating the MCMC chain:
  chainLength=20000000
  autoOptimize=true
  autoOptimize delayed for 200000 steps
Underflow calculating likelihood. Attempting a rescaling...
Underflow calculating likelihood. Attempting a rescaling...
Underflow calculating likelihood. Attempting a rescaling...
Underflow calculating likelihood. Attempting a rescaling...
Error running file: coi.xml
The initial model is invalid because state has a zero probability.

If the log likelihood of the tree is -Inf, his 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)=(
    LogNormal(kappa)=-1.8654, 
    Uniform(frequencies)=0.0, 
    Exponential(alpha)=-0.3069, 
    Gamma(pInv)=-0.4231, 
    Exponential(ucld.stdev)=0.0986, 
    Uniform(yule.birthRate)=-230.2585, 
    BirthDeathGernhard08Model/yule(treeModel)=-630649.0281
    Total = -630881.7832675388
  ), 
  CompoundLikelihood(compoundModel)=(
    BeagleTreeLikelihood(treeLikelihood[treeLikelihood_6])=-9190.03, 
    BeagleTreeLikelihood(treeLikelihood[treeLikelihood_6])=-Inf, 
    BeagleTreeLikelihood(treeLikelihood[treeLikelihood_6])=-Inf, 
    BeagleTreeLikelihood(treeLikelihood[treeLikelihood_6])=-Inf, 
    BeagleTreeLikelihood(treeLikelihood[treeLikelihood_6])=-Inf, 
    BeagleTreeLikelihood(treeLikelihood[treeLikelihood_6])=-9317.2341
    Total = -Infinity
  )
  Total = -Infinity

Original issue reported on code.google.com by Quinn775...@gmail.com on 15 Oct 2014 at 10:05

GoogleCodeExporter commented 9 years ago
This looks to be an issue with scaling when the initial tree is a random 
(extremely low probability) tree. Perhaps dynamic scaling should do scaling 
always for the first 1000 steps to get over this hump?

Original comment by ramb...@gmail.com on 17 Dec 2014 at 10:14

GoogleCodeExporter commented 9 years ago
Actually, I suspect that this is issue is related to multithreading. See the 
issue I made today on GitHub: https://github.com/armanbilge/BEAST3/issues/21

Original comment by armanbilge on 17 Feb 2015 at 7:53

GoogleCodeExporter commented 9 years ago
I agree this is probably due to synchronisation issues with threads. This issue 
is related: https://code.google.com/p/beast-mcmc/issues/detail?id=756

Need to do a deeper examination of the threading issues - I suspect some 
synchronization on most objects referenced in TreeLikelihood in the initial 
traversal of the tree.

Original comment by ramb...@gmail.com on 17 Feb 2015 at 8:00

GoogleCodeExporter commented 9 years ago
Thanks for the pointer—I think that I may have found the problem. 
BaseSubstitutionModel.getEigenDecomposition() has decompose() in a synchronized 
block. However, the HKY and TN93 models override getEigenDecomposition() 
without using synchronization. Adding synchronized to their method signatures 
for getEigenDecomposition() appears to solve the problem for me. It looks like 
all of the issues reported involved analyses using HKY.

Original comment by armanbilge on 17 Feb 2015 at 8:48

GoogleCodeExporter commented 9 years ago
Thanks. I will look into this in more detail. My feeling is it is better to 
build the thread synchronization at the point where these classes are accessed 
(i.e., TreeLikelihood) rather than relying on all these classes being thread 
safe.

Original comment by ramb...@gmail.com on 17 Feb 2015 at 10:30

GoogleCodeExporter commented 9 years ago
I am struggling to replicate this by creating a new XML. Could you post an 
example XML where it happens?

Original comment by ramb...@gmail.com on 5 Mar 2015 at 9:23

GoogleCodeExporter commented 9 years ago
I too am getting the "Underflow calculating likelihood. Attempting a 
rescaling... " in v1.8.2 on a dual Xeon (8 core total) MacPro Snow Leop. I 
chose 8 cores from the pulldown menu rather than leave at the default of 
"automatic". The analyses continues to run without errors.
 I have attached the xml for replication

Original comment by wbsi...@gmail.com on 28 Mar 2015 at 12:16

Attachments:

GoogleCodeExporter commented 9 years ago
"Underflow calculating likelihood. Attempting a rescaling... ": These messages 
don't mean anything is wrong. This is not related the issue above.

Original comment by ramb...@gmail.com on 28 Mar 2015 at 12:26