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

From: <maechler_at_stat.math.ethz.ch>
Date: Sat 17 Jul 2004 - 02:17:35 EST


>>>>> "Richard" == Richard Mott <Richard.Mott@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

______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-devel
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