[Rd] Re: [R] Bug in qchisq? (PR#875)
Sat, 10 Mar 2001 02:24:18 +0100 (MET)
Kenneth Cabrera <firstname.lastname@example.org> writes:
> Hello developers and users:
> My system fails (the computer freezes) when I use the ncp parameter,
> with the lower.tail=FALSE option in the qchisq function.
Yup, that's a bug. We have in pnchisq.c
48 for (ux = 1.0; pnchisq(ux, n, lambda, lower_tail, log_p) <
p; ux *= 2);
49 for (lx = ux; pnchisq(lx, n, lambda, lower_tail, log_p) >
p; lx *= 0.5);
but if we look at the opposite tail, we also need to reverse that
logic since pnchisq(x,...) is now decreasing in x. Otherwise the
algorithm will get stuck in one of the for loops.
(Mailed to r-bugs)
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (email@example.com) FAX: (+45) 35327907
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: firstname.lastname@example.org