[Rd] inconsistency in pchisq (PR#7099)

maechler at stat.math.ethz.ch maechler at stat.math.ethz.ch
Fri Jul 16 18:17:35 CEST 2004


>>>>> "Richard" == Richard Mott <Richard.Mott at well.ox.ac.uk>
>>>>>     on Fri, 16 Jul 2004 16:30:05 +0200 (CEST) writes:

    Richard> Full_Name: Richard Mott Version: 1.9.0 OS: Windows
    Richard> XP Submission from: (NULL) (81.178.233.208)


    Richard> Shouldn't these give the same answer?

well, no,..
though I agree it should be mentioned in the documentation

    > pchisq(67.60644,df=1,lower.tail=F,ncp=0)
    [1] 3.219647e-15
    > pchisq(67.60644,df=1,lower.tail=F)
    [1] 1.996145e-16

The first call uses the internal code
for non-central chisq, the 2nd one using the central chisq.
In extreme cases (like the above), these differ more than just
neglibly.  
But we want to have both available, partly for experimental reasons

BTW 1: There are still concrete plans (by me) to use better (and much
     larger) code for improved incomplete beta and gamma
     functions which are really at the base of many of these
     p*() functions [and often consequently the q*() ones] in R.

BTW 2: the same (difference between "no ncp" and "ncp=0")
       applies to   pt(*, ncp).

--
Martin Maechler



More information about the R-devel mailing list