HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulestatistics-0.16.3.0Haskell2010

Statistics.Test.KolmogorovSmirnov

Kolmogov-Smirnov tests are non-parametric tests for assessing whether given sample could be described by distribution or whether two samples have the same distribution. It's only applicable to continuous distributions.

  • 7 values
  • Packagestatistics-0.16.3.0
  • Exports7
  • LanguageHaskell2010
  • LicenceBSD-2-Clause
  • SourceKolmogorovSmirnov.hs

Kolmogorov-Smirnov test

3 declarations
valuekolmogorovSmirnovTest2
  1. :: Vector v Double
  2. => v Double

    Sample 1

  3. -> v Double

    Sample 2

  4. -> Maybe (Test ())
#

Two sample Kolmogorov-Smirnov test. It tests whether two data samples could be described by the same distribution without making any assumptions about it. If either of samples is empty returns Nothing.

This test uses approximate formula for computing p-value.

Evaluate statistics

3 declarations

Probabilities

1 declaration
valuekolmogorovSmirnovProbability
  1. :: Int

    Size of the sample

  2. -> Double

    D value

  3. -> Double
#

Calculate cumulative probability function for Kolmogorov's distribution with n parameters or probability of getting value smaller than d with n-elements sample.

It uses algorithm by Marsgalia et. al. and provide at least 7-digit accuracy.

References

0 declarations
  • G. Marsaglia, W. W. Tsang, J. Wang (2003) Evaluating Kolmogorov's distribution, Journal of Statistical Software, American Statistical Association, vol. 8(i18).