use of dr.inference.distribution.shrinkage.BayesianBridgeDistributionModel in project beast-mcmc by beast-dev.
the class BayesianBridgeShrinkageOperatorParser method parseAutoCorrelatedRates.
private BayesianBridgeStatisticsProvider parseAutoCorrelatedRates(XMLObject xo) throws XMLParseException {
final AutoCorrelatedBranchRatesDistribution rates = (AutoCorrelatedBranchRatesDistribution) xo.getChild(AutoCorrelatedBranchRatesDistribution.class);
if (!(rates.getPrior() instanceof BayesianBridgeDistributionModel)) {
throw new XMLParseException("Gibbs sampler only implemented for a Bayesian Bridge prior");
}
final BayesianBridgeDistributionModel prior = (BayesianBridgeDistributionModel) rates.getPrior();
return new BayesianBridgeStatisticsProvider() {
@Override
public double getCoefficient(int i) {
return rates.getIncrement(i);
}
@Override
public Parameter getGlobalScale() {
return prior.getGlobalScale();
}
@Override
public Parameter getLocalScale() {
return prior.getLocalScale();
}
@Override
public Parameter getExponent() {
return prior.getExponent();
}
@Override
public int getDimension() {
return rates.getDimension();
}
};
}
Aggregations