This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Quantile

Quantile
gives the ^(th) quantile of list.
Quantile
gives a list of quantiles , , ....
Quantile
uses the quantile definition specified by parameters a, b, c, d.
Quantile
gives a quantile of the symbolic distribution dist.
  • For a list of length n, Quantile depends on . If x is an integer, the result is , where s=Sort[list, Less]. Otherwise the result is s[[Floor[x]]]+(s[[Ceiling[x]]]-s[[Floor[x]]])(c+dFractionalPart[x]), with the indices taken to be 1 or n if they are out of range.
  • The default choice of parameters is .
  • Common choices of parameters include:
{{0, 0}, {1, 0}}inverse empirical CDF (default)
{{0, 0}, {0, 1}}linear interpolation (California method)
{{1/2, 0}, {0, 0}}element numbered closest to
{{1/2, 0}, {0, 1}}linear interpolation (hydrologist method)
{{0, 1}, {0, 1}}mean-based estimate (Weibull method)
{{1, -1}, {0, 1}}mode-based estimate
{{1/3, 1/3}, {0, 1}}median-based estimate
{{3/8, 1/4}, {0, 1}}normal distribution estimate
  • Quantile always gives a result equal to an element of list.
  • The same is true whenever d is .
  • When d is , Quantile is piecewise linear as a function of q.
  • About 10 different choices of parameters are in use in statistical work.
Find the halfway value (median) of a list:
Find the quarter-way value (lower quartile) of a list:
Lower and upper quartiles:
The q^(th) quantile for a normal distribution:
Quantile function for a continuous univariate distribution:
Quantile function for a discrete univariate distribution:
Find the halfway value (median) of a list:
In[1]:=
Click for copyable input
Out[1]=
 
Find the quarter-way value (lower quartile) of a list:
In[1]:=
Click for copyable input
Out[1]=
 
Lower and upper quartiles:
In[1]:=
Click for copyable input
Out[1]=
 
The q^(th) quantile for a normal distribution:
In[1]:=
Click for copyable input
Out[1]=
 
Quantile function for a continuous univariate distribution:
In[1]:=
Click for copyable input
Out[1]=
 
Quantile function for a discrete univariate distribution:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
Quantile works with any real numeric quantities:
Find quantiles of elements in each column:
Find multiple quantiles of elements in each column:
Obtain results at any precision:
Compute results for a large vector or matrix:
Compute results using other parametrizations:
Obtain exact numeric results:
Obtain a machine-precision result:
Obtain a result at any precision for a continuous distribution:
Obtain a symbolic expression for the quantile:
Quantile for nonparametric distributions:
Compare with the value for the underlying parametric distribution:
Plot the quantile for a histogram distribution:
Quantile for a truncated distribution:
Quadratic transformation of an exponential distribution:
Censored distribution:
Plot the q^(th) quantile for a list:
Plot a linearly interpolated quantile:
Generate a random number from a distribution:
With default parameters Quantile always returns an element of the list:
Quartiles gives linearly interpolated Quantile values for a list:
InterquartileRange is the difference of linearly interpolated Quantile values for a list:
QuartileDeviation is half the difference of linearly interpolated Quantile values for a list:
QuartileSkewness uses linearly interpolated Quantile values as a skewness measure:
Quantile is equivalent to InverseCDF for distributions:
Symbolic closed forms do not exist for some distributions:
Numerical evaluation works:
Substitution of invalid values into symbolic outputs gives results that are not meaningful:
Passing it as an argument, it stays unevaluated:
Here is the 1/2 quantile with two varying parameters:
New in 5 | Last modified in 6