Re: Simple addition to random module - Student's t
- From: Mark Dickinson <dickinsm@xxxxxxxxx>
- Date: Wed, 2 Sep 2009 11:37:33 -0700 (PDT)
On Sep 2, 6:15 pm, Thomas Philips <tkp...@xxxxxxxxx> 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 meaningful samples, though.
and you get the Cauchy when df=2.
Are you sure about this? All my statistics books are currently hiding
in my mother-in-law's attic, several hundred miles away, but wikipedia
and mathworld seem to say that df=1 gives you the Cauchy distribution.
I made the mistake because the denominator is equivalent to the
square root of the sample variance of df normal observations,
As I'm reading it, the denominator is the square root of the sample
variance of *df+1* independent standard normal observations. I agree
that the wikipedia description is a bit confusing.
It seems that there are uses for Student's t distribution with
non-integral degrees of freedom. The Boost library, and the R
programming language both allow non-integral degrees of freedom.
So (as Robert Kern already suggested), you could drop the test
for integrality of df. In fact, you could just drop the tests
on df entirely: df <= 0.0 will be picked up in the gammavariate
call.
--
Mark
.
- Follow-Ups:
- Re: Simple addition to random module - Student's t
- From: Thomas Philips
- Re: Simple addition to random module - Student's t
- References:
- Simple addition to random module - Student's t
- From: Thomas Philips
- Re: Simple addition to random module - Student's t
- From: Mark Dickinson
- Re: Simple addition to random module - Student's t
- From: Thomas Philips
- Re: Simple addition to random module - Student's t
- From: Thomas Philips
- Simple addition to random module - Student's t
- Prev by Date: Re: Entry Level Python Jobs
- Next by Date: pickle error - 'module' object has no attribute '_reconstruct'
- Previous by thread: Re: Simple addition to random module - Student's t
- Next by thread: Re: Simple addition to random module - Student's t
- Index(es):
Relevant Pages
|