haskell / statistics

A fast, high quality library for computing with statistics in Haskell.
http://hackage.haskell.org/package/statistics
BSD 2-Clause "Simplified" License
300 stars 67 forks source link

Chi Square test should use n and not ndf in testDistribution #167

Closed kenta2 closed 2 years ago

kenta2 commented 4 years ago

In Statistics.Test.ChiSquared.chi2test, the testDistribution return value is "chiSquared ndf". I think it should be "chiSquared n", or equivalently just "d" (because "d" has already be defined). It is reasonable to call chi2test with ndf==0 (e.g., testing uniformity), but that results in the error Statistics.Distribution.ChiSquared.chiSquared: N.D.F. must be positive. Got 0

Same issue also seen in chi2testCont.