Quantile function

From testwiki
Jump to navigation Jump to search

Template:Short description

The probit is the quantile function of the normal distribution.

In probability and statistics, the quantile function of a probability distribution is the inverse of its cumulative distribution function. That is, the quantile function of a distribution 𝒟 is the function Q such that Pr⁡[X≤Q(p)]=p for any random variable X∼𝒟 and probability p∈(0,1).

The quantile function is also called the percentile function (after the percentile), percent-point function, inverse cumulative distribution function or inverse distribution function.

Definition

Strictly increasing distribution function

With reference to a continuous and strictly increasing cumulative distribution function (c.d.f.) FX:ℝ→[0,1] of a random variable Template:Mvar, the quantile function Q:(0,1)→ℝ maps its input p to a threshold value Template:Mvar so that the probability of Template:Mvar being less or equal than Template:Mvar is Template:Mvar. In terms of the distribution function Template:Math, the quantile function Template:Math returns the value Template:Mvar such that

FX(x):=Pr⁡(X≤x)=p,

which can be written as the inverse function of the cumulative distribution function.

Q(p)=FX−1(p).

The cumulative distribution function (shown as Template:Math) gives the Template:Mvar values as a function of the Template:Mvar values. The quantile function does the opposite: it gives the Template:Mvar values as a function of the Template:Mvar values. Note that the portion of Template:Math in red is a horizontal line segment.

General distribution function

In the general case of distribution functions that lack strict monotonicity or continuity, and therefore do not permit an inverse c.d.f., the quantile is a (potentially) set valued functional of a distribution function Template:Mvar, given by the interval

Q(p)=[sup⁡{x:F(x)<p}, sup⁡{x:F(x)≤p}]=[inf⁡{x:F(x)≥p}, inf⁡{x:F(x)>p}].

The first interval[1] is equivalent to the second interval because of the (non-strict) monotonicity of Template:Mvar.Template:Refn

It is often standard to choose the lowest value, which can equivalently be written as

Q(p)=inf⁡{x∈ℝ:p≤F(x)}.

Here we capture the fact that the quantile function returns the minimum value of Template:Mvar from amongst all those values whose c.d.f value exceeds Template:Mvar, which is equivalent to the previous probability statement in the special case that the distribution is continuous.

The quantile is also the unique function satisfying the Galois inequalities

Q(p)≤x if and only if p≤F(x).

If the function Template:Mvar is continuous and strictly monotonically increasing, then the inequalities can be replaced by equalities, and we have

Q=F−1.

In general, even though the distribution function Template:Mvar may fail to possess a left or right inverse, the quantile function Template:Mvar behaves as an "almost sure left inverse" for the distribution function, in the sense that

Q(F(X))=Xalmost surely.

Simple example

For example, the cumulative distribution function of Exponential(λ) (i.e. intensity Template:Mvar and expected value (mean) Template:Math) is

F(x;λ)={1−e−λxx≥0,0x<0.

The quantile function for Template:Math is derived by finding the value of Template:Math for which 1−e−λQ=p:

Q(p;λ)=−ln⁡(1−p)λ,

for Template:Math. The quartiles are therefore:

first quartile (Template:Math)
−ln⁡(3/4)/λ,
median (Template:Math)
−ln⁡(1/2)/λ,
third quartile (Template:Math)
−ln⁡(1/4)/λ.

Applications

Quantile functions are used in both statistical applications and Monte Carlo methods.

The quantile function is one way of prescribing a probability distribution, and it is an alternative to the probability density function (pdf) or probability mass function, the cumulative distribution function (cdf) and the characteristic function. The quantile function, Q, of a probability distribution is the inverse of its cumulative distribution function F. The derivative of the quantile function, namely the quantile density function, is yet another way of prescribing a probability distribution. It is the reciprocal of the pdf composed with the quantile function.

Consider a statistical application where a user needs to know key percentage points of a given distribution. For example, they require the median and 25% and 75% quartiles as in the example above or 5%, 95%, 2.5%, 97.5% levels for other applications such as assessing the statistical significance of an observation whose distribution is known; see the quantile entry. Before the popularization of computers, it was not uncommon for books to have appendices with statistical tables sampling the quantile function.[2] Statistical applications of quantile functions are discussed extensively by Gilchrist.[3]

Monte-Carlo simulations employ quantile functions to produce non-uniform random or pseudorandom numbers for use in diverse types of simulation calculations. A sample from a given distribution may be obtained in principle by applying its quantile function to a sample from a uniform distribution. The demands of simulation methods, for example in modern computational finance, are focusing increasing attention on methods based on quantile functions, as they work well with multivariate techniques based on either copula or quasi-Monte-Carlo methods[4] and Monte Carlo methods in finance.

The integral of the quantile function is used to compute the Lorenz curve in economics and conditional value at risk in finance.

Calculation

The evaluation of quantile functions often involves numerical methods, such as the exponential distribution above, which is one of the few distributions where a closed-form expression can be found (others include the uniform, the Weibull, the Tukey lambda (which includes the logistic) and the log-logistic). When the cdf itself has a closed-form expression, one can always use a numerical root-finding algorithm such as the bisection method to invert the cdf. Other methods rely on an approximation of the inverse via interpolation techniques.[5][6] Further algorithms to evaluate quantile functions are given in the Numerical Recipes series of books. Algorithms for common distributions are built into many statistical software packages. General methods to numerically compute the quantile functions for general classes of distributions can be found in the following libraries:

Quantile functions may also be characterized as solutions of non-linear ordinary and partial differential equations. The ordinary differential equations for the cases of the normal, Student, beta and gamma distributions have been given and solved.[11]

Normal distribution

Template:Main

The normal distribution is perhaps the most important case. Because the normal distribution is a location-scale family, its quantile function for arbitrary parameters can be derived from a simple transformation of the quantile function of the standard normal distribution, known as the probit function. Unfortunately, this function has no closed-form representation using basic algebraic functions; as a result, approximate representations are usually used. Thorough composite rational and polynomial approximations have been given by Wichura[12] and Acklam.[13] Non-composite rational approximations have been developed by Shaw.[14]

Ordinary differential equation for the normal quantile

A non-linear ordinary differential equation for the normal quantile, Template:Math, may be given. It is

d2wdp2=w(dwdp)2

with the centre (initial) conditions

w(1/2)=0, w′(1/2)=2π.

This equation may be solved by several methods, including the classical power series approach. From this solutions of arbitrarily high accuracy may be developed (see Steinbrecher and Shaw, 2008).

Student's t-distribution

Template:Further This has historically been one of the more intractable cases, as the presence of a parameter, Template:Mvar, the degrees of freedom, makes the use of rational and other approximations awkward. Simple formulas exist when the Template:Math and the problem may be reduced to the solution of a polynomial when Template:Mvar is even. In other cases the quantile functions may be developed as power series.[15] The simple cases are as follows:

where Template:Tmath, Template:Tmath, and sign⁡x={−1if x<0;−0if x=0;−1if x>0.

Quantile mixtures

Analogously to the mixtures of densities, distributions can be defined as quantile mixtures Q(p)=∑i=1maiQi(p), where Qi(p), i=1,…,m are quantile functions and Template:Nowrap i=1,…,m are the model parameters. The parameters ai must be selected so that Q(p) is a quantile function. Two four-parametric quantile mixtures, the normal-polynomial quantile mixture and the Cauchy-polynomial quantile mixture, are presented by Karvanen.[16]

Non-linear differential equations for quantile functions

The non-linear ordinary differential equation given for normal distribution is a special case of that available for any quantile function whose second derivative exists. In general the equation for a quantile, Template:Math, may be given. It is

d2Qdp2=H(Q)(dQdp)2

augmented by suitable boundary conditions, where

H(x)=−f′(x)f(x)=−ddxln⁡f(x)

and Template:Math is the probability density function. The forms of this equation, and its classical analysis by series and asymptotic solutions, for the cases of the normal, Student, gamma and beta distributions has been elucidated by Steinbrecher and Shaw (2008). Such solutions provide accurate benchmarks, and in the case of the Student, suitable series for live Monte Carlo use.

See also

Notes

Template:Reflist

References

Template:Reflist

Further reading

Template:Theory of probability distributions

pt:Quantil