Search in sources :

Example 1 with BranchRateGradientWrtIncrements

use of dr.evomodel.branchratemodel.BranchRateGradientWrtIncrements in project beast-mcmc by beast-dev.

the class BranchRateGradientWrtIncrementsParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    AutoCorrelatedGradientWrtIncrements priorProvider = (AutoCorrelatedGradientWrtIncrements) xo.getChild(AutoCorrelatedGradientWrtIncrements.class);
    GradientWrtParameterProvider rateProvider = (GradientWrtParameterProvider) xo.getChild(GradientWrtParameterProvider.class);
    if (!(rateProvider instanceof BranchRateGradient) && !(rateProvider instanceof BranchRateGradientForDiscreteTrait)) {
        throw new XMLParseException("Must provide a branch rate gradient");
    }
    return new BranchRateGradientWrtIncrements(rateProvider, priorProvider);
}
Also used : BranchRateGradient(dr.evomodel.treedatalikelihood.continuous.BranchRateGradient) BranchRateGradientForDiscreteTrait(dr.evomodel.treedatalikelihood.discrete.BranchRateGradientForDiscreteTrait) GradientWrtParameterProvider(dr.inference.hmc.GradientWrtParameterProvider) AutoCorrelatedGradientWrtIncrements(dr.evomodel.branchratemodel.AutoCorrelatedGradientWrtIncrements) BranchRateGradientWrtIncrements(dr.evomodel.branchratemodel.BranchRateGradientWrtIncrements)

Aggregations

AutoCorrelatedGradientWrtIncrements (dr.evomodel.branchratemodel.AutoCorrelatedGradientWrtIncrements)1 BranchRateGradientWrtIncrements (dr.evomodel.branchratemodel.BranchRateGradientWrtIncrements)1 BranchRateGradient (dr.evomodel.treedatalikelihood.continuous.BranchRateGradient)1 BranchRateGradientForDiscreteTrait (dr.evomodel.treedatalikelihood.discrete.BranchRateGradientForDiscreteTrait)1 GradientWrtParameterProvider (dr.inference.hmc.GradientWrtParameterProvider)1