Quantile function

In theory of probability, a quantile function of a probability distribution is the inverse of its cumulative distribution function.

Simple example
For example, the quantile function for Exponential(&lambda;) is


 * $$F^{-1}(p;\lambda) = \frac{-\ln(1-p)}{\lambda}, \!$$

for $$\scriptstyle 0 \le p < 1$$. The quartiles are therefore:


 * first quartile : $$\ln(4/3)/\lambda\,$$
 * median : $$\ln(2)/\lambda\,$$
 * third quartile : $$\ln(4)/\lambda\,$$

Theory
The quantile functions of even the common distributions are relatively poorly understood beyond the use of simple lookup tables, which is at odds with their importance in Monte Carlo sampling, where a sample from a given distribution may be obtained in principle by applying its quantile function to a sample from a uniform distribution. The exponential case above is one of the very few distributions where there is a simple formula. In the absence of better methods one can always resort to searching the values of the cumulative distribution function (CDF) using the bisection method. For algorithms to evaluate CDFs see the Numerical Recipes series of books.

Users of quantile functions typically fall into two categories, those interested in statistical applications and those involved in Monte-Carlo simulations. For statistical applications, users need 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 significance of an observation whose distribution is known. See the quantile entry. Statistical applications of quantile functions are discussed extensively by Gilchrist (2000).

To support Monte-Carlo simulations, users employ quantile functions to produce random, non-uniform deviates for use in diverse types of simulation calculations. The demands, for example, of simulation methods 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 (see Jackel, 2002) and Monte Carlo methods in finance.

The normal distribution
The normal distribution is perhaps the most important case, and, in the absence of a simple formula, approximate representations are usually used. Thorough composite rational and polynomial approximations have been given by Wichura (1988) and Acklam (see his web site in External Links). Also see the entry on the probit function.

The Student t distribution
This has historically been one of the more intractable cases, as the presence of a parameter, &nu;, the degrees of freedom, makes the use of rational and other approximations awkward. Simple formulas exist when the &nu; = 1, 2, 4 and the problem may be reduced to the solution of a polynomial when &nu; is even. In other cases the quantile functions may be developed as power series (see Shaw (2006) for details). The simple cases are as follows:

$$\nu=1$$ (Cauchy distribution)

 * $$F^{-1}(p) = \tan (\pi(p-1/2)) \!$$

$$\nu=2$$

 * $$F^{-1}(p) = \frac{2p-1}{\sqrt{2p(1-p)}} \!$$

$$\nu=4$$

 * $$F^{-1}(p) = \operatorname{sign}(p-1/2)\sqrt{q-4}\!$$

where


 * $$q = \frac{4}{\sqrt{\alpha}}\cos\left(\frac{1}{3}\arccos\left(\sqrt{\alpha}\,\right)\right)\!$$

and


 * $$\alpha = 4p(1-p).\!$$