Search in sources :

Example 1 with MixedDistributionLikelihood

use of dr.inference.distribution.MixedDistributionLikelihood in project beast-mcmc by beast-dev.

the class MixedDistributionLikelihoodParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    XMLObject cxo0 = xo.getChild(DISTRIBUTION0);
    ParametricDistributionModel model0 = (ParametricDistributionModel) cxo0.getChild(ParametricDistributionModel.class);
    XMLObject cxo1 = xo.getChild(DISTRIBUTION1);
    ParametricDistributionModel model1 = (ParametricDistributionModel) cxo1.getChild(ParametricDistributionModel.class);
    Statistic data = (Statistic) ((XMLObject) xo.getChild(DATA)).getChild(Statistic.class);
    Statistic indicators = (Statistic) ((XMLObject) xo.getChild(INDICATORS)).getChild(Statistic.class);
    ParametricDistributionModel[] models = { model0, model1 };
    try {
        return new MixedDistributionLikelihood(models, data, indicators);
    } catch (Exception e) {
        throw new XMLParseException(e.getMessage());
    }
}
Also used : Statistic(dr.inference.model.Statistic) ParametricDistributionModel(dr.inference.distribution.ParametricDistributionModel) MixedDistributionLikelihood(dr.inference.distribution.MixedDistributionLikelihood)

Aggregations

MixedDistributionLikelihood (dr.inference.distribution.MixedDistributionLikelihood)1 ParametricDistributionModel (dr.inference.distribution.ParametricDistributionModel)1 Statistic (dr.inference.model.Statistic)1