Search in sources :

Example 1 with BitFlipOperator

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);
}
Also used : TreeModel(dr.evomodel.tree.TreeModel) BitFlipOperator(dr.inference.operators.BitFlipOperator) Parameter(dr.inference.model.Parameter)

Example 2 with BitFlipOperator

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);
}
Also used : TreeModel(dr.evomodel.tree.TreeModel) SimpleOperatorSchedule(dr.inference.operators.SimpleOperatorSchedule) OperatorSchedule(dr.inference.operators.OperatorSchedule) SimpleOperatorSchedule(dr.inference.operators.SimpleOperatorSchedule) BitFlipOperator(dr.inference.operators.BitFlipOperator) Parameter(dr.inference.model.Parameter) TreeBitRandomWalkOperator(dr.evomodel.operators.TreeBitRandomWalkOperator)

Aggregations

TreeModel (dr.evomodel.tree.TreeModel)2 Parameter (dr.inference.model.Parameter)2 BitFlipOperator (dr.inference.operators.BitFlipOperator)2 TreeBitRandomWalkOperator (dr.evomodel.operators.TreeBitRandomWalkOperator)1 OperatorSchedule (dr.inference.operators.OperatorSchedule)1 SimpleOperatorSchedule (dr.inference.operators.SimpleOperatorSchedule)1