/** * Calculates the [Cramér-von Mises statistic]{@link https://en.wikipedia.org/wiki/Cram%C3%A9r%E2%80%93von_Mises_criterion} * for an array of values against a cumulative distribution function, testing the null hypothesis * that the sample is drawn from the distribution the CDF represents. The asymptotic p-value uses * the Csörgő & Faraway (1996) convergent series for the limiting distribution's CDF. * * @method cramerVonMises * @memberof ran.test * @param {number[]} values Array of values to perform the test for. * @param {Function} cdf Cumulative distribution function to test against. * @param {number} [alpha = 0.05] Confidence level. * @returns {{stat: number, passed: boolean, pValue: number}} Object containing the test statistic * (T = n omega^2), whether the sample passed the null hypothesis that it is drawn from the tested * distribution, and the asymptotic goodness-of-fit p-value. * @throws {Error} If values is empty. * @example * * let normal = new ran.dist.Normal(0, 1) * * ran.test.cramerVonMises(normal.sample(100), x => normal.cdf(x)) * // => { stat: 0.043, passed: true, pValue: 0.802 } */ export default function (values: number[], cdf: Function, alpha?: number): { stat: number; passed: boolean; pValue: number; };