[R] number point under-flow
Prof Brian Ripley
ripley at stats.ox.ac.uk
Wed Feb 4 17:01:17 CET 2004
Try the latest patched version, as this has already been fixed.
> phyper(24, 514, 5961-514, 53, lower.tail=F)
[1] 1.084688e-13
o [l]choose() use a more accurate formula which also slightly
improves p- and qhyper(); choose(n, k) now returns 0 instead
of NaN for k < 0 or > n.
On Wed, 4 Feb 2004 Arne.Muller at aventis.com wrote:
> Hello,
>
> I've come across the following situation in R-1.8.1 (compile + running under
> RedHat 7.1):
>
> > phyper(24, 514, 5961-514, 53, lower.tail=T)
> [1] 1
> > phyper(24, 514, 5961-514, 53, lower.tail=F)
> [1] -1.037310e-11
>
> I'd expect the later to be 0 or some very small positive number. Is this a
> number under-flow of the calculation? Do you think I'm safe if I just set the
> result to 0 in these cases?
--
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-help
mailing list