[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with chisquare_inv/chi2inv
From: |
David Bateman |
Subject: |
Re: Problem with chisquare_inv/chi2inv |
Date: |
Wed, 19 Sep 2007 17:09:01 +0200 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20060921) |
A. Scottedward Hodel wrote:
> The behavior of chisquare_inv (deprecated) and chi2inv appears to have
> changed between 2.9.12 and 2.9.13; I initially thought that the change
> is a result of a mild change to gaminv.m between octave 2.9.12 and
> 2.9.13 (diff at the end of this file), but this may incorrect.
> Consider the code below:
>
> figure(1)
> nu = linspace(1,2);
> yy = sqrt(2*chi2inv(0.5,nu) ./ nu );
> y2 = -0.1394*(nu.^2) + 0.6355*nu + 0.4612;
> plot(nu,yy,'-;chisquare distribution function;', nu, y2,'-;quadratic
> approx;');
> grid on
> title('check quadratic approximation');
>
> The two plots should match fairly closely, but as of octave 2.9.13,
> they are now off by about a factor of two. I notice that they match
> almost perfectly if I reverse the order of the arguments to chi2inv,
> so perhaps this is the appropriate action for those of us using the
> old function.
>
> I don't know whether the above issue is a bug or not. However, it
> took me several days to track it down in my simulation work, so I
> thought I should report it to the list in case someone else has this
> problem as well.
>
The change in gaminv was done to be compatible with matlab, and so that
should stay. The error is that the change to gaminv, gampdf and gamcdf
were not propagated to the chi2* functions. See thread
http://www.nabble.com/problem-with-chi2pdf-tf4377434.html
The upshot is that this is fixed in 2.9.14
Regards
David
--
David Bateman address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary