// now compare against reference distributions to test accuracy of the observed step distributions
NormalDistribution normalDistribution = new NormalDistribution();
GammaDistribution gd1 = new GammaDistribution(0.2, 5);
GammaDistribution gd2 = new GammaDistribution(1, 1);
TDistribution tDistribution = new TDistribution(2);
for (double q : new double[]{0.001, 0.01, 0.1, 0.2, 0.5, 0.8, 0.9, 0.99, 0.99}) {
double uG1 = gd1.cumulativeProbability(tdG1.quantile(q));
assertEquals(q, uG1, (1 - q) * q * 10e-2);
double uG2 = gd2.cumulativeProbability(tdG2.quantile(q));
assertEquals(q, uG2, (1 - q) * q * 10e-2);
double u1 = normalDistribution.cumulativeProbability(td1.quantile(q));
assertEquals(q, u1, (1 - q) * q * 10e-2);
double u2 = normalDistribution.cumulativeProbability(td2.quantile(q) / 2);
assertEquals(q, u2, (1 - q) * q * 10e-2);
double u3 = tDistribution.cumulativeProbability(td3.quantile(q));
assertEquals(q, u3, (1 - q) * q * 10e-2);
}
}