Function multinomialTest

The exact multinomial goodness of fit test for whether a set of counts fits a hypothetical distribution. counts is an input range of counts. proportions is an input range of expected proportions. These are normalized automatically, so they can sum to any value.

double multinomialTest(U, F) (
  U countsIn,
  F proportions
)
if (isInputRange!U && isInputRange!F && isIntegral!(ElementType!U) && isFloatingPoint!(ElementType!F));

Returns

The P-value for the null that counts is a sample from proportions against the alternative that it isn't.

Notes

This test is EXTREMELY slow for anything but very small samples and degrees of freedom. The Pearson's chi-square (chiSquareFit()) or likelihood ratio chi-square (gTestFit()) are good enough approximations unless sample size is very small.