Search in sources :

Example 1 with TwoPartsDistributionLikelihood

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;
}
Also used : Distribution(dr.math.distributions.Distribution) Parameter(dr.inference.model.Parameter) TwoPartsDistributionLikelihood(dr.inference.distribution.TwoPartsDistributionLikelihood) TwoPartsDistributionLikelihood(dr.inference.distribution.TwoPartsDistributionLikelihood) DistributionLikelihood(dr.inference.distribution.DistributionLikelihood)

Aggregations

DistributionLikelihood (dr.inference.distribution.DistributionLikelihood)1 TwoPartsDistributionLikelihood (dr.inference.distribution.TwoPartsDistributionLikelihood)1 Parameter (dr.inference.model.Parameter)1 Distribution (dr.math.distributions.Distribution)1