Search in sources :

Example 1 with MultivariateOUModel

use of dr.inferencexml.distribution.MultivariateOUModel in project beast-mcmc by beast-dev.

the class MultivariateOUModelParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    SubstitutionModel substitutionModel = (SubstitutionModel) xo.getChild(SubstitutionModel.class);
    Parameter effectParameter = (Parameter) ((XMLObject) xo.getChild(DATA)).getChild(Parameter.class);
    Parameter timesParameter = (Parameter) ((XMLObject) xo.getChild(TIME)).getChild(Parameter.class);
    Parameter designParameter = (Parameter) ((XMLObject) xo.getChild(DESIGN)).getChild(Parameter.class);
    MatrixParameter gammaParameter = (MatrixParameter) xo.getChild(MatrixParameter.class);
    if (effectParameter.getDimension() != timesParameter.getDimension() || effectParameter.getDimension() != designParameter.getDimension()) {
        //				System.err.println("dim(design) "+designParameter.getDimension());
        throw new XMLParseException("dim(" + effectParameter.getStatisticName() + ") != dim(" + timesParameter.getStatisticName() + ") != dim(" + designParameter.getStatisticName() + ") in " + xo.getName() + " element");
    }
    MultivariateOUModel glm = new MultivariateOUModel(substitutionModel, effectParameter, gammaParameter, timesParameter.getParameterValues(), designParameter.getParameterValues());
    addIndependentParameters(xo, glm, effectParameter);
    return glm;
}
Also used : MatrixParameter(dr.inference.model.MatrixParameter) MultivariateOUModel(dr.inferencexml.distribution.MultivariateOUModel) Parameter(dr.inference.model.Parameter) MatrixParameter(dr.inference.model.MatrixParameter) SubstitutionModel(dr.oldevomodel.substmodel.SubstitutionModel)

Aggregations

MatrixParameter (dr.inference.model.MatrixParameter)1 Parameter (dr.inference.model.Parameter)1 MultivariateOUModel (dr.inferencexml.distribution.MultivariateOUModel)1 SubstitutionModel (dr.oldevomodel.substmodel.SubstitutionModel)1