Search in sources :

Example 6 with BirthDeathGernhard08Model

use of dr.evomodel.speciation.BirthDeathGernhard08Model in project beast-mcmc by beast-dev.

the class YuleModelParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    final Units.Type units = XMLUnits.Utils.getUnitsAttr(xo);
    final XMLObject cxo = xo.getChild(BIRTH_RATE);
    final boolean conditonalOnRoot = xo.getAttribute(BirthDeathModelParser.CONDITIONAL_ON_ROOT, false);
    final Parameter brParameter = (Parameter) cxo.getChild(Parameter.class);
    Logger.getLogger("dr.evomodel").info("\nUsing Yule prior on tree");
    return new BirthDeathGernhard08Model(xo.getId(), brParameter, null, null, BirthDeathGernhard08Model.TreeType.UNSCALED, units, conditonalOnRoot);
}
Also used : BirthDeathGernhard08Model(dr.evomodel.speciation.BirthDeathGernhard08Model) Parameter(dr.inference.model.Parameter) Units(dr.evolution.util.Units) XMLUnits(dr.evoxml.util.XMLUnits)

Example 7 with BirthDeathGernhard08Model

use of dr.evomodel.speciation.BirthDeathGernhard08Model in project beast-mcmc by beast-dev.

the class YuleLikelihoodTest method yuleLikelihoodTester.

private void yuleLikelihoodTester(Tree tree, double birthRate, double logL) {
    Parameter b = new Parameter.Default("b", birthRate, 0.0, Double.MAX_VALUE);
    Parameter d = new Parameter.Default("d", 0.0, 0.0, Double.MAX_VALUE);
    SpeciationModel speciationModel = new BirthDeathGernhard08Model(b, d, null, BirthDeathGernhard08Model.TreeType.TIMESONLY, Units.Type.YEARS);
    Likelihood likelihood = new SpeciationLikelihood(tree, speciationModel, "yule.like");
    assertEquals(likelihood.getLogLikelihood(), logL);
}
Also used : Likelihood(dr.inference.model.Likelihood) SpeciationLikelihood(dr.evomodel.speciation.SpeciationLikelihood) BirthDeathGernhard08Model(dr.evomodel.speciation.BirthDeathGernhard08Model) Parameter(dr.inference.model.Parameter) SpeciationModel(dr.evomodel.speciation.SpeciationModel) SpeciationLikelihood(dr.evomodel.speciation.SpeciationLikelihood)

Aggregations

BirthDeathGernhard08Model (dr.evomodel.speciation.BirthDeathGernhard08Model)7 Parameter (dr.inference.model.Parameter)6 SpeciationLikelihood (dr.evomodel.speciation.SpeciationLikelihood)5 SpeciationModel (dr.evomodel.speciation.SpeciationModel)5 Likelihood (dr.inference.model.Likelihood)5 MCLogger (dr.inference.loggers.MCLogger)3 MCMC (dr.inference.mcmc.MCMC)3 MCMCOptions (dr.inference.mcmc.MCMCOptions)3 Units (dr.evolution.util.Units)2 TreeHeightStatistic (dr.evomodel.tree.TreeHeightStatistic)2 TreeLengthStatistic (dr.evomodel.tree.TreeLengthStatistic)2 XMLUnits (dr.evoxml.util.XMLUnits)2 ArrayLogFormatter (dr.inference.loggers.ArrayLogFormatter)2 TabDelimitedFormatter (dr.inference.loggers.TabDelimitedFormatter)2 ArrayTraceList (dr.inference.trace.ArrayTraceList)2 Trace (dr.inference.trace.Trace)2 TraceCorrelation (dr.inference.trace.TraceCorrelation)2 NexusImporter (dr.evolution.io.NexusImporter)1 FlexibleTree (dr.evolution.tree.FlexibleTree)1 Tree (dr.evolution.tree.Tree)1