[Python-ideas] Adding quantile to the statistics module
Nathaniel Smith
njs at pobox.com
Sat Mar 17 02:48:14 EDT 2018
On Fri, Mar 16, 2018 at 11:19 PM, Stephen J. Turnbull
<turnbull.stephen.fw at u.tsukuba.ac.jp> wrote:
> PLIQUE Guillaume writes:
>
> > That's really interesting. I did not know there were so many way to
> > consider quantiles. Maybe we should indeed wait for numpy to take a
> > decision on the matter and go with their default choice so we remain
> > consistent with the ecosystem?
>
> The example of R with 9 variants baked into one function suggests that
> numpy is unlikely to come up with a single "good" choice. If R's
> default is to Steven's taste, I would say go with that for cross-
> language consistency, and hope that numpy makes the same decision. In
> fact, I would argue that numpy might very well make a decision for a
> default that has nice mathematical properties, while the stdlib module
> might very well prefer consistency with R's default since defaults
> will be used in the same kind of "good enough for government work"
> contexts in both languages.
NumPy already has a default and supports a number of variants. I'd
have to go digging to figure out which languages/tools use which
methods and how those match to theoretical properties, but IIRC numpy,
R, and matlab all have different defaults.
The 9 types that R supports come from a well-known review article
(Hyndman & Fan, 1996). Their docs note that Hyndman & Fan's
recommendation is different from the default, because the default was
chosen to match a previous package (S) before they read Hyndman & Fan.
It's all a bit messy.
None of this is to say that Python shouldn't have some way to compute
quantiles, but unfortunately you're not going to find TOOWTDI.
-n
--
Nathaniel J. Smith -- https://vorpus.org
More information about the Python-ideas
mailing list