[Rd] Bug in 'pchisq' for x=0.0 (PR#9485)

ripley at stats.ox.ac.uk ripley at stats.ox.ac.uk
Wed Jan 31 18:33:53 CET 2007


Please do not report on obsolete versions of R!  From the changes from 
2.4.1:

     o	pchisq() would sometimes use the wrong tail when calculating
 	non-central probabilities with lower.tail = FALSE. (PR#9406)

You are quite explicitly asked not to waste the R project's resources in 
this way.  Please do re-read the FAQ.


On Wed, 31 Jan 2007, nothnagel at medinfo.uni-kiel.de wrote:

> The function 'pchisq' from the 'stats' library gives a wrong result if the
> argument equals exactly zero:
>
> # Upper tail of central 1-df chi^2 distribution
>> pchisq(1         , 1, ncp=0, lower.tail = F, log.p = FALSE)
> [1] 0.3173105
>> pchisq(0.5       , 1, ncp=0, lower.tail = F, log.p = FALSE)
> [1] 0.4795001
>> pchisq(0.01      , 1, ncp=0, lower.tail = F, log.p = FALSE)
> [1] 0.9203443
>> pchisq(0.0001    , 1, ncp=0, lower.tail = F, log.p = FALSE)
> [1] 0.9920213
>> pchisq(0.00000001, 1, ncp=0, lower.tail = F, log.p = FALSE)
> [1] 0.9999202
>> pchisq(0.00      , 1, ncp=0, lower.tail = F, log.p = FALSE)
> [1] 0   ## Should be 1.0
>
> The error occurred with R version 2.4.0 (windows) and version 2.3.1 (linux).
>
>
> Best regards,
>
> Michael Nothnagel
>
> ---
> Dr. Michael Nothnagel
> Institute of Medical Informatics and Statistics,
> University of Kiel
> http://capella.uni-kiel.de/
> ---
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list