use of dr.math.distributions.InverseGaussianDistribution in project beast-mcmc by beast-dev.
the class InverseGaussianDistributionTest method testCDFAndQuantile2.
public void testCDFAndQuantile2() {
final InverseGaussianDistribution f = new InverseGaussianDistribution(1, 1);
for (double i = 0.01; i < 0.95; i += 0.01) {
final double y = i;
BisectionZeroFinder zeroFinder = new BisectionZeroFinder(new OneVariableFunction() {
public double value(double x) {
return f.cdf(x) - y;
}
}, 0.01, 100);
zeroFinder.setMaximumIterations(100);
zeroFinder.evaluate();
assertEquals(f.quantile(i), zeroFinder.getResult(), 1e-3);
}
}
Aggregations