/** * Statistical Functions * * Native RuntimeValue implementations. */ import type { RuntimeValue } from "../runtime/values.js"; type NativeFn = (args: RuntimeValue[]) => RuntimeValue; export declare const fnMEDIAN: NativeFn; export declare const fnLARGE: NativeFn; export declare const fnSMALL: NativeFn; export declare const fnRANK: NativeFn; export declare const fnSTDEV: NativeFn; export declare const fnSTDEVP: NativeFn; export declare const fnVAR: NativeFn; export declare const fnVARP: NativeFn; export declare const fnNORMSDIST: NativeFn; export declare const fnNORMDIST: NativeFn; export declare const fnNORMSINV: NativeFn; export declare const fnNORMINV: NativeFn; export declare const fnPERCENTILE: NativeFn; export declare const fnPERCENTILEEXC: NativeFn; export declare const fnQUARTILE: NativeFn; export declare const fnQUARTILEEXC: NativeFn; export declare const fnMODE: NativeFn; /** * MODE.MULT — returns a vertical array of every mode (dynamic array). * When the dataset is multimodal Excel spills all of them; for a single * mode it behaves like MODE.SNGL. */ export declare const fnMODE_MULT: NativeFn; export declare const fnCORREL: NativeFn; export declare const fnSLOPE: NativeFn; export declare const fnINTERCEPT: NativeFn; export declare const fnRSQ: NativeFn; /** * STEYX(known_y, known_x) — standard error of the predicted y-value for * each x in a regression. Matches Excel's definition: * SE = sqrt((1/(n-2)) × (S_yy − S_xy² / S_xx)) * where S_xx, S_yy, S_xy are centred sums of squares / cross-product. */ export declare const fnSTEYX: NativeFn; export declare const fnFORECAST: NativeFn; export { fnFACT, fnFACTDOUBLE, fnCOMBIN, fnCOMBINA, fnPERMUT } from "./math.js"; export declare const fnGEOMEAN: NativeFn; export declare const fnHARMEAN: NativeFn; export declare const fnTRIMMEAN: NativeFn; export declare const fnDEVSQ: NativeFn; export declare const fnAVEDEV: NativeFn; export declare const fnCONFIDENCENORM: NativeFn; /** * CONFIDENCE.T — confidence interval half-width for the mean using the * Student's t distribution (small sample / unknown population variance). */ export declare const fnCONFIDENCE_T: NativeFn; /** COVARIANCE.P — population covariance. */ export declare const fnCOVARIANCE_P: NativeFn; /** COVARIANCE.S — sample covariance (divide by n-1). */ export declare const fnCOVARIANCE_S: NativeFn; /** * RANK.AVG — average-tie rank. Identical to RANK.EQ except that tied * positions return the average of the ranks they would otherwise span. */ export declare const fnRANK_AVG: NativeFn; export declare const fnFISHER: NativeFn; export declare const fnFISHERINV: NativeFn; export declare const fnAVERAGEA: NativeFn; export declare const fnMAXA: NativeFn; export declare const fnMINA: NativeFn; export declare const fnPOISSON_DIST: NativeFn; export declare const fnBINOM_DIST: NativeFn; /** * BINOM.DIST.RANGE(trials, probability, number_s, [number_s2]) — * probability of a binomial trial outcome between `number_s` and * `number_s2` (inclusive). When `number_s2` is omitted, returns the * probability of exactly `number_s` successes. */ export declare const fnBINOM_DIST_RANGE: NativeFn; export declare const fnBINOM_INV: NativeFn; export declare const fnHYPGEOM_DIST: NativeFn; export declare const fnNEGBINOM_DIST: NativeFn; export declare const fnCHISQ_DIST: NativeFn; export declare const fnCHISQ_INV: NativeFn; export declare const fnCHISQ_DIST_RT: NativeFn; /** * CHISQ.INV.RT(probability, df) — right-tailed inverse of chi-square. * Equivalent to CHISQ.INV(1 - probability, df). Probabilities of 0 or 1 * return +∞ or 0 respectively; values outside (0, 1] are #NUM!. */ export declare const fnCHISQ_INV_RT: NativeFn; export declare const fnF_DIST: NativeFn; export declare const fnF_INV: NativeFn; export declare const fnT_DIST: NativeFn; export declare const fnT_INV: NativeFn; export declare const fnT_DIST_2T: NativeFn; export declare const fnT_DIST_RT: NativeFn; export declare const fnT_INV_2T: NativeFn; export declare const fnBETA_DIST: NativeFn; export declare const fnBETA_INV: NativeFn; export declare const fnGAMMA: NativeFn; export declare const fnGAMMALN: NativeFn; export declare const fnGAMMA_DIST: NativeFn; export declare const fnGAMMA_INV: NativeFn; export declare const fnEXPON_DIST: NativeFn; export declare const fnWEIBULL_DIST: NativeFn; export declare const fnLOGNORM_DIST: NativeFn; export declare const fnLOGNORM_INV: NativeFn; export declare const fnPHI: NativeFn; export declare const fnGAUSS: NativeFn; export declare const fnERF: NativeFn; export declare const fnERFC: NativeFn; export declare const fnSTANDARDIZE: NativeFn; export declare const fnFREQUENCY: NativeFn; export declare const fnGROWTH: NativeFn; export declare const fnTREND: NativeFn; export declare const fnLINEST: NativeFn; export declare const fnLOGEST: NativeFn; /** * F.DIST.RT(x, d1, d2) — right-tail probability of the F-distribution. * * Equivalent to `1 - F.DIST(x, d1, d2, TRUE)`. Using the symmetry of the * regularized incomplete beta function, this can be expressed as * `I(d2/(d2 + d1*x), d2/2, d1/2)`, which avoids subtracting from 1 and * is numerically stable in the upper tail. */ export declare const fnF_DIST_RT: NativeFn; /** * F.INV.RT(p, d1, d2) — inverse right-tail of the F-distribution. * Returns x such that P(F > x) = p. Implemented via binary search on the * right-tail CDF (monotonically decreasing from 1 at x=0 to 0 at x=∞). */ export declare const fnF_INV_RT: NativeFn; /** * SKEW — sample skewness. * Formula: n / ((n-1)(n-2)) * Σ((xi-mean)/s)^3, where s is the sample stdev. */ export declare const fnSKEW: NativeFn; /** * SKEW.P — population skewness. * Formula: (1/n) * Σ((xi-mean)/σ)^3, where σ is the population stdev. */ export declare const fnSKEW_P: NativeFn; /** * KURT — sample excess kurtosis. * Formula: n(n+1) / ((n-1)(n-2)(n-3)) * Σ((xi-mean)/s)^4 - 3(n-1)^2 / ((n-2)(n-3)). */ export declare const fnKURT: NativeFn; export declare const fnPERCENTRANK: NativeFn; export declare const fnPERCENTRANK_INC: NativeFn; export declare const fnPERCENTRANK_EXC: NativeFn; /** * PROB(x_range, prob_range, lower_limit, [upper_limit]) — probability that * values in x_range are between lower_limit and upper_limit inclusive. * * Excel rules: * - x_range and prob_range must have the same dimensions * - prob_range entries must sum to 1 (±ε); otherwise #NUM! * - Any prob entry ≤ 0 or > 1 → #NUM! * - upper_limit omitted → probability that x = lower_limit * - Result is the sum of prob_range entries for which * lower_limit ≤ x_range value ≤ upper_limit */ export declare const fnPROB: NativeFn; /** * Z.TEST(array, x, [sigma]) — one-tailed probability value for z-test. * mean = AVERAGE(array), n = COUNT(array) * sigma = provided OR sample standard deviation of array * z = (mean - x) / (sigma / √n) * Z.TEST = 1 - NORM.S.DIST(z, TRUE) */ export declare const fnZ_TEST: NativeFn; /** * F.TEST(array1, array2) — two-tailed F-test probability comparing * the variances of two samples. * * F = var(larger) / var(smaller) (always >= 1) * P = 2 × P(F_dist(df1, df2) > F) */ export declare const fnF_TEST: NativeFn; /** * T.TEST(array1, array2, tails, type) — tails in {1, 2}, type in {1, 2, 3}. * type 1: paired * type 2: two-sample, equal variance * type 3: two-sample, unequal variance (Welch's) */ export declare const fnT_TEST: NativeFn; /** * CHISQ.TEST(actual_range, expected_range) — chi-square independence test. * * χ² = Σ (actual_i - expected_i)² / expected_i * df = (rows-1)(cols-1) for a contingency table, or n-1 for 1-D * p = 1 - CHISQ.DIST(χ², df, TRUE) */ export declare const fnCHISQ_TEST: NativeFn;