Quantile function

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Template:Short description

File:Probit plot.svg
The probit is the quantile function of the normal distribution.

In probability and statistics, the quantile function is a function Q:[0,1] which maps some probability x[0,1] of a random variable v to the value of the variable y such that P(vy)=x according to its probability distribution. In other words, the function returns the value of the variable below which the specified cumulative probability is contained. For example, if the distribution is a standard normal distribution then Q(0.5) will return 0 as 0.5 of the probability mass is contained below 0.

The quantile function is also called the percentile function (after the percentile), percent-point function, inverse cumulative distribution function (after the cumulative distribution function or c.d.f.) 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 FScript error: No such module "Check for unknown parameters"., the quantile function QScript error: No such module "Check for unknown parameters". returns the value Template:Mvar such that

FX(x):=Pr(Xx)=p,

which can be written as inverse of the c.d.f.

Q(p)=FX1(p).

File:Quantile distribution function.svg
The cumulative distribution function (shown as F(x)Script error: No such module "Check for unknown parameters".) 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 F(x)Script error: No such module "Check for unknown parameters". in red is a horizontal line segment.

General distribution function

In the general case of distribution functions that are not strictly monotonic 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[1]

Q(p)=[sup{x:F(x)<p},sup{x:F(x)p}].

It is often standard to choose the lowest value, which can equivalently be written as (using right-continuity of Template:Mvar)

Q(p)=inf{x:pF(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 the unique function satisfying the Galois inequalities

Q(p)x if and only if pF(x).

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

Q=F1.

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 (mean1/λScript error: No such module "Check for unknown parameters".) is

F(x;λ)={1eλxx0,0x<0.

The quantile function for Exponential(λ)Script error: No such module "Check for unknown parameters". is derived by finding the value of QScript error: No such module "Check for unknown parameters". for which 1eλQ=p:

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

for 0 ≤ p < 1Script error: No such module "Check for unknown parameters".. The quartiles are therefore:

first quartile (p = 1/4Script error: No such module "Check for unknown parameters".)
ln(3/4)/λ,
median (p = 2/4Script error: No such module "Check for unknown parameters".)
ln(1/2)/λ,
third quartile (p = 3/4Script error: No such module "Check for unknown parameters".)
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.

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

Script error: No such module "Labelled list hatnote".

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, w(p)Script error: No such module "Check for unknown parameters"., 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

Script error: No such module "labelled list hatnote". This has historically been one of the more intractable cases, as the presence of a parameter, ν, the degrees of freedom, makes the use of rational and other approximations awkward. Simple formulas exist when the ν = 1, 2, 4Script error: No such module "Check for unknown parameters". and the problem may be reduced to the solution of a polynomial when ν is even. In other cases the quantile functions may be developed as power series.[15] The simple cases are as follows:

Script error: No such module "Labelled list hatnote".

ν = 1 (Cauchy distribution)
Q(p)=tan(π(p1/2))
ν = 2
Q(p)=2(p1/2)2α
ν = 4
Q(p)=sign(p1/2)2q1

where q=cos(13arccos(α))α and α=4p(1p).

In the above the "sign" function is +1 for positive arguments, −1 for negative arguments and zero at zero. It should not be confused with the trigonometric sine function.

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 ai, 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, Q(p)Script error: No such module "Check for unknown parameters"., may be given. It is

d2Qdp2=H(Q)(dQdp)2

augmented by suitable boundary conditions, where

H(x)=f(x)f(x)=ddxlnf(x)

and f(x)Script error: No such module "Check for unknown parameters". 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

References

<templatestyles src="Reflist/styles.css" />

  1. Script error: No such module "Citation/CS1".
  2. Script error: No such module "citation/CS1".
  3. Script error: No such module "citation/CS1".
  4. Script error: No such module "citation/CS1".
  5. Script error: No such module "Citation/CS1".
  6. Script error: No such module "Citation/CS1".
  7. Script error: No such module "citation/CS1".
  8. Script error: No such module "citation/CS1".
  9. Script error: No such module "citation/CS1".
  10. Script error: No such module "citation/CS1".
  11. Script error: No such module "Citation/CS1".
  12. Script error: No such module "Citation/CS1".
  13. An algorithm for computing the inverse normal cumulative distribution function Template:Webarchive
  14. Computational Finance: Differential Equations for Monte Carlo Recycling
  15. Script error: No such module "Citation/CS1".
  16. Script error: No such module "Citation/CS1".

Script error: No such module "Check for unknown parameters".

Further reading

Template:Theory of probability distributions

pt:Quantil