Would you be satisfied with chisqcdf :: 0: ? The values you gave that led to NaN errors are ridiculously large in the context of the chi-squared distribution. A&S http://www.math.sfu.ca/~cbm/aands/page_941.htm consider degrees of freedom > 30 to be "large".
----- Original Message ----- From: "Sherlock, Ric" <[email protected]> Date: Monday, September 14, 2009 18:20 Subject: [Jprogramming] Chi squared CDF definition unstable To: Programming forum <[email protected]> > The definition for the Chi squared Cumulative Distribution > Function given in the essay > http://www.jsoftware.com/jwiki/Essays/Chi%20Squared%20CDF and in > the distribution.ijs script of the stats/base addon, seems to be > unstable for large values. > For example: > > 9 chisqcdf 5 10 30 100 1000 1400 1420 1470 1471 > 0.16569174 0.64951479 0.99956128 1 1 1 0 0 0 > 9 chisqcdf 1472 > |NaN error: chisqcdf > | (1 H.(1+x)%x&((*^)*(^-)~))y > > Also: > 100 200 400 600 3545 chisqcdf 3 > 4.8195188e_57 9.8668347e_142 0 0 0 > 3546 chisqcdf 3 > |NaN error: chisqcdf > | 3546 chisqcdf 3 > > Has anyone come up with more robust implementations? ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
