Error in chi2inv function when high degrees of freedom are used

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

Error in chi2inv function when high degrees of freedom are used

José Luis García Pallero
Hello:

I'm trying to compute the Chi-square value for different values of
confidence but using high values of degrees of freedom. When I try to
use a value for the degrees of freedom higher or equal than 1200, I
obtain this error:

>> chi2inv(0.005,1200)

 ***MESSAGE FROM ROUTINE D9LGIT IN LIBRARY SLATEC.
 ***FATAL ERROR, PROG ABORTED, TRACEBACK REQUESTED
 *  NO CONVERGENCE IN 200 TERMS OF CONTINUED FRACTION
 *  ERROR NUMBER = 3
 *
 ***END OF MESSAGE

 ***JOB ABORT DUE TO FATAL ERROR.
0          ERROR MESSAGE SUMMARY
 LIBRARY    SUBROUTINE MESSAGE START             NERR     LEVEL     COUNT
 SLATEC     D9LGIT     NO CONVERGENCE IN 20         3         2         2

error: gammainc: exception encountered in Fortran subroutine xgammainc_
error: called from:
error:   /opt/octave/share/octave/3.6.4/m/statistics/distributions/gamcdf.m
at line 58, column 12
error:   /opt/octave/share/octave/3.6.4/m/statistics/distributions/gaminv.m
at line 84, column 13
error:   /opt/octave/share/octave/3.6.4/m/statistics/distributions/chi2inv.m
at line 47, column 7

The error is located in the Fortran routine XGAMMAINC.

However, the chi2inv in Matlab works fine regardless the value of the
degrees of freedom.

Should this fact be considered a bug? What library uses Matlab internally?

Best regards

--
*****************************************
José Luis García Pallero
[hidden email]
(o<
/ / \
V_/_
Use Debian GNU/Linux and enjoy!
*****************************************
Reply | Threaded
Open this post in threaded view
|

Re: Error in chi2inv function when high degrees of freedom are used

Mike Miller-2
On Thu, Nov 7, 2013 at 16:25:37 +0100, José Luis García Pallero wrote:

> Hello:
>
> I'm trying to compute the Chi-square value for different values of
> confidence but using high values of degrees of freedom. When I try to
> use a value for the degrees of freedom higher or equal than 1200, I
> obtain this error:
> [...]
> However, the chi2inv in Matlab works fine regardless the value of the
> degrees of freedom.
>
> Should this fact be considered a bug? What library uses Matlab internally?

Hi, this error has been recently reported to the bug tracker,

  http://savannah.gnu.org/bugs/?40362

Feel free to add details or comment on the bug there.

HTH,

--
mike