JifengJiang / beast-mcmc

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

Full evaluation error #751

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Run the attached with seed 1416263702625. You should get a full evaluation 
error at state 1193:

State 1193: State was not correctly restored after reject step.
Likelihood before: -139383.49299576558 Likelihood after: -139383.4584840466
Operator: dr.evomodel.operators.ExchangeOperator@2594e776 Wide 
Exchange(treeModel)

Details
Before: 
CompoundLikelihood(compoundModel)=(
  LogNormal(kappa)=-2.2567, 
  Gamma(skygrid.precision)=-10.6715, 
  GMRFMultilocusSkyrideLikelihood(gmrfSkyrideLikelihood[skygrid])=-2208.0189
  Total = -2220.947049730265
), 
CompoundLikelihood(compoundModel)=(
  TreeLikelihood(treeLikelihood)=-137162.5459
  Total = -137162.54594603533
)
Total = -139383.49299576558
After: 
CompoundLikelihood(compoundModel)=(
  LogNormal(kappa)=-2.2567, 
  Gamma(skygrid.precision)=-10.6715, 
  GMRFMultilocusSkyrideLikelihood(gmrfSkyrideLikelihood[skygrid])=-2208.0189
  Total = -2220.947049730265
), 
CompoundLikelihood(compoundModel)=(
  TreeLikelihood(treeLikelihood)=-137162.5114
  Total = -137162.51143431634
)
Total = -139383.4584840466

This happens whether or not Beagle is enabled (although the "before" likelihood 
is -Inf rather than -137162.54594603533 if it is on). It doesn't happen with 
beagle_scaling always though.

Original issue reported on code.google.com by mdhall272 on 18 Nov 2014 at 9:35

Attachments:

GoogleCodeExporter commented 9 years ago
Looks like the dynamic scaling is loosing some precision. The difference is at 
the 2nd decimal place in the treelikelihood. Try using -beagle_rescale 100 . 
This forces a full rescaling every 100 steps (the default is 1000).

Original comment by ramb...@gmail.com on 18 Nov 2014 at 9:40

GoogleCodeExporter commented 9 years ago
No joy, unfortunately - the error occurs all the way down to -beagle_rescale 1.

Original comment by mdhall272 on 18 Nov 2014 at 10:02

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
'-beagle_scaling always' fixes this issue confirming it is a rescaling issue. 
When using default scaling, the error occurs after an underflow gives a -Inf 
likelihood and then reevaluation with a rescale gives a non-infinite likelihood.

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

GoogleCodeExporter commented 9 years ago
I understand why this is happening: An underflow is triggering a recomputation 
of the scale factors but the likelihood is not being recomputed correctly with 
the new scale factors leaving a -Inf. When the full evaluation test happens it 
recomputes the full likelihood correctly with the new scale factors. Not sure 
what the fix is yet.

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