
Inprobability andstatistics, aprobability distribution'squantile function is theinverse of itscumulative distribution function. That is, the quantile function of a distribution is the function such that for anyrandom variable and probability.
The quantile function is also called thepercentile function (after thepercentile),percent-point function,inverse cumulative distribution function orinverse distribution function.
With reference to a continuous and strictly increasingcumulative distribution function (c.d.f.) of arandom variableX, the quantile function maps its inputp to a threshold valuex so that the probability ofX being less or equal thanx isp. In terms of the distribution functionF, the quantile functionQ returns the valuex such that
which can be written asinverse of the c.d.f.

In the general case of distribution functions that are not strictly monotonic and therefore do not permit an inversec.d.f., the quantile is a (potentially) set valued functional of a distribution functionF, given by the interval[1]
It is often standard to choose the lowest value, which can equivalently be written as (using right-continuity ofF)
Here we capture the fact that the quantile function returns the minimum value ofx from amongst all those values whose c.d.f value exceedsp, which is equivalent to the previous probability statement in the special case that the distribution is continuous.
The quantile is the unique function satisfying theGalois inequalities
if and only if
If the functionF is continuous and strictly monotonically increasing, then the inequalities can be replaced by equalities, and we have
In general, even though the distribution functionF may fail to possess aleft or right inverse, the quantile functionQ behaves as an "almost sure left inverse" for the distribution function, in the sense that
For example, the cumulative distribution function ofExponential(λ) (i.e. intensityλ andexpected value (mean) 1/λ) is
The quantile function forExponential(λ) is derived by finding the value ofQ for which:
for0 ≤p < 1. Thequartiles are therefore:
Quantile functions are used in both statistical applications andMonte Carlo methods.
The quantile function is one way of prescribing a probability distribution, and it is an alternative to theprobability density function (pdf) orprobability mass function, thecumulative distribution function (cdf) and thecharacteristic function. The quantile function,Q, of a probability distribution is theinverse of its cumulative distribution functionF. The derivative of the quantile function, namely thequantile 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 keypercentage 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 thestatistical significance of an observation whose distribution is known; see thequantile 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 orpseudorandom 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 moderncomputational finance, are focusing increasing attention on methods based on quantile functions, as they work well withmultivariate techniques based on eithercopula or quasi-Monte-Carlo methods[4] andMonte Carlo methods in finance.
The evaluation of quantile functions often involvesnumerical methods, such as the exponential distribution above, which is one of the few distributions where aclosed-form expression can be found (others include theuniform, theWeibull, theTukey lambda (which includes thelogistic) and thelog-logistic). When the cdf itself has a closed-form expression, one can always use a numericalroot-finding algorithm such as thebisection 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 theNumerical Recipes series of books. Algorithms for common distributions are built into manystatistical 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 partialdifferential equations. Theordinary differential equations for the cases of thenormal,Student,beta andgamma distributions have been given and solved.[11]
Thenormal distribution is perhaps the most important case. Because the normal distribution is alocation-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 theprobit 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]
A non-linear ordinary differential equation for the normal quantile,w(p), may be given. It is
with the centre (initial) conditions
This equation may be solved by several methods, including the classicalpower series approach. From this solutions of arbitrarily high accuracy may be developed (see Steinbrecher and Shaw, 2008).
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, 4 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:
whereand
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.
Analogously tothe mixtures of densities, distributions can be defined as quantile mixtureswhere, are quantile functions and, are the model parameters. The parameters must be selected so that 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]
The non-linear ordinary differential equation given fornormal 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), may be given. It is
augmented by suitable boundary conditions, where
andf(x) 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.
{{cite web}}: CS1 maint: archived copy as title (link)