use of dr.inference.operators.shrinkage.BayesianBridgeShrinkageOperator in project beast-mcmc by beast-dev.
the class BayesianBridgeShrinkageOperatorParser method parseXMLObject.
@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
double weight = xo.getDoubleAttribute(WEIGHT);
BayesianBridgeStatisticsProvider bayesianBridge = (BayesianBridgeStatisticsProvider) xo.getChild(BayesianBridgeStatisticsProvider.class);
if (bayesianBridge == null) {
bayesianBridge = parseAutoCorrelatedRates(xo);
}
DistributionLikelihood prior = (DistributionLikelihood) xo.getChild(DistributionLikelihood.class);
if (!(prior.getDistribution() instanceof GammaDistribution)) {
throw new XMLParseException("Gibbs sampler only implemented for a gamma distributed global scale");
}
GammaDistribution globalScalePrior = (GammaDistribution) prior.getDistribution();
return new BayesianBridgeShrinkageOperator(bayesianBridge, globalScalePrior, weight);
}
Aggregations