Search in sources :

Example 1 with BayesianSkylineGibbsOperator

use of dr.evomodel.coalescent.operators.BayesianSkylineGibbsOperator in project beast-mcmc by beast-dev.

the class BayesianSkylineGibbsOperatorParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
    final double lowerBound = xo.getAttribute(LOWER, 0.0);
    final double upperBound = xo.getAttribute(UPPER, Double.MAX_VALUE);
    final boolean jeffreysPrior = xo.getAttribute(JEFFREYS, true);
    boolean exponentialMarkovPrior = xo.getAttribute(EXPONENTIALMARKOV, false);
    double shape = xo.getAttribute(SHAPE, 1.0);
    boolean reverse = xo.getAttribute(REVERSE, false);
    int iterations = xo.getAttribute(ITERATIONS, 1);
    BayesianSkylineLikelihood bayesianSkylineLikelihood = (BayesianSkylineLikelihood) xo.getChild(BayesianSkylineLikelihood.class);
    // This is the parameter on which this operator acts
    Parameter paramPops = (Parameter) xo.getChild(Parameter.class);
    Parameter paramGroups = bayesianSkylineLikelihood.getGroupSizeParameter();
    final int type = bayesianSkylineLikelihood.getType();
    if (type != BayesianSkylineLikelihood.STEPWISE_TYPE) {
        throw new XMLParseException("Need stepwise control points (set 'linear=\"false\"' in skyline Gibbs operator)");
    }
    return new BayesianSkylineGibbsOperator(bayesianSkylineLikelihood, paramPops, paramGroups, type, weight, lowerBound, upperBound, jeffreysPrior, exponentialMarkovPrior, shape, reverse, iterations);
}
Also used : BayesianSkylineGibbsOperator(dr.evomodel.coalescent.operators.BayesianSkylineGibbsOperator) Parameter(dr.inference.model.Parameter) BayesianSkylineLikelihood(dr.evomodel.coalescent.BayesianSkylineLikelihood)

Aggregations

BayesianSkylineLikelihood (dr.evomodel.coalescent.BayesianSkylineLikelihood)1 BayesianSkylineGibbsOperator (dr.evomodel.coalescent.operators.BayesianSkylineGibbsOperator)1 Parameter (dr.inference.model.Parameter)1