The docstring of
quantile in the
Statistics module says:
quantile(itr, p; sorted=false)
Compute the quantile(s) of a collection
itrat a specified probability or vector or tuple of
pon the interval [0,1]. The keyword argument
itrcan be assumed to be sorted.
itr cannot actually be any iterable; only
<:AbstractVector or something that becomes that type after
collect, as seen in the “in-place” function
quantile! For instance, a
Matrix or more generally an
N > 1 is not accepted.
What would be the best way to calculate quantiles for such variables?
An obvious option is
quantile(x[:], p), but this makes an unnecessary copy.
quantile(view(x,:), p) would avoid the copy, but I don’t know if there something better.