use of dr.evomodel.coalescent.operators.GMRFSkyrideFixedEffectsGibbsOperator in project beast-mcmc by beast-dev.
the class GMRFSkyrideFixedEffectsGibbsOperatorParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
GMRFSkyrideLikelihood gmrfLikelihood = (GMRFSkyrideLikelihood) xo.getChild(GMRFSkyrideLikelihood.class);
MultivariateDistributionLikelihood likelihood = (MultivariateDistributionLikelihood) xo.getChild(MultivariateDistributionLikelihood.class);
MultivariateDistribution prior = likelihood.getDistribution();
if (prior.getType().compareTo(MultivariateNormalDistribution.TYPE) != 0)
throw new XMLParseException("Only a multivariate normal distribution is conjugate for the regression coefficients in a GMRF");
Parameter param = (Parameter) xo.getChild(Parameter.class);
return new GMRFSkyrideFixedEffectsGibbsOperator(param, gmrfLikelihood, prior, weight);
}
Aggregations