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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations