use of dr.inference.operators.BitFlipOperator in project beast-mcmc by beast-dev.
the class BitFlipOperatorParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
Parameter parameter = (Parameter) xo.getChild(Parameter.class);
boolean usesPriorOnSum = xo.getAttribute(USES_SUM_PRIOR, true);
// boolean forDrift = xo.getAttribute(FOR_DRIFT,false);
TreeModel treeModel = (TreeModel) xo.getChild(TreeModel.class);
return new BitFlipOperator(parameter, weight, usesPriorOnSum, treeModel);
}
use of dr.inference.operators.BitFlipOperator in project beast-mcmc by beast-dev.
the class RLYModelTest method testTreeBitRandomWalk.
public void testTreeBitRandomWalk() {
TreeModel treeModel = new TreeModel("treeModel", tree);
Parameter I = treeModel.createNodeTraitsParameter(birthRateIndicator, new double[] { 1 });
Parameter b = treeModel.createNodeTraitsParameter(birthRate, new double[] { 1 });
OperatorSchedule schedule = new SimpleOperatorSchedule();
TreeBitRandomWalkOperator tbrw = new TreeBitRandomWalkOperator(treeModel, birthRateIndicator, birthRate, 1.0, 4, true);
BitFlipOperator bfo = new BitFlipOperator(I, 1.0, true);
schedule.addOperator(tbrw);
schedule.addOperator(bfo);
randomLocalYuleTester(treeModel, I, b, schedule);
}
Aggregations