Noncentral chi square

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Noncentral chi square

Peck, Jon
Message: 1
Date: Mon, 19 May 2008 09:20:21 -0400
From: Neal Becker <[hidden email]>
Subject: [Numpy-discussion] noncentral_chisquare buglet?
To: [hidden email]
Message-ID: <g0ruqm$ke$[hidden email]>
Content-Type: text/plain; charset=us-ascii

    def noncentral_chisquare(self, df, nonc, size=None):
        """Noncentral Chi^2 distribution.

        noncentral_chisquare(df, nonc, size=None) -> random values
        """
        cdef ndarray odf, ononc
        cdef double fdf, fnonc
        fdf = PyFloat_AsDouble(df)
        fnonc = PyFloat_AsDouble(nonc)
        if not PyErr_Occurred():
            if fdf <= 1:
                raise ValueError("df <= 0") <<<????

I think this message should be "df <= 1"?

[>>>Peck, Jon]
Isn't it rather that the message is correct but the test is wrong?  Shouldn't it be
if fdf <= 0  ?

-Jon Peck
_______________________________________________
Numpy-discussion mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Noncentral chi square

Robert Kern-2
On Mon, May 19, 2008 at 11:33 AM, Peck, Jon <[hidden email]> wrote:

> Message: 1
> Date: Mon, 19 May 2008 09:20:21 -0400
> From: Neal Becker <[hidden email]>
> Subject: [Numpy-discussion] noncentral_chisquare buglet?
> To: [hidden email]
> Message-ID: <g0ruqm$ke$[hidden email]>
> Content-Type: text/plain; charset=us-ascii
>
>    def noncentral_chisquare(self, df, nonc, size=None):
>        """Noncentral Chi^2 distribution.
>
>        noncentral_chisquare(df, nonc, size=None) -> random values
>        """
>        cdef ndarray odf, ononc
>        cdef double fdf, fnonc
>        fdf = PyFloat_AsDouble(df)
>        fnonc = PyFloat_AsDouble(nonc)
>        if not PyErr_Occurred():
>            if fdf <= 1:
>                raise ValueError("df <= 0") <<<????
>
> I think this message should be "df <= 1"?
>
> [>>>Peck, Jon]
> Isn't it rather that the message is correct but the test is wrong?  Shouldn't it be
> if fdf <= 0  ?

<goes back over assumptions> Yes, you are correct.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco
_______________________________________________
Numpy-discussion mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/numpy-discussion