Search in sources :

Example 1 with BranchSubstitutionParameterGradient

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);
}
Also used : CompoundParameter(dr.inference.model.CompoundParameter) TreeDataLikelihood(dr.evomodel.treedatalikelihood.TreeDataLikelihood) BranchRateModel(dr.evomodel.branchratemodel.BranchRateModel) BranchSpecificSubstitutionParameterBranchModel(dr.evomodel.branchmodel.BranchSpecificSubstitutionParameterBranchModel) BeagleDataLikelihoodDelegate(dr.evomodel.treedatalikelihood.BeagleDataLikelihoodDelegate) BranchSubstitutionParameterGradient(dr.evomodel.treedatalikelihood.discrete.BranchSubstitutionParameterGradient) BranchSpecificSubstitutionParameterBranchModel(dr.evomodel.branchmodel.BranchSpecificSubstitutionParameterBranchModel) BranchModel(dr.evomodel.branchmodel.BranchModel)

Aggregations

BranchModel (dr.evomodel.branchmodel.BranchModel)1 BranchSpecificSubstitutionParameterBranchModel (dr.evomodel.branchmodel.BranchSpecificSubstitutionParameterBranchModel)1 BranchRateModel (dr.evomodel.branchratemodel.BranchRateModel)1 BeagleDataLikelihoodDelegate (dr.evomodel.treedatalikelihood.BeagleDataLikelihoodDelegate)1 TreeDataLikelihood (dr.evomodel.treedatalikelihood.TreeDataLikelihood)1 BranchSubstitutionParameterGradient (dr.evomodel.treedatalikelihood.discrete.BranchSubstitutionParameterGradient)1 CompoundParameter (dr.inference.model.CompoundParameter)1