Search in sources :

Example 1 with TruncatedDistributionLikelihood

use of dr.inference.model.TruncatedDistributionLikelihood in project beast-mcmc by beast-dev.

the class TruncatedDistributionLikelihoodParser method parseXMLObject.

@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    DistributionLikelihood likelihood = (DistributionLikelihood) xo.getChild(DistributionLikelihood.class);
    Parameter low;
    Parameter high;
    if (xo.getChild(LOW) != null) {
        low = (Parameter) xo.getChild(LOW).getChild(Parameter.class);
    } else {
        low = new Parameter.Default("low", Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
    }
    if (xo.getChild(HIGH) != null) {
        high = (Parameter) xo.getChild(HIGH).getChild(Parameter.class);
    } else {
        high = new Parameter.Default("high", Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
    }
    return new TruncatedDistributionLikelihood(likelihood, low, high);
}
Also used : TruncatedDistributionLikelihood(dr.inference.model.TruncatedDistributionLikelihood) Parameter(dr.inference.model.Parameter) TruncatedDistributionLikelihood(dr.inference.model.TruncatedDistributionLikelihood) DistributionLikelihood(dr.inference.distribution.DistributionLikelihood)

Aggregations

DistributionLikelihood (dr.inference.distribution.DistributionLikelihood)1 Parameter (dr.inference.model.Parameter)1 TruncatedDistributionLikelihood (dr.inference.model.TruncatedDistributionLikelihood)1