[Rd] dchisq tail accuracy (PR#14105)
Jerry.Lewis at biogenidec.com
Jerry.Lewis at biogenidec.com
Wed Dec 2 17:55:12 CET 2009
Full_Name: Jerry W. Lewis
Version: 2.10.0
OS: Windows XP Professional
Submission from: (NULL) (198.180.131.16)
dchisq is inaccurate in the extreme tails. For instance, dchisq(1510,2,952)
returns 4.871004e-18 which is almost 15 times smaller than the correct value of
7.053889e-17. A better approach for ncp>0 would be
besselI(sxn,d2,TRUE) * (x/ncp)^(d2/2) * exp(sxn-(x+ncp)/2)/2
where logs may prevent over/underflow in extreme calculations.
More information about the R-devel
mailing list