Search in sources :

Example 6 with SimpleOperatorSchedule

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;
}
Also used : SimpleOperatorSchedule(dr.inference.operators.SimpleOperatorSchedule) OperatorSchedule(dr.inference.operators.OperatorSchedule) SimpleOperatorSchedule(dr.inference.operators.SimpleOperatorSchedule) ExchangeOperator(dr.evomodel.operators.ExchangeOperator) Parameter(dr.inference.model.Parameter) UniformOperator(dr.inference.operators.UniformOperator) ScaleOperator(dr.inference.operators.ScaleOperator)

Example 7 with SimpleOperatorSchedule

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

SimpleOperatorSchedule (dr.inference.operators.SimpleOperatorSchedule)7 OperatorSchedule (dr.inference.operators.OperatorSchedule)6 Parameter (dr.inference.model.Parameter)4 ScaleOperator (dr.inference.operators.ScaleOperator)4 MCMCOperator (dr.inference.operators.MCMCOperator)3 TreeModel (dr.evomodel.tree.TreeModel)2 UniformOperator (dr.inference.operators.UniformOperator)2 ConstantPopulationModel (dr.evomodel.coalescent.ConstantPopulationModel)1 ExchangeOperator (dr.evomodel.operators.ExchangeOperator)1 GibbsSubtreeSwap (dr.evomodel.operators.GibbsSubtreeSwap)1 SubtreeSlideOperator (dr.evomodel.operators.SubtreeSlideOperator)1 TreeBitRandomWalkOperator (dr.evomodel.operators.TreeBitRandomWalkOperator)1 DistributionLikelihood (dr.inference.distribution.DistributionLikelihood)1 ArrayLogFormatter (dr.inference.loggers.ArrayLogFormatter)1 MCLogger (dr.inference.loggers.MCLogger)1 TabDelimitedFormatter (dr.inference.loggers.TabDelimitedFormatter)1 MCMC (dr.inference.mcmc.MCMC)1 MCMCOptions (dr.inference.mcmc.MCMCOptions)1 CompoundLikelihood (dr.inference.model.CompoundLikelihood)1 CompoundParameter (dr.inference.model.CompoundParameter)1