use of dr.inference.operators.SimpleOperatorSchedule in project beast-mcmc by beast-dev.
the class NarrowExchangeTest method getOperatorSchedule.
public OperatorSchedule getOperatorSchedule(TreeModel treeModel) {
Parameter rootParameter = treeModel.createNodeHeightsParameter(true, false, false);
Parameter internalHeights = treeModel.createNodeHeightsParameter(false, true, false);
ExchangeOperator operator = new ExchangeOperator(ExchangeOperator.NARROW, treeModel, 1.0);
ScaleOperator scaleOperator = new ScaleOperator(rootParameter, 0.75, CoercionMode.COERCION_ON, 1.0);
UniformOperator uniformOperator = new UniformOperator(internalHeights, 1.0);
OperatorSchedule schedule = new SimpleOperatorSchedule();
schedule.addOperator(operator);
schedule.addOperator(scaleOperator);
schedule.addOperator(uniformOperator);
return schedule;
}
use of dr.inference.operators.SimpleOperatorSchedule 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