The quantile function of a real law #
The quantile function, or generalized inverse cumulative distribution function, of a measure
μ on ℝ sends a level t to the least point at which ProbabilityTheory.cdf μ reaches t:
μ.quantile t = sInf {x | t ≤ cdf μ x}.
Because cdf μ is monotone and right continuous with limits 0 at -∞ and 1 at +∞, that
infimum is attained for every level t strictly between 0 and 1, and the defining set is
exactly the closed ray to the right of the quantile. The quantile is therefore characterized by
the Galois property μ.quantile t ≤ x ↔ t ≤ cdf μ x. At levels t ≤ 0 and 1 < t the infimum
ranges over all of ℝ or over the empty set, so the value there is the junk value 0. The
endpoint level t = 1 is not junk: the quantile there is the least point of full cumulative mass
when such a point exists (for instance (dirac a).quantile 1 = a), and 0 when the law has
unbounded support to the right. The inverse characterizations below use levels in Ioo 0 1,
which is also the interval the uniform law is taken on.
The main result is inverse transform sampling: for a probability measure μ the quantile
function pushes the uniform law on the open unit interval forward to μ. It presents every real
law as the law of one explicit measurable function of a single uniform variable, and it is what
makes the monotone rearrangement of two real laws a transport plan between them.
Main definitions #
MeasureTheory.Measure.quantile— the generalized inverse of the cumulative distribution function.
Main statements #
MeasureTheory.Measure.quantile_le_iff— the Galois characterization of the quantile, withMeasureTheory.Measure.setOf_le_cdf_eq_Iciits set-level form andMeasureTheory.Measure.lt_quantile_iffits negation;MeasureTheory.Measure.map_quantile_volume_Ioo— inverse transform sampling: the quantile function pushes the uniform law onIoo 0 1forward to the original law, packaged asMeasureTheory.Measure.measurePreserving_quantile;MeasureTheory.Measure.cdf_map_eq_volume_restrict— the probability integral transform for an atomless real law;MeasureTheory.Measure.cdf_quantile_aeandMeasureTheory.Measure.quantile_cdf_ae— the two almost-everywhere inverse laws, the first for an atomless law and the second for every law;MeasureTheory.Measure.realMod0MeasureIso— for an atomless real law, the pair (cdf ν,ν.quantile) as aTauCeti.Mod0MeasureIsobetweenνand Lebesgue measure restricted to[0, 1].
References #
- R. B. Nelsen, An Introduction to Copulas, Springer 2006, §2.3, for the generalized inverse and its Galois property.
- P. Embrechts and M. Hofert, A note on generalized inverses, Mathematical Methods of Operations Research 77 (2013), 423--432.
Adapted from #
The probability integral transform cdf_map_eq_volume_restrict, the inverse laws
cdf_quantile_ae and quantile_cdf_ae, the inverse transform sampling theorem
map_quantile_volume_Ioo and the resulting realMod0MeasureIso instance are adapted from
Cameron Freer's independent implementation in Graphon/MeasureIso.lean at commit
9f7be59fa754d260a544b4cfd83d6a5b94f7552e:
https://github.com/cameronfreer/graphon/commit/9f7be59fa754d260a544b4cfd83d6a5b94f7552e,
where they appear as cdf_map_eq_volume_restrict, cdf_cdfQuantile_ae,
cdfQuantile_cdf_ae, map_cdfQuantile_volume_restrict and realMod0MeasureIso, with the
generalized inverse called cdfQuantile rather than quantile; the graphon-specific packaging
was removed. The original work is copyright Cameron Freer and licensed under Apache 2.0.
The measure-preserving equivalence that this file realizes on the real line is the classical
transport of an atomless standard-Borel space to the unit interval, proved as Theorem A.7 in
S. Janson, Graphons, cut norm and distance, couplings and rearrangements, Arkiv för
Matematik 52 (2014); see also TauCeti.MeasureTheory.Measure.exists_mpModNull_equiv_unitInterval
in TauCeti.MeasureTheory.Measure.AtomlessStandardBorel, which composes it with
TauCeti.embeddingRealMod0MeasureIso.
The quantile function of a measure on ℝ: the least point at which its cumulative
distribution function reaches the level t.
This is the honest generalized inverse of ProbabilityTheory.cdf μ for t in Set.Ioo 0 1. At
levels t ≤ 0 and 1 < t the defining infimum ranges over all of ℝ or over the empty set, and
the value is the junk value 0 (quantile_of_nonpos, quantile_of_one_lt). At the endpoint
level t = 1 the value is the least point where the cumulative distribution function reaches 1
if there is one, and 0 otherwise.
Instances For
The quantile function is the infimum of the points at which the cumulative distribution function reaches the level. The definition's body is not exposed, so this is the lemma downstream modules should rewrite with.
The cumulative distribution function at the quantile reaches every level strictly below
1.
The Galois characterization of the quantile. For a level strictly between 0 and 1,
the quantile lies below a point exactly when the cumulative distribution function at that point
reaches the level.
The quantile function is monotone on the levels where it is the honest generalized inverse.
The quantile function is measurable.
Inverse transform sampling, as a measure-preserving map from the uniform law on the open unit interval.
The probability integral transform. The CDF of an atomless probability measure on
ℝ pushes the measure forward to Lebesgue measure restricted to [0, 1].
On the closed unit interval, the CDF and quantile are inverse almost everywhere.
The quantile of the CDF is the identity almost everywhere, for every real probability measure.
The cumulative distribution function of a law with atoms has plateaus, but the part of a plateau
strictly to the right of a point whose cumulative mass is below 1 is null, so almost every
point is the least point reaching its own level.
The CDF/quantile transport of an atomless real law. The cumulative distribution function
and the quantile function of an atomless probability measure ν on ℝ push ν and Lebesgue
measure restricted to [0, 1] forward onto one another, and are mutually inverse almost
everywhere; together they are a mod-zero isomorphism between ν and the unit interval.
Equations
- One or more equations did not get rendered due to their size.