Portability | portable |
---|---|
Stability | experimental |
Maintainer | bos@serpentine.com |
Safe Haskell | None |
Kolmogov-Smirnov tests are non-parametric tests for assesing whether given sample could be described by distribution or whether two samples have the same distribution. It's only applicable to continous distributions.
- kolmogorovSmirnovTest :: Distribution d => d -> Double -> Sample -> TestResult
- kolmogorovSmirnovTestCdf :: (Double -> Double) -> Double -> Sample -> TestResult
- kolmogorovSmirnovTest2 :: Double -> Sample -> Sample -> TestResult
- kolmogorovSmirnovCdfD :: (Double -> Double) -> Sample -> Double
- kolmogorovSmirnovD :: Distribution d => d -> Sample -> Double
- kolmogorovSmirnov2D :: Sample -> Sample -> Double
- kolmogorovSmirnovProbability :: Int -> Double -> Double
- data TestType
- data TestResult
Kolmogorov-Smirnov test
:: Distribution d | |
=> d | Distribution |
-> Double | p-value |
-> Sample | Data sample |
-> TestResult |
Check that sample could be described by
distribution. Significant
means distribution is not compatible
with data for given p-value.
This test uses Marsaglia-Tsang-Wang exact alogorithm for calculation of p-value.
kolmogorovSmirnovTestCdfSource
:: (Double -> Double) | CDF of distribution |
-> Double | p-value |
-> Sample | Data sample |
-> TestResult |
Variant of kolmogorovSmirnovTest
which uses CFD in form of
function.
:: Double | p-value |
-> Sample | Sample 1 |
-> Sample | Sample 2 |
-> TestResult |
Two sample Kolmogorov-Smirnov test. It tests whether two data samples could be described by the same distribution without making any assumptions about it.
This test uses approxmate formula for computing p-value.
Evaluate statistics
Calculate Kolmogorov's statistic D for given cumulative distribution function (CDF) and data sample. If sample is empty returns 0.
:: Distribution d | |
=> d | Distribution |
-> Sample | Sample |
-> Double |
Calculate Kolmogorov's statistic D for given cumulative distribution function (CDF) and data sample. If sample is empty returns 0.
Calculate Kolmogorov's statistic D for two data samples. If either of samples is empty returns 0.
Probablities
kolmogorovSmirnovProbabilitySource
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.
Data types
data TestResult Source
Result of hypothesis testing
Significant | Null hypothesis should be rejected |
NotSignificant | Data is compatible with hypothesis |
References
- G. Marsaglia, W. W. Tsang, J. Wang (2003) Evaluating Kolmogorov's distribution, Journal of Statistical Software, American Statistical Association, vol. 8(i18).