Search in sources :

Example 1 with GMRFSkyrideGradient

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

the class GMRFSkyrideGradientParser method parseXMLObject.

@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    // Parameter parameter = (Parameter) xo.getChild(Parameter.class);
    TreeModel tree = (TreeModel) xo.getChild(TreeModel.class);
    OldGMRFSkyrideLikelihood skyrideLikelihood = (OldGMRFSkyrideLikelihood) xo.getChild(OldGMRFSkyrideLikelihood.class);
    String wrtParameterCase = (String) xo.getAttribute(WRT_PARAMETER);
    GMRFGradient.WrtParameter type = GMRFGradient.WrtParameter.factory(wrtParameterCase);
    if (type != null) {
        type.getWarning((GMRFMultilocusSkyrideLikelihood) skyrideLikelihood);
        return new GMRFGradient((GMRFMultilocusSkyrideLikelihood) skyrideLikelihood, type);
    }
    // Old behaviour
    GMRFSkyrideGradient.WrtParameter wrtParameter = setupWrtParameter(wrtParameterCase);
    NodeHeightTransform nodeHeightTransform = (NodeHeightTransform) xo.getChild(NodeHeightTransform.class);
    return new GMRFSkyrideGradient(skyrideLikelihood, wrtParameter, tree, nodeHeightTransform);
}
Also used : TreeModel(dr.evomodel.tree.TreeModel) GMRFSkyrideGradient(dr.evomodel.coalescent.GMRFSkyrideGradient) NodeHeightTransform(dr.evomodel.treedatalikelihood.discrete.NodeHeightTransform) OldGMRFSkyrideLikelihood(dr.evomodel.coalescent.OldGMRFSkyrideLikelihood) GMRFGradient(dr.evomodel.coalescent.hmc.GMRFGradient)

Aggregations

GMRFSkyrideGradient (dr.evomodel.coalescent.GMRFSkyrideGradient)1 OldGMRFSkyrideLikelihood (dr.evomodel.coalescent.OldGMRFSkyrideLikelihood)1 GMRFGradient (dr.evomodel.coalescent.hmc.GMRFGradient)1 TreeModel (dr.evomodel.tree.TreeModel)1 NodeHeightTransform (dr.evomodel.treedatalikelihood.discrete.NodeHeightTransform)1