use of dr.evomodel.coalescent.hmc.GMRFGradient 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);
}
Aggregations