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);
}
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);
}
Aggregations