beast-dev / beast-mcmc

Bayesian Evolutionary Analysis Sampling Trees
http://beast.community
GNU Lesser General Public License v2.1
187 stars 71 forks source link

Problem updating (Gamma)SiteRateModels when using MultiPartitionDataLikelihoodDelegate and TreeDataLikelihood #841

Open GuyBaele opened 7 years ago

GuyBaele commented 7 years ago

When using multiple partitions, with accompanying PatternLists, (Gamma)SiteRateModels and BranchModels in the code base, updating one of the siteModels generates a store/restore error as the one shown below. Updating substitution model parameters for any of the partitions works fine on the other hand. I have committed additional code in DataLikelihoodTester.java which hopefully shows the problem.

Will in the mean time try to look further into the problem.

BEAST v1.9.0 Prerelease r20160703

Generated Tue Sep 20 15:28:33 CEST 2016 [seed=1474378103798]

state Posterior Prior Likelihood rootHeight ucld.stdev
0 -277607.6250 -37.1221 -277570.5029 0.12719 0.33333 - State 0: State was not correctly calculated after an operator move. Likelihood evaluation: -277481.37621135847 0.053 seconds Full Likelihood evaluation: -277607.62497360416

Operator: scaleOperator(ATP6.alpha [0.75, 1.3333333333333333] scale(ATP6.alpha)

Details Before: CompoundLikelihood(compoundModel)=( Gamma(ATP6.ac)=-3.184, Gamma(ATP6.ag)=-3.1687, Gamma(ATP6.at)=-3.184, Gamma(ATP6.cg)=-3.184, Gamma(ATP6.gt)=-3.184, Gamma(ATP8.ac)=-3.184, Gamma(ATP8.ag)=-3.1687, Gamma(ATP8.at)=-3.184, Gamma(ATP8.cg)=-3.184, Gamma(ATP8.gt)=-3.184, Exponential(ucld.stdev)=0.0986, LogNormal(yule.birthRate)=-1.4621, BirthDeathGernhard08Model/yule(treeModel)=-3.9492 Total = -37.12205824463286 ), CompoundLikelihood(compoundModel)=( TreeDataLikelihood(TreeDataLikelihood[ATP6-8.newTreeDataLikelihood])=-277444.2542 Total = -277444.2541531138 ) Total = -277481.37621135847 After: CompoundLikelihood(compoundModel)=( Gamma(ATP6.ac)=-3.184, Gamma(ATP6.ag)=-3.1687, Gamma(ATP6.at)=-3.184, Gamma(ATP6.cg)=-3.184, Gamma(ATP6.gt)=-3.184, Gamma(ATP8.ac)=-3.184, Gamma(ATP8.ag)=-3.1687, Gamma(ATP8.at)=-3.184, Gamma(ATP8.cg)=-3.184, Gamma(ATP8.gt)=-3.184, Exponential(ucld.stdev)=0.0986, LogNormal(yule.birthRate)=-1.4621, BirthDeathGernhard08Model/yule(treeModel)=-3.9492 Total = -37.12205824463286 ), CompoundLikelihood(compoundModel)=( TreeDataLikelihood(TreeDataLikelihood[ATP6-8.newTreeDataLikelihood])=-277570.5029 Total = -277570.5029153595 ) Total = -277607.62497360416

Exception in thread "Thread-2" java.lang.RuntimeException: An error was encounted. Terminating BEAST at dr.util.ErrorLogHandler.publish(ErrorLogHandler.java:54) at java.util.logging.Logger.log(Logger.java:738) at java.util.logging.Logger.doLog(Logger.java:765) at java.util.logging.Logger.log(Logger.java:788) at java.util.logging.Logger.severe(Logger.java:1463) at dr.inference.markovchain.MarkovChain.runChain(MarkovChain.java:307) at dr.inference.mcmc.MCMC.chain(MCMC.java:265) at dr.inference.mcmc.MCMC.run(MCMC.java:212) at java.lang.Thread.run(Thread.java:745)

GuyBaele commented 7 years ago

Just read in the comments of calculateLikelihood() of MultiPartitionDataLikelihoodDelegate: // we are currently assuming a no-category model...

Will keep this issue open but continue testing without rate categories ...

rambaut commented 7 years ago

@GuyBaele - Following this up. Does this issue need to be updated?