ZipfDistributionTest testInstance = new ZipfDistributionTest("");
int[] densityPoints = testInstance.makeDensityTestPoints();
double[] densityValues = testInstance.makeDensityTestValues();
int sampleSize = 1000;
int length = TestUtils.eliminateZeroMassPoints(densityPoints, densityValues);
ZipfDistributionImpl distribution = (ZipfDistributionImpl) testInstance.makeDistribution();
double[] expectedCounts = new double[length];
long[] observedCounts = new long[length];
for (int i = 0; i < length; i++) {
expectedCounts[i] = sampleSize * densityValues[i];
}
randomData.reSeed(1000);
for (int i = 0; i < sampleSize; i++) {
int value = randomData.nextZipf(distribution.getNumberOfElements(), distribution.getExponent());
for (int j = 0; j < length; j++) {
if (value == densityPoints[j]) {
observedCounts[j]++;
}
}