A quantile is a value which divides a frequency distribution such that there is a given proportion of data values below the quantile. For example, the median of a dataset is the $0.5$ quantile because half the values are less than or equal to it; and the $0.25$ quantile is the $25$th percentile.
nag_double_quantiles (g01amc) uses a modified version of Singleton's ‘median-of-three’ Quicksort algorithm (
Singleton (1969)) to determine specified quantiles of a vector of real values. The input vector is partially sorted, as far as is required to compute desired quantiles; for a single quantile, this is much faster than sorting the entire vector. Where necessary, linear interpolation is also carried out to return the values of quantiles which lie between two data points.
Singleton R C (1969) An efficient algorithm for sorting with minimal storage: Algorithm 347 Comm. ACM 12 185–187
Not applicable.
This example computes a list of quantiles from an array of doubles and an array of point values.