/** * Returns the average of an array of numbers * @param arr * @category Array * @example * ```ts * average([1, 2, 3, 4]) // 2.5 * ``` */ export declare function average(arr: number[]): number; /** * Returns the average of an array of numbers * @param arr * @category Array * @example * ```ts * avg([1, 2, 3, 4]) // 2.5 * ``` */ export declare function avg(arr: number[]): number; /** * Returns the median of an array of numbers * @param arr * @category Array * @example * ```ts * median([1, 2, 3, 4]) // 2.5 * ``` */ export declare function median(arr: number[]): number; /** * Returns the mode of an array of numbers * @param arr * @category Array * @example * ```ts * mode([1, 2, 3, 4]) // 1 * mode([1, 2, 2, 3, 4]) // 2 * mode([1, 2, 2, 3, 3, 4]) // 2 * mode([1, 2, 2, 3, 3, 4, 4]) // 2 * mode([1, 2, 2, 3, 3, 4, 4, 4]) // 4 * ``` */ export declare function mode(arr: number[]): number; /** * Returns the sum of an array of numbers * @param array * @category Array * @example * ```ts * sum([1, 2, 3, 4]) // 10 * ``` */ export declare function sum(array: readonly number[]): number; /** * Returns the product of an array of numbers. * * Throws when an intermediate product exceeds `Number.MAX_SAFE_INTEGER` — * silently returning a precision-lossy float made downstream comparisons * (e.g. inventory totals, distance calcs) lie without any signal that * the result was unreliable. * * @param array * @category Array * @example * ```ts * product([1, 2, 3, 4]) // 24 * ``` */ export declare function product(array: readonly number[]): number; /** * Returns the minimum value of an array of numbers * @param array * @category Array * @example * ```ts * min([1, 2, 3, 4]) // 1 * min([1, 2, 3, 4, -1]) // -1 * ``` */ export declare function min(array: readonly number[]): number; /** * Returns the maximum value of an array of numbers * @param array * @category Array * @example * ```ts * max([1, 2, 3, 4]) // 4 * max([1, 2, 3, 4, -1]) // 4 * ``` */ export declare function max(array: readonly number[]): number; /** * Returns the range of an array of numbers * @param array * @category Array * @example * ```ts * range([1, 2, 3, 4]) // 3 * range([1, 2, 3, 4, -1]) // 5 * range([1, 2, 3, 4, -1, 10]) // 11 * ``` */ export declare function range(array: readonly number[]): number; /** * Returns the variance of an array of numbers * @param array * @category Array * @example * ```ts * variance([1, 2, 3, 4]) // 1.25 * ``` * @see https://en.wikipedia.org/wiki/Variance */ export declare function variance(array: number[]): number; /** * Returns the standard deviation of an array of numbers * @param array * @category Array * @example * ```ts * standardDeviation([1, 2, 3, 4]) // 1.118033988749895 * ``` * @see https://en.wikipedia.org/wiki/Standard_deviation * @see https://stackoverflow.com/questions/7343890/standard-deviation-javascript */ export declare function standardDeviation(array: number[]): number; /** * Returns the z-score of a number in an array of numbers * @param array * @param num * @category Array * @example * ```ts * zScore([1, 2, 3, 4], 2) // 0 * zScore([1, 2, 3, 4], 3) // 0.7071067811865475 * ``` * @see https://en.wikipedia.org/wiki/Standard_score */ export declare function zScore(array: number[], num: number): number; /** * Returns the percentile of a number in an array of numbers * @param array * @param num * @category Array * @example * ```ts * percentile([1, 2, 3, 4], 2) // 0.25 * percentile([1, 2, 3, 4], 3) // 0.75 * ``` * @see https://en.wikipedia.org/wiki/Percentile */ export declare function percentile(array: number[], num: number): number; /** * Returns the interquartile range of an array of numbers * @param array * @category Array * @example * ```ts * interquartileRange([1, 2, 3, 4]) // 1.5 * ``` * @see https://en.wikipedia.org/wiki/Interquartile_range * @see https://stackoverflow.com/questions/48719873/how-to-calculate-interquartile-range-in-javascript */ export declare function interquartileRange(array: number[]): number; /** * Returns the covariance of two arrays of numbers * @param array1 * @param array2 * @category Array * @example * ```ts * covariance([1, 2, 3, 4], [1, 2, 3, 4]) // 1.25 * covariance([1, 2, 3, 4], [4, 3, 2, 1]) // -1.25 * ``` */ export declare function covariance(array1: number[], array2: number[]): number;