Re: [Rd] inconsistency in pchisq (PR#7099)

From: <>
Date: Sat 17 Jul 2004 - 02:17:35 EST

>>>>> "Richard" == Richard Mott <> >>>>> 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) (

    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

______________________________________________ mailing list
Received on Sat Jul 17 02:27:20 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:45:02 EST