public double chiSquareTest(double[] expected, long[] observed)
throws IllegalArgumentException, MathException {
ChiSquaredDistribution chiSquaredDistribution =
getDistributionFactory().createChiSquareDistribution(
(double) expected.length - 1);
return 1 - chiSquaredDistribution.cumulativeProbability(
chiSquare(expected, observed));
}
/**
* @param observed array of observed frequency counts