/** * Calculates the [two-sample Kolmogorov-Smirnov test]{@link https://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test#Two-sample_Kolmogorov%E2%80%93Smirnov_test} * statistic D = sup|F1(x) - F2(x)| over the pooled empirical CDFs of two samples, along with an asymptotic * p-value computed from the Kolmogorov distribution. * * @method kolmogorovSmirnov * @memberof ran.test * @param {number[]} x First sample. * @param {number[]} y Second sample. * @param {number} [alpha = 0.05] Confidence level. * @returns {{stat: number, passed: boolean, pValue: number}} Object containing the test statistic (D), the * asymptotic p-value, and whether the data sets passed the null hypothesis that they are drawn from the same * distribution. * @throws {Error} If either sample is empty. * @example * * let normal1 = new ran.dist.Normal(0, 1) * let normal2 = new ran.dist.Normal(5, 1) * * ran.test.kolmogorovSmirnov(normal1.sample(100), normal1.sample(100)) * // => { stat: 0.09, passed: true, pValue: 0.34 } * * ran.test.kolmogorovSmirnov(normal1.sample(100), normal2.sample(100)) * // => { stat: 0.98, passed: false, pValue: 0 } */ export default function (x: number[], y: number[], alpha?: number): { stat: number; passed: boolean; pValue: number; };