Search in sources :

Example 1 with LogarithmStatistic

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

the class LogarithmStatisticParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    LogarithmStatistic logStatistic;
    // base 0.0 means natural logarithm, the default base
    double base = xo.getAttribute(BASE, 0.0);
    if (base <= 1.0 && base != 0.0) {
        throw new XMLParseException("Error parsing " + getParserName() + " element: base attribute should be > 1");
    }
    Object child = xo.getChild(0);
    if (child instanceof Statistic) {
        logStatistic = new LogarithmStatistic(LOGARITHM_STATISTIC, (Statistic) child, base);
    } else {
        throw new XMLParseException("Unknown element found in " + getParserName() + " element:" + child);
    }
    return logStatistic;
}
Also used : LogarithmStatistic(dr.inference.model.LogarithmStatistic) Statistic(dr.inference.model.Statistic) LogarithmStatistic(dr.inference.model.LogarithmStatistic)

Aggregations

LogarithmStatistic (dr.inference.model.LogarithmStatistic)1 Statistic (dr.inference.model.Statistic)1