This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: bug in gsl_ran_chisq_pdf
- From: Rodney Sparapani <rsparapa at post dot its dot mcw dot edu>
- To: gsl-discuss at sources dot redhat dot com
- Date: Wed, 9 Apr 2003 09:33:37 -0500 (CDT)
- Subject: Re: bug in gsl_ran_chisq_pdf
- Reply-to: Rodney Sparapani <rsparapa at post dot its dot mcw dot edu>
>On Tue, 8 Apr 2003 keith dot briggs at bt dot com wrote:
>
>> In gsl-1.3, gsl_ran_chisq_pdf(0.0,nu) is wrong.
>>
>> It returns 0.0 whatever nu is.
>
>That seems to be the default behavior, absent the indication of a
>domain error. The Gamma pdf on x requires x > 0, so it does make some
>sense to return 0 for any x outside the defined domain.
>
>You seem to be suggesting that the limit for x->0 from above be
>returned instead.
>
>> It should return Inf for nu=1.
>> It should return 0.5 for nu=2.
>> It should return 0.0 for nu>2.
>
>The parameter nu is declared double, so your suggestion is not
>exhaustive. You probably meant to say
>
> raise an error for nu <= 0
> return Inf for 0 < nu < 2
> return 0.5 for nu == 2
> return 0.0 for nu > 2
>
>Anyway, I haven't seen an explicit statement about the desired
>behavior of the _pdf functions when the main argument is outside the
>domain of definition. Personally, I find the currently implemented
>behavior reasonable: the univariate PDFs in GSL are defined on
>single intervals, and the _pdf functions return 0 for values outside
>the interval (the _cdf functions would have to return 0 below the
>defined interval and 1 above).
>
>- martin
Fascinating discussion. However, the foundation of the Chi-square distribution
should follow from the sum of squared, independent standard Normals rather than
a special case of the Gamma distribution. If that's the case, then the
Chi-square pdf is defined at 0; for example, see Kendall's Advanced Theory of
Statistics, Volume I: Distribution Theory. By the way, I think the previous
correspondents are neglecting the term 1/sqrt(pi).
Rodney Sparapani Medical College of Wisconsin
Sr. Biostatistician Patient Care & Outcomes Research
rsparapa at mcw dot edu http://www.mcw.edu/pcor
Was 'Name That Tune' rigged? WWLD -- What Would Lombardi Do