Search in sources :

Example 6 with Statistic

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

the class CoulombPriorParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    XMLObject cxo = xo;
    final double beta = xo.getDoubleAttribute(BETA);
    if (xo.hasChildNamed(DATA)) {
        cxo = xo.getChild(DATA);
    }
    CoulombPrior likelihood = new CoulombPrior(beta);
    for (int i = 0; i < cxo.getChildCount(); i++) {
        if (cxo.getChild(i) instanceof Statistic) {
            likelihood.addData((Statistic) cxo.getChild(i));
        }
    }
    return likelihood;
}
Also used : CoulombPrior(dr.inference.model.CoulombPrior) Statistic(dr.inference.model.Statistic)

Example 7 with Statistic

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

the class NegativeStatisticParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    NegativeStatistic negativeStatistic = null;
    Object child = xo.getChild(0);
    if (child instanceof Statistic) {
        negativeStatistic = new NegativeStatistic(NEGATE_STATISTIC, (Statistic) child);
    } else {
        throw new XMLParseException("Unknown element found in " + getParserName() + " element:" + child);
    }
    return negativeStatistic;
}
Also used : NegativeStatistic(dr.inference.model.NegativeStatistic) Statistic(dr.inference.model.Statistic) NegativeStatistic(dr.inference.model.NegativeStatistic)

Example 8 with Statistic

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

the class NotStatisticParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    NotStatistic notStatistic;
    Object child = xo.getChild(0);
    if (child instanceof Statistic) {
        notStatistic = new NotStatistic(NOT_STATISTIC, (Statistic) child);
    } else {
        throw new XMLParseException("Unknown element found in " + getParserName() + " element:" + child);
    }
    return notStatistic;
}
Also used : NotStatistic(dr.inference.model.NotStatistic) Statistic(dr.inference.model.Statistic) NotStatistic(dr.inference.model.NotStatistic)

Example 9 with Statistic

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

the class ThresholdStatisticParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    double threshold = xo.getAttribute(THRESHOLD, 0.0);
    String name = THRESHOLD_STATISTIC;
    if (xo.hasAttribute(Statistic.NAME)) {
        name = xo.getAttribute(Statistic.NAME, xo.getId());
    } else if (xo.hasAttribute(XMLParser.ID)) {
        name = xo.getAttribute(XMLParser.ID, xo.getId());
    }
    final Statistic statistic = (Statistic) xo.getChild(Statistic.class);
    final ThresholdStatistic thresholdStatistic = new ThresholdStatistic(name, statistic, threshold);
    return thresholdStatistic;
}
Also used : Statistic(dr.inference.model.Statistic) SumStatistic(dr.inference.model.SumStatistic) ThresholdStatistic(dr.inference.model.ThresholdStatistic) ThresholdStatistic(dr.inference.model.ThresholdStatistic)

Example 10 with Statistic

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

the class ReciprocalStatisticParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    ReciprocalStatistic recipStatistic = null;
    Object child = xo.getChild(0);
    if (child instanceof Statistic) {
        recipStatistic = new ReciprocalStatistic((xo.hasId() ? xo.getId() : "RECIPROCAL"), (Statistic) child);
    } else {
        throw new XMLParseException("Unknown element found in " + getParserName() + " element:" + child);
    }
    return recipStatistic;
}
Also used : Statistic(dr.inference.model.Statistic) ReciprocalStatistic(dr.inference.model.ReciprocalStatistic) ReciprocalStatistic(dr.inference.model.ReciprocalStatistic)

Aggregations

Statistic (dr.inference.model.Statistic)21 Taxa (dr.evolution.util.Taxa)2 DistributionLikelihood (dr.inference.distribution.DistributionLikelihood)2 ParametricDistributionModel (dr.inference.distribution.ParametricDistributionModel)2 SumStatistic (dr.inference.model.SumStatistic)2 Tree (dr.evolution.tree.Tree)1 Taxon (dr.evolution.util.Taxon)1 TaxonList (dr.evolution.util.TaxonList)1 CalibrationPoints (dr.evomodel.speciation.CalibrationPoints)1 SpeciationLikelihood (dr.evomodel.speciation.SpeciationLikelihood)1 SpeciationModel (dr.evomodel.speciation.SpeciationModel)1 DateParser (dr.evoxml.DateParser)1 TaxaParser (dr.evoxml.TaxaParser)1 TaxonParser (dr.evoxml.TaxonParser)1 EmpiricalDistributionLikelihood (dr.inference.distribution.EmpiricalDistributionLikelihood)1 MixedDistributionLikelihood (dr.inference.distribution.MixedDistributionLikelihood)1 SplineInterpolatedLikelihood (dr.inference.distribution.SplineInterpolatedLikelihood)1 Bounds (dr.inference.model.Bounds)1 CoulombPrior (dr.inference.model.CoulombPrior)1 DifferenceStatistic (dr.inference.model.DifferenceStatistic)1