import type { array, matrix } from "../types"; /** * Interquartile range. * * Calculates the interquartile range (difference between 75th and 25th percentiles) * of arrays or matrices. For matrices, operates along specified dimension. * * @param x Input array or matrix * @param dim Dimension along which to compute IQR. Default is 0 * @returns Interquartile range values * @throws When input is invalid * * @example IQR of simple array * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(iqr([1, 2, 3, 4, 5]), 2.5); * * ``` * * @example IQR with larger range * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(iqr([1, 2, 3, 4, 5, 6, 7, 8, 9]), 4.5); * * ``` * * @example IQR of matrix * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(iqr([[1, 2, 3], [4, 5, 6]]), [1.5, 1.5]); * ``` */ export default function iqr(x: array, dim?: 0 | 1): number; /** * Interquartile range. * * Calculates the interquartile range (difference between 75th and 25th percentiles) * of arrays or matrices. For matrices, operates along specified dimension. * * @param x Input array or matrix * @param dim Dimension along which to compute IQR. Default is 0 * @returns Interquartile range values * @throws When input is invalid * * @example IQR of simple array * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(iqr([1, 2, 3, 4, 5]), 2.5); * * ``` * * @example IQR with larger range * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(iqr([1, 2, 3, 4, 5, 6, 7, 8, 9]), 4.5); * * ``` * * @example IQR of matrix * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(iqr([[1, 2, 3], [4, 5, 6]]), [1.5, 1.5]); * ``` */ export default function iqr(x: matrix, dim?: 0 | 1): array; //# sourceMappingURL=iqr.d.ts.map