Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Quantile function

From Wikipedia, the free encyclopedia
Statistical function that defines the quantiles of a probability distribution
Theprobit is thequantile function of thenormal distribution.

Inprobability andstatistics, aprobability distribution'squantile function is theinverse of itscumulative distribution function. That is, the quantile function of a distributionD{\displaystyle {\mathcal {D}}} is the functionQ{\displaystyle Q} such thatPr[XQ(p)]=p{\displaystyle \Pr \left[\mathrm {X} \leq Q(p)\right]=p} for anyrandom variableXD{\displaystyle \mathrm {X} \sim {\mathcal {D}}} and probabilityp[0,1]{\displaystyle p\in [0,1]}.

The quantile function is also called thepercentile function (after thepercentile),percent-point function,inverse cumulative distribution function orinverse distribution function.

Definition

[edit]

Strictly increasing distribution function

[edit]

With reference to a continuous and strictly increasingcumulative distribution function (c.d.f.)FX:R[0,1]{\displaystyle F_{X}\colon \mathbb {R} \to [0,1]} of arandom variableX, the quantile functionQ:[0,1]R{\displaystyle Q\colon [0,1]\to \mathbb {R} } 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

FX(x):=Pr(Xx)=p,{\displaystyle F_{X}(x):=\Pr(X\leq x)=p,}

which can be written asinverse of the c.d.f.

Q(p)=FX1(p).{\displaystyle Q(p)=F_{X}^{-1}(p).}

The cumulative distribution function (shown asF(x)) gives thep values as a function of theq values. The quantile function does the opposite: it gives theq values as a function of thep values. Note that the portion ofF(x) in red is a horizontal line segment.

General distribution function

[edit]

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]

Q(p)=[sup{x:F(x)<p},sup{x:F(x)p}].{\displaystyle Q(p)={\big [}\sup\{x\colon F(x)<p\},\sup\{x\colon F(x)\leq p\}{\big ]}.}

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

Q(p)=inf{xR:pF(x)}.{\displaystyle Q(p)=\inf\{x\in \mathbb {R} :p\leq F(x)\}.}

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

Q(p)x{\displaystyle Q(p)\leq x} if and only ifpF(x).{\displaystyle p\leq F(x).}

If the functionF is continuous and strictly monotonically increasing, then the inequalities can be replaced by equalities, and we have

Q=F1.{\displaystyle Q=F^{-1}.}

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

Q(F(X))=Xalmost surely.{\displaystyle Q{\bigl (}F(X){\bigr )}=X\quad {\text{almost surely.}}}

Simple example

[edit]

For example, the cumulative distribution function ofExponential(λ) (i.e. intensityλ andexpected value (mean1/λ) is

F(x;λ)={1eλxx0,0x<0.{\displaystyle F(x;\lambda )={\begin{cases}1-e^{-\lambda x}&x\geq 0,\\0&x<0.\end{cases}}}

The quantile function forExponential(λ) is derived by finding the value ofQ for which1eλQ=p{\displaystyle 1-e^{-\lambda Q}=p}:

Q(p;λ)=ln(1p)λ,{\displaystyle Q(p;\lambda )={\frac {-\ln(1-p)}{\lambda }},}

for0 ≤p < 1. Thequartiles are therefore:

first quartile (p = 1/4)
ln(3/4)/λ,{\displaystyle -\ln(3/4)/\lambda ,}
median (p = 2/4)
ln(1/2)/λ,{\displaystyle -\ln(1/2)/\lambda ,}
third quartile (p = 3/4)
ln(1/4)/λ.{\displaystyle -\ln(1/4)/\lambda .}

Applications

[edit]

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.

Calculation

[edit]

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]

Normal distribution

[edit]
Main article:Normal distribution § Quantile function

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]

Ordinary differential equation for the normal quantile

[edit]

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

d2wdp2=w(dwdp)2{\displaystyle {\frac {d^{2}w}{dp^{2}}}=w\left({\frac {dw}{dp}}\right)^{2}}

with the centre (initial) conditions

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

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

Student'st-distribution

[edit]
Further information:Student's 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.[15] The simple cases are as follows:

Main article:Cauchy distribution
ν = 1 (Cauchy distribution)
Q(p)=tan(π(p1/2)){\displaystyle Q(p)=\tan(\pi (p-1/2))\!}
ν = 2
Q(p)=2(p1/2)2α{\displaystyle Q(p)=2(p-1/2){\sqrt {\frac {2}{\alpha }}}\!}
ν = 4
Q(p)=sign(p1/2)2q1{\displaystyle Q(p)=\operatorname {sign} (p-1/2)\,2\,{\sqrt {q-1}}\!}

whereq=cos(13arccos(α))α{\displaystyle q={\frac {\cos \left({\frac {1}{3}}\arccos \left({\sqrt {\alpha }}\,\right)\right)}{\sqrt {\alpha }}}\!}andα=4p(1p).{\displaystyle \alpha =4p(1-p).\!}

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

[edit]

Analogously tothe mixtures of densities, distributions can be defined as quantile mixturesQ(p)=i=1maiQi(p),{\displaystyle Q(p)=\sum _{i=1}^{m}a_{i}Q_{i}(p),}whereQi(p){\displaystyle Q_{i}(p)},i=1,,m{\displaystyle i=1,\ldots ,m} are quantile functions andai{\displaystyle a_{i}},i=1,,m{\displaystyle i=1,\ldots ,m} are the model parameters. The parametersai{\displaystyle a_{i}} must be selected so thatQ(p){\displaystyle 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

[edit]

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

d2Qdp2=H(Q)(dQdp)2{\displaystyle {\frac {d^{2}Q}{dp^{2}}}=H(Q)\left({\frac {dQ}{dp}}\right)^{2}}

augmented by suitable boundary conditions, where

H(x)=f(x)f(x)=ddxlnf(x){\displaystyle H(x)=-{\frac {f'(x)}{f(x)}}=-{\frac {d}{dx}}\ln f(x)}

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.

See also

[edit]

References

[edit]
  1. ^Ehm, W.; Gneiting, T.; Jordan, A.; Krüger, F. (2016)."Of quantiles and expectiles: Consistent scoring functions, Choquet representations, and forecast rankings".J. R. Stat. Soc. B.78 (3):505–562.arXiv:1503.08195.doi:10.1111/rssb.12154.
  2. ^"Archived copy"(PDF). Archived fromthe original(PDF) on March 24, 2012. RetrievedMarch 25, 2012.{{cite web}}: CS1 maint: archived copy as title (link)
  3. ^Gilchrist, W. (2000).Statistical Modelling with Quantile Functions. Taylor & Francis.ISBN 1-58488-174-7.
  4. ^Jaeckel, P. (2002).Monte Carlo methods in finance.
  5. ^Hörmann, Wolfgang; Leydold, Josef (2003)."Continuous random variate generation by fast numerical inversion".ACM Transactions on Modeling and Computer Simulation.13 (4):347–362.doi:10.1145/945511.945517. Retrieved17 June 2024 – via WU Vienna.
  6. ^Derflinger, Gerhard; Hörmann, Wolfgang; Leydold, Josef (2010)."Random variate generation by numerical inversion when only the density is known"(PDF).ACM Transactions on Modeling and Computer Simulation.20 (4) 18:1–25.doi:10.1145/1842722.1842723.
  7. ^"UNU.RAN - Universal Non-Uniform RANdom number generators".
  8. ^"Runuran: R Interface to the 'UNU.RAN' Random Variate Generators". 17 January 2023.
  9. ^"Random Number Generators (Scipy.stats.sampling) — SciPy v1.13.0 Manual".
  10. ^Baumgarten, Christoph; Patel, Tirth (2022). "Automatic random variate generation in Python".Proceedings of the 21st Python in Science Conference. pp. 46–51.doi:10.25080/majora-212e5952-007.
  11. ^Steinbrecher, G.; Shaw, W.T. (2008). "Quantile mechanics".European Journal of Applied Mathematics.19 (2):87–112.doi:10.1017/S0956792508007341.S2CID 6899308.
  12. ^Wichura, M.J. (1988). "Algorithm AS241: The Percentage Points of the Normal Distribution".Applied Statistics.37 (3). Blackwell Publishing:477–484.doi:10.2307/2347330.JSTOR 2347330.
  13. ^An algorithm for computing the inverse normal cumulative distribution functionArchived May 5, 2007, at theWayback Machine
  14. ^Computational Finance: Differential Equations for Monte Carlo Recycling
  15. ^Shaw, W.T. (2006). "Sampling Student's T distribution – Use of the inverse cumulative distribution function".Journal of Computational Finance.9 (4):37–73.doi:10.21314/JCF.2006.150.
  16. ^Karvanen, J. (2006). "Estimation of quantile mixtures via L-moments and trimmed L-moments".Computational Statistics & Data Analysis.51 (2):947–956.doi:10.1016/j.csda.2005.09.014.

Further reading

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=Quantile_function&oldid=1315719455"
Category:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp