columna API reference - v0.5.0
    Preparing search index...

    Interface Distribution

    Probability distributions for statistical tests: normal, Student t, chi-square, F.

    Each factory returns a frozen distribution with pdf, cdf, sf (= 1 − cdf, accurate in the upper tail), ppf (inverse cdf) and isf (inverse sf), plus mean / variance. Everything is built on three special functions — lgamma (Lanczos), the regularized incomplete gamma (series + Lentz continued fraction) and the regularized incomplete beta (Lentz) — so the cdf values agree with scipy to ~1e-14 relative in the body and ~1e-12 deep in the tails. Inverses use Acklam's rational approximation refined by Halley steps (normal) or bracketed bisection followed by Newton polish (t, chi², F).

    dist.normal().cdf(1.96) // 0.9750021… dist.t(10).ppf(0.975) // 2.2281388… dist.chi2(5).sf(11.07) // p-value 0.0500096… dist.f(3, 10).cdf(3.708) // 0.9499912…

    interface Distribution {
        mean: number;
        name: string;
        variance: number;
        cdf(x: number): number;
        isf(p: number): number;
        map(
            fn: "pdf" | "cdf" | "sf" | "ppf" | "isf",
            xs: ArrayLike<number>,
        ): Float64Array;
        pdf(x: number): number;
        ppf(p: number): number;
        sf(x: number): number;
    }
    Index
    mean: number
    name: string
    variance: number
    • P(X ≤ x).

      Parameters

      • x: number

      Returns number

    • Inverse survival: x with P(X > x) = p.

      Parameters

      • p: number

      Returns number

    • Apply one of the functions to every element of a typed / plain array.

      Parameters

      • fn: "pdf" | "cdf" | "sf" | "ppf" | "isf"
      • xs: ArrayLike<number>

      Returns Float64Array

    • Probability density at x.

      Parameters

      • x: number

      Returns number

    • Inverse cdf: smallest x with P(X ≤ x) ≥ p.

      Parameters

      • p: number

      Returns number

    • P(X > x) — use for p-values; accurate where 1 − cdf would cancel.

      Parameters

      • x: number

      Returns number