Search in sources :

Example 1 with GMRFSkygridLikelihood

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

the class GMRFSkygridBlockUpdateOperatorParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    AdaptationMode mode = AdaptationMode.parseMode(xo);
    if (mode == AdaptationMode.DEFAULT)
        mode = AdaptationMode.ADAPTATION_ON;
    double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
    double scaleFactor = xo.getDoubleAttribute(SCALE_FACTOR);
    if (scaleFactor == 1.0) {
        mode = AdaptationMode.ADAPTATION_OFF;
    }
    if (scaleFactor < 1.0) {
        throw new XMLParseException("scaleFactor must be greater than or equal to 1.0");
    }
    int maxIterations = xo.getAttribute(MAX_ITERATIONS, 200);
    double stopValue = xo.getAttribute(STOP_VALUE, 0.01);
    GMRFSkygridLikelihood gmrfSkygridLikelihood = (GMRFSkygridLikelihood) xo.getChild(GMRFSkygridLikelihood.class);
    return new GMRFSkygridBlockUpdateOperator(gmrfSkygridLikelihood, weight, mode, scaleFactor, maxIterations, stopValue);
}
Also used : GMRFSkygridBlockUpdateOperator(dr.evomodel.coalescent.operators.GMRFSkygridBlockUpdateOperator) AdaptationMode(dr.inference.operators.AdaptationMode) GMRFSkygridLikelihood(dr.evomodel.coalescent.GMRFSkygridLikelihood)

Aggregations

GMRFSkygridLikelihood (dr.evomodel.coalescent.GMRFSkygridLikelihood)1 GMRFSkygridBlockUpdateOperator (dr.evomodel.coalescent.operators.GMRFSkygridBlockUpdateOperator)1 AdaptationMode (dr.inference.operators.AdaptationMode)1