[R] Peculiarity in non-central qchisq for ncp > 294.92 ...

Martin Maechler maechler at stat.math.ethz.ch
Mon Apr 14 11:54:59 CEST 2003

>>>>> "Andrew" == Andrew Robinson <andrewr at uidaho.edu>
>>>>>     on Sun, 13 Apr 2003 14:16:45 -0700 (PDT) writes:

    Andrew> Hello all, Here's my query:

    Andrew> Running R 1.6.2 on FreeBSD 5.0, and on WinXP, and I
    Andrew> find that the following hangs the process:

    Andrew> dchisq(alpha=0.01, df=1, ncp=295)

    Andrew> but it does work for ncp < 294.92.

	dchisq(alpha = *)  
always gives an error about the invalidly named argument `alpha'.
But then,
     dchisq(0.01, df=1, ncp=295)
and many other values of "ncp") do work here.
Only when carefully reading the "Subject" line, I see that
there, you are talking about  qchisq() rather than dchisq().
And indeed, I can  confirm the "hanging" behavior on Windows 2000(server).

On Linux, the result is 
> qchisq(0.01, df=1, ncp=295)
[1] 1.797693e+308
> all.equal(.Machine$double.xmax, qchisq(0.01, df=1, ncp=295))
[1] TRUE

which is not really good either:

      plot(function(x) pchisq(x, df=1, ncp=295), from=1,to=1e4, log='x')

shows the pretty bad behavior (a clear bug).
So, after all, thanks for reporting!

Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><

More information about the R-help mailing list