Quantile

Quantile (WMA link)

In statistics and probability, quantiles are cut points dividing the range of a probability distribution into continuous intervals with equal probabilities, or dividing the observations in a sample in the same way.

Quantile is also known as value at risk (VaR) or fractile.


Quantile[list, q]

returns the qth quantile of list.

Quantile[list, q, {{$a,b$}, {$c,d$}}]

uses the quantile definition specified by parameters a, b, c, d.

For a list of length n, Quantile[list, q, {{$a ,b$}, {$c, d$}}] depends on $x=a+(n+b)q$.

If x is an integer, the result is $s[[x]]$, where s=Sort[list,Less].

Otherwise, the result is:
s[[Floor[x]]] + (s[[Ceiling[x]]] - s[[Floor[x]]])(c + d FractionalPart[x]),
with the indices taken to be 1 or n if they are out of range.

The default choice of parameters is {{0,0},{1,0}}.


Common choices of parameters include:

Quantile[list,q] always gives a result equal to an element of list.

Quartiles