Simple addition to random module - Student's t

Raymond Hettinger python at rcn.com
Wed Sep 2 15:15:15 EDT 2009


On Sep 2, 6:51 am, Thomas Philips <tkp... at gmail.com> wrote:
> While the random module allows one to generate randome numbers with a
> variety of distributions, some useful distributions are omitted - the
> Student's t being among them.

I'm curious to hear what your use cases are.

My understanding is that t-distribution is an estimation tool
used with small samples of a population where the variance or
standard deviation is unknown.

So, when do you ever need to generate random variables with
this distribution?  ISTM that this is akin to wanting
a generator for a Kolmogorov distribution -- usually the
distribution is used to test empirical data, not to generate it.

I think most of the existing generators were chosen because they
are useful in simulation programs.  AFAICT, the Student's t-
distribution
doesn't fall into that category (usually, you know the population
standard deviation when you're the one generating data).

ISTM, there ought to be a statistics module that can calculate
cumulative distribution functions for a variety of distributions.
This would be far more helpful than creating more generators.


Raymond



More information about the Python-list mailing list