Skip to content

InverseCDF ​

The quantile function: the xx such that CDF(dist,x)=qCDF(dist, x) = q.

InverseCDF(dist, q)numeric only — bisection against CDF, bracketed from Mean/Variance and widened geometrically otherwise. No exact closed forms are attempted (a documented divergence from Wolfram, which answers several of these symbolically); a non-numeric qq stays unevaluated.
Typed signatures
TypePackageApplies
(distribution, real) -> realstatisticsalways

Domain: Statistics

Details
  • Generic over every distribution this package's CDF can evaluate numerically, old or new — including compute-engine's own natives.
  • Median(dist) is the exact quantile at 1/21/2 where one exists: a closed form for the common continuous laws, and for a discrete law with rational parameters the least kk whose CDF reaches 1/21/2, decided in exact arithmetic. Other laws stay unevaluated; InverseCDF(dist, 1/2) gives the numeric value.

Plot

argument dist of type distribution has no control

Examples

Basic #

The median of a standard normal is 0 — bisection lands within double precision of it (deterministic, since the bisection is unseeded and non-random).

live ↗
InInverseCDF(NormalDistribution⁡(0,1),12)\mathrm{InverseCDF}(\operatorname{NormalDistribution}(0, 1), \frac{1}{2})Out−6.957 290 979 756 837⋅10−17-6.957\,290\,979\,756\,837\cdot10^{-17}

Unlike the numeric InverseCDF, a discrete median is exact: the least kk whose CDF reaches 1/21/2, decided in exact arithmetic

live ↗
Inmedian(PoissonDistribution⁡(12))\mathrm{median}(\operatorname{PoissonDistribution}(12))Out1212
Scope #
live ↗
Inmedian(BinomialDistribution⁡(25,17))\mathrm{median}(\operatorname{BinomialDistribution}(25, \frac{1}{7}))Out33
About
Examples3
Checked againstWolfram Language 2 agree

See also: CDF, SurvivalFunction, Median