A quantile of a distribution is a value that divides its probability mass in a specified proportion. If
a random variable has distribution function
, a standard quantile
function is the generalized inverse defined, for
, by
|
(1)
|
When is continuous
and strictly increasing,
is the unique value
satisfying
. For a discontinuous distribution, such an equality need not have a solution,
which is why the generalized-inverse definition is used (Hyndman and Fan 1996).
The th
-tile is the quantile
for
, ...,
(Kenney and Keeping 1962). If
, the interior quantiles are called quartiles,
and if
, they are called percentiles.
The standard names for several common divisions are summarized below. Dividing a distribution into equal parts requires
interior cut points. In particular, the two cut points that
divide a distribution into thirds are tertiles,
while the three resulting groups are terciles.
| number of parts | cut-point name | number of cut points |
| 3 | tertile | 2 |
| 4 | quartile | 3 |
| 5 | quintile | 4 |
| 10 | decile | 9 |
| 100 | percentile | 99 |
A parametrized version of quantile is implemented as Quantile[list, q, a, b
,
c,
d
], which returns
|
(2)
|
where is the
th order statistic,
is the floor
function,
is the ceiling function,
is the fractional part,
and
|
(3)
|
For a nonempty sample and , extend the order
statistics by
for
and
for
. There are a number of slightly different definitions
of the quantile that are in common use, as summarized in the following table.
| # | plotting position | description | ||||
| Q1 | 0 | 0 | 1 | 0 | inverted empirical CDF | |
| Q2 | -- | -- | -- | -- | inverted empirical CDF with averaging | |
| Q3 | -- | -- | -- | -- | -- | nearest order statistic, with ties to even |
| Q4 | 0 | 0 | 0 | 1 | California Department of Public Works method | |
| Q5 | 0 | 0 | 1 | Hazen's model (popular in hydrology) | ||
| Q6 | 0 | 1 | 0 | 1 | Weibull quantile | |
| Q7 | 1 | 0 | 1 | interpolation points divide sample
range into | ||
| Q8 | 0 | 1 | approximately median-unbiased | |||
| Q9 | 0 | 1 | approximate unbiased estimate for a normal distribution |
The Wolfram Language's fixed four-parameter formula handles Q1 and Q4 through Q9. Q2 and Q3 require separate rules at discontinuities.
In Q1, the empirical distribution function
is the estimated cumulative proportion of the data set that does not exceed any specified
value. Q2 is essentially the same as Q1 except that averages
are taken at points of discontinuity. In Q3, the
th quantile is the order
statistic whose index is the nearest integer to
, with ties resolved toward the even
integer and the index clipped to the interval
, where
is the sample size. Q4 uses
interpolation at plotting
positions
for
, ...,
. For
distinct order statistics, their values divide
the sample range into
adjacent intervals. For an independent sample
from a continuous distribution, the order statistics divide the sample
space into
regions, each with expected probability
. Q6 uses the corresponding plotting
positions
,
which are the means of the transformed order
statistics
.
Hyndman and Fan (1996) attribute these positions to Weibull (1939) and Gumbel (1939).
For
, Q7 uses the plotting
positions
and linear interpolation between adjacent positions
and their order statistics. Q8 plots
at an approximation to the median plotting position. Q9 is used in quantile-quantile
plots. If
is the normal distribution and
is the plotting position
of
, then
is an approximately unbiased estimate
of
.