Re: Simple addition to random module - Student's t

2009-09-03 Thread Daniel Stutzbach
On Wed, Sep 2, 2009 at 2:15 PM, Raymond Hettinger wrote: > 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. > Many of the formulas for cumulative dist

Re: Simple addition to random module - Student's t

2009-09-03 Thread Terry Reedy
Robert Kern wrote: On 2009-09-02 14:15 PM, Raymond Hettinger wrote: On Sep 2, 6:51 am, Thomas Philips 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 t

Re: Simple addition to random module - Student's t

2009-09-02 Thread Robert Kern
On 2009-09-02 14:15 PM, Raymond Hettinger wrote: On Sep 2, 6:51 am, Thomas Philips 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

Re: Simple addition to random module - Student's t

2009-09-02 Thread Thomas Philips
On Sep 2, 2:37 pm, Mark Dickinson wrote: > On Sep 2, 6:15 pm, Thomas Philips wrote: > > > I mis-spoke - the variance is infinite when df=2 (the variance is df/ > > (df-2), > > Yes:  the variance is infinite both for df=2 and df=1, and Student's t > with df=1 doesn't even have an expectation.  I d

Re: Simple addition to random module - Student's t

2009-09-02 Thread Raymond Hettinger
> To get this into core Python, you'd usually submit a feature request > athttp://bugs.python.org. If you do submit a patch, please assign it to me. I've been the primary maintainer for that module for several years. Raymond Hettinger -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple addition to random module - Student's t

2009-09-02 Thread Raymond Hettinger
On Sep 2, 6:51 am, Thomas Philips 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-distrib

Re: Simple addition to random module - Student's t

2009-09-02 Thread Mark Dickinson
On Sep 2, 6:15 pm, Thomas Philips wrote: > I mis-spoke - the variance is infinite when df=2 (the variance is df/ > (df-2), Yes: the variance is infinite both for df=2 and df=1, and Student's t with df=1 doesn't even have an expectation. I don't see why this would stop you from generating meanin

Re: Simple addition to random module - Student's t

2009-09-02 Thread Robert Kern
On 2009-09-02 11:28 AM, Mark Dickinson wrote: On Sep 2, 2:51 pm, Thomas Philips wrote: def student_t(df): # df is the number of degrees of freedom if df< 2 or int(df) != df: raise ValueError, 'student_tvariate: df must be a integer> 1' By the way, why do you exclude th

Re: Simple addition to random module - Student's t

2009-09-02 Thread Thomas Philips
On Sep 2, 1:03 pm, Thomas Philips wrote: > On Sep 2, 12:28 pm, Mark Dickinson wrote: > > > On Sep 2, 2:51 pm, Thomas Philips wrote: > > > > def student_t(df):         # df is the number of degrees of freedom > > >     if df < 2  or int(df) != df: > > >        raise ValueError, 'student_tvariate:

Re: Simple addition to random module - Student's t

2009-09-02 Thread Thomas Philips
On Sep 2, 12:28 pm, Mark Dickinson wrote: > On Sep 2, 2:51 pm, Thomas Philips wrote: > > > def student_t(df):         # df is the number of degrees of freedom > >     if df < 2  or int(df) != df: > >        raise ValueError, 'student_tvariate: df must be a integer > 1' > > By the way, why do you

Re: Simple addition to random module - Student's t

2009-09-02 Thread Mark Dickinson
On Sep 2, 2:51 pm, Thomas Philips wrote: > def student_t(df):         # df is the number of degrees of freedom >     if df < 2  or int(df) != df: >        raise ValueError, 'student_tvariate: df must be a integer > 1' By the way, why do you exclude the possibility df=1 here? -- Mark -- http://m

Re: Simple addition to random module - Student's t

2009-09-02 Thread Mark Dickinson
On Sep 2, 2:51 pm, Thomas Philips 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. This distribution is easily derived from > the normal distribution and the chi-sq

Simple addition to random module - Student's t

2009-09-02 Thread Thomas Philips
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. This distribution is easily derived from the normal distribution and the chi-squared distribution (which in turn is a special cas