use of dr.evomodel.treedatalikelihood.discrete.BranchSubstitutionParameterGradient in project beast-mcmc by beast-dev.
the class BranchSubstitutionParameterGradientParser method parseXMLObject.
@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
String traitName = xo.getAttribute(TRAIT_NAME, DEFAULT_TRAIT_NAME);
boolean useHessian = xo.getAttribute(USE_HESSIAN, false);
final TreeDataLikelihood treeDataLikelihood = (TreeDataLikelihood) xo.getChild(TreeDataLikelihood.class);
BranchSpecificSubstitutionParameterBranchModel branchModel = (BranchSpecificSubstitutionParameterBranchModel) xo.getChild(BranchModel.class);
BeagleDataLikelihoodDelegate beagleData = (BeagleDataLikelihoodDelegate) treeDataLikelihood.getDataLikelihoodDelegate();
BranchRateModel branchRateModel = (BranchRateModel) xo.getChild(BranchRateModel.class);
CompoundParameter branchParameter = branchModel.getBranchSpecificParameters(branchRateModel);
return new BranchSubstitutionParameterGradient(traitName, treeDataLikelihood, beagleData, branchParameter, branchRateModel, useHessian);
}
Aggregations