DimensionMismatchException, MaxCountExceededException {
// pass a null rng to avoid unneeded overhead as we will not sample from this distribution
final ChiSquaredDistribution distribution =
new ChiSquaredDistribution(null, expected.length - 1.0);
return 1.0 - distribution.cumulativeProbability(g(expected, observed));
}
/**
* Returns the intrinsic (Hardy-Weinberg proportions) p-Value, as described
* in p64-69 of McDonald, J.H. 2009. Handbook of Biological Statistics