Skip to content

twoSampleKolmogorovSmirnovTest(first, second, options?): TwoSampleKolmogorovSmirnovTestResult

Defined in: packages/hypothesis-test/src/two-sample-kolmogorov-smirnov-test.ts:23

Compare the empirical CDFs of two finite samples. The greater alternative takes the first sample’s CDF minus the second’s. The less alternative reverses the subtraction. Two-sided uses the larger of the two distances.

Both samples are copied before sorting. The exact null distribution is used when the product of the sample sizes is below 10,000 and the pooled sample has no repeated values. The asymptotic distribution is used in other cases.

Sorting and merging take O(m log m + n log n) time and O(m + n) space. The exact null distribution adds O(mn) work.

ArrayLike<number>

ArrayLike<number>

TwoSampleKolmogorovSmirnovTestOptions

TwoSampleKolmogorovSmirnovTestResult

With EMPTY_SAMPLE, NON_FINITE_SAMPLE, or INVALID_OPTION.