assertEquals(dist.getCDF(limit - 1e-15), 1, EPS);
}
@Test
public void testDistribution() {
final Function1D<double[], Double> meanCalculator = new MeanCalculator();
final Function1D<double[], Double> medianCalculator = new MedianCalculator();
final Function1D<double[], Double> varianceCalculator = new PopulationVarianceCalculator();
final int n = 1000000;
final double eps = 0.1;
final double[] data = new double[n];
for (int i = 0; i < n; i++) {
data[i] = DIST.nextRandom();
}
final double mean = MU + SIGMA / (1 - KSI);
final double median = MU + SIGMA * (Math.pow(2, KSI) - 1) / KSI;
final double variance = SIGMA * SIGMA / ((1 - KSI) * (1 - KSI) * (1 - 2 * KSI));
assertEquals(meanCalculator.evaluate(data), mean, eps);
assertEquals(medianCalculator.evaluate(data), median, eps);
assertEquals(varianceCalculator.evaluate(data), variance, eps);
}