Search in sources :

Example 21 with TreeLikelihood

use of dr.oldevomodel.treelikelihood.TreeLikelihood in project beast-mcmc by beast-dev.

the class LikelihoodTest method testLikelihoodK80.

public void testLikelihoodK80() {
    System.out.println("\nTest Likelihood using K80:");
    // Sub model
    Parameter freqs = new Parameter.Default(new double[] { 0.25, 0.25, 0.25, 0.25 });
    Parameter kappa = new Parameter.Default(HKYParser.KAPPA, 27.402591, 0, 100);
    FrequencyModel f = new FrequencyModel(Nucleotides.INSTANCE, freqs);
    HKY hky = new HKY(kappa, f);
    //siteModel
    GammaSiteModel siteModel = new GammaSiteModel(hky);
    Parameter mu = new Parameter.Default(GammaSiteModelParser.MUTATION_RATE, 1.0, 0, Double.POSITIVE_INFINITY);
    siteModel.setMutationRateParameter(mu);
    //treeLikelihood
    SitePatterns patterns = new SitePatterns(alignment, null, 0, -1, 1, true);
    TreeLikelihood treeLikelihood = new TreeLikelihood(patterns, treeModel, siteModel, null, null, false, false, true, false, false);
    assertEquals("treeLikelihoodK80", format.format(-1856.30305), format.format(treeLikelihood.getLogLikelihood()));
}
Also used : FrequencyModel(dr.oldevomodel.substmodel.FrequencyModel) SitePatterns(dr.evolution.alignment.SitePatterns) GammaSiteModel(dr.oldevomodel.sitemodel.GammaSiteModel) HKY(dr.oldevomodel.substmodel.HKY) TreeLikelihood(dr.oldevomodel.treelikelihood.TreeLikelihood) Parameter(dr.inference.model.Parameter)

Aggregations

TreeLikelihood (dr.oldevomodel.treelikelihood.TreeLikelihood)21 GammaSiteModel (dr.oldevomodel.sitemodel.GammaSiteModel)20 Parameter (dr.inference.model.Parameter)16 FrequencyModel (dr.oldevomodel.substmodel.FrequencyModel)16 SitePatterns (dr.evolution.alignment.SitePatterns)15 HKY (dr.oldevomodel.substmodel.HKY)11 ArrayList (java.util.ArrayList)6 ExchangeOperator (dr.evomodel.operators.ExchangeOperator)5 SubtreeSlideOperator (dr.evomodel.operators.SubtreeSlideOperator)5 WilsonBalding (dr.evomodel.operators.WilsonBalding)5 TreeModel (dr.evomodel.tree.TreeModel)5 ArrayLogFormatter (dr.inference.loggers.ArrayLogFormatter)5 MCLogger (dr.inference.loggers.MCLogger)5 TabDelimitedFormatter (dr.inference.loggers.TabDelimitedFormatter)5 MCMC (dr.inference.mcmc.MCMC)5 MCMCOptions (dr.inference.mcmc.MCMCOptions)5 ArrayTraceList (dr.inference.trace.ArrayTraceList)5 Trace (dr.inference.trace.Trace)5 TraceCorrelation (dr.inference.trace.TraceCorrelation)5 GTR (dr.oldevomodel.substmodel.GTR)4