use of dr.inference.distribution.TwoPartsDistributionLikelihood in project beast-mcmc by beast-dev.
the class TwoPartsDistributionLikelihoodParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
DistributionLikelihood priorLikelihood = (DistributionLikelihood) xo.getElementFirstChild(PRIOR);
DistributionLikelihood pseudoPriorLikelihood = (DistributionLikelihood) xo.getElementFirstChild(PSEUDO_PRIOR);
Distribution prior = priorLikelihood.getDistribution();
Distribution pseudoPrior = pseudoPriorLikelihood.getDistribution();
Parameter bitVector = (Parameter) xo.getElementFirstChild(PARAMETER_VECTOR);
int paramIndex = xo.getIntegerAttribute(PARAMETER_INDEX);
Parameter selectedVariable = (Parameter) xo.getElementFirstChild(SELECTED_VARIABLE);
TwoPartsDistributionLikelihood likelihood = new TwoPartsDistributionLikelihood(prior, pseudoPrior, bitVector, paramIndex);
likelihood.addData(selectedVariable);
return likelihood;
}
Aggregations