use of dr.inference.model.FastMatrixParameter in project beast-mcmc by beast-dev.
the class AncestralTraitTreeModelParser method parseNodeTraits.
private static void parseNodeTraits(XMLObject cxo, Tree tree, List<AncestralTaxonInTree> ancestors) throws XMLParseException {
String name = cxo.getAttribute(NAME, "trait");
int dim = cxo.getAttribute(MULTIVARIATE_TRAIT, 1);
// double[] initialValues = null;
// if (cxo.hasAttribute(INITIAL_VALUE)) {
// initialValues = cxo.getDoubleArrayAttribute(INITIAL_VALUE);
// }
final int rowDim = dim;
final int colDim = tree.getExternalNodeCount() + ancestors.size();
FastMatrixParameter parameter = new FastMatrixParameter(name, rowDim, colDim, 0.0);
parameter.addBounds(new Parameter.DefaultBounds(Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, rowDim * colDim));
int parameterIndex = 0;
for (int i = 0; i < tree.getExternalNodeCount(); i++) {
// if (leafNodes) {
// nodes[i].addTraitParameter(name, parameter.getParameter(parameterIndex), initialValues, firesTreeEvents);
++parameterIndex;
// }
}
for (AncestralTaxonInTree ancestor : ancestors) {
++parameterIndex;
}
ParameterParser.replaceParameter(cxo, parameter);
}
Aggregations