Skip to content

kolmogorovSmirnovTest(sample, distribution, options?): KolmogorovSmirnovTestResult

Defined in: packages/hypothesis-test/src/kolmogorov-smirnov-test.ts:26

Compare a finite sample with a specified continuous distribution. The greater alternative uses the maximum of empirical CDF minus reference CDF. The less alternative reverses the subtraction. Two-sided uses the larger of the two distances.

The sample is copied before sorting. Samples with fewer than 100 observations and no repeated values use the exact null distribution. The asymptotic distribution is used for larger samples and for samples with repeated values.

Sorting uses O(n log n) time and O(n) space. The exact two-sided matrix has dimension O(n·statistic) and uses O(log n) matrix products. Other exact tails use O(n) terms.

ArrayLike<number>

ContinuousDistribution

KolmogorovSmirnovTestOptions

KolmogorovSmirnovTestResult

With EMPTY_SAMPLE, NON_FINITE_SAMPLE, or INVALID_OPTION.