use of dr.evomodel.coalescent.GMRFPopSizeStatistic in project beast-mcmc by beast-dev.
the class GMRFPopSizeStatisticParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
double[] times;
if (xo.hasAttribute(FROM)) {
double from = xo.getDoubleAttribute(FROM);
double to = xo.getDoubleAttribute(TO);
int number = xo.getIntegerAttribute(NUMBER_OF_INTERVALS);
double length = (to - from) / number;
times = new double[number + 1];
for (int i = 0; i < times.length; i++) {
times[i] = from + i * length;
}
} else {
times = xo.getDoubleArrayAttribute(TIMES);
}
GMRFSkyrideLikelihood gsl = (GMRFSkyrideLikelihood) xo.getChild(GMRFSkyrideLikelihood.class);
return new GMRFPopSizeStatistic(times, gsl);
}
Aggregations