Function Quantile

Part of:

package cl-mathstats
( quantile &rest < args > )

quantile (data q &key start end key)
Returns the element which is the q'th percentile of the data when accessed by
key.&#39; That is, it returns the element such that q' of the data is smaller than
it and 1- q&#39; is above it, where q' is a number between zero and one, inclusive.
For example, if q&#39; is .5, this returns the median; if q' is 0, this returns
the minimum (although the `minimum' function is more efficient).

This function uses the bisection method, doing linear interpolation between
elements i and i+1, where i=floor(q(n-1)). See the manual for more information.
The function returns three values: the interpolated quantile and the two
elements that determine the interval it was interpolated in. If the quantile
was exact, the second two values are the same element of the data.