Quantile function

From Wikipedia, the free encyclopedia

See also quantile.

In probability theory, a quantile function of a probability distribution is the inverse of its cumulative distribution function, F − 1(p). Assuming a continuous and strictly monotonic distribution function, \scriptstyle F\colon R \to (0,1), the quantile function returns the value below which random draws from the given distribution would fall, p percent of the time. That is, it returns the value of x such that

Prob(X \le x) = p.\,\!

If the distribution function is discrete rather than continuous, then there may be gaps between values in the domain of the function, or if it is only weakly monotonic, then there may be "flat spots" in its range. In either case, the quantile function is

F^{-1}(p) = inf\left\{ x\in R : p \le F(x) \right\}

for a probability \scriptstyle 0 < p < 1, and the quantile function returns the minimum value of x for which the previous probability statement holds.

Contents

[edit] Simple example

For example, the quantile function for Exponential(λ) 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\,

[edit] 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.

Quantile functions may also be characterized as solutions of non-linear ordinary and partial differential equations. The ODEs for the cases of the normal, Student, beta and gamma distributions have been given and solved (see Steinbrecher and Shaw, 2008).

[edit] 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.

[edit] Ordinary differential equation for the normal quantile

A non-linear ordinary differential equation for the normal quantile, w(p), may be given. It is

\frac{d^2 w}{d p^2} = w \left(\frac{d w}{d p}\right)^2

with the centre (boundary) conditions

w\left(1/2\right) = 0
w'\left(1/2\right) = \sqrt{2\pi}

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).

[edit] The Student t distribution

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 (see Shaw (2006) for details). The simple cases are as follows:

[edit] ν = 1 (Cauchy distribution)

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

[edit] ν = 2

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

[edit] ν = 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).\!

[edit] See also

[edit] References

  • Gilchrist, W. (2000). Statistical Modelling with Quantile Functions. 
  • Jaeckel, P. (2002). Monte Carlo methods in finance. 
  • Wichura, M.J. (1988). "Algorithm AS241: The Percentage Points of the Normal Distribution". Applied Statistics 37: 477–484. doi:10.2307/2347330. 
  • Shaw, W.T. (2006). "Sampling Student’s T distribution – use of the inverse cumulative distribution function.". Journal of Computational Finance 9 (4): 37–73. 
  • Steinbrecher, G., Shaw, W.T. (2008). "Quantile mechanics". European Journal of Applied Mathematics 19 (2): 87–112. doi:10.1017/S0956792508007341. 

[edit] External links

  • [1] An algorithm for computing the inverse normal cumulative distribution function.
  • [2] Refinement of the Normal Quantile
  • [3] New Method's for Managing "Student's" T Distribution
  • [4] ACM Algorithm 396: Student's t-Quantiles
  • [5] Applying series expansion to the inverse beta distribution to find percentiles of the F-distribution