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]Quantile
[list, q, {{$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:
{{0, 0}, {1, 0}}
inverse empirical CDF (default){{0, 0}, {0, 1}}
linear interpolation (California method) Quantile[list,q]
always gives a result equal to an element of list.
Quantile[Range[11], 1/3]
Quantile[Range[16], 1/4]
Quantile[{1, 2, 3, 4, 5, 6, 7}, {1/4, 3/4}]