[R] FW: [Fwd: Re: [S] Exact p-values]

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Fri Feb 14 13:48:02 CET 2003


On Fri, 14 Feb 2003, Spencer Graves wrote:

> To understand the correct answer, you need to understand the following:
> 
>  > pbinom(1, 2, .5)
> [1] 0.75
> 
> This is the binomial cumulative distribution function.
> *** pbinom(0, 2, .5) = 0.25
> *** pbinom(1, 2, .5) = 0.75 = 0.25 + 0.5
> *** pbinom(2, 2, .5) = 1
> 
> However, pbinom(1e15, 2e15, .5) is a computational challenge.  Standard 
> numerical algorithms often fail in situations like this.  The code 
> should test for such cases and use more numerically stable 
> "approximations" in place of the "exact" algorithms.

Another point of view is that people should do the 2e15 trials first, and 
then worry about what their software will give when they have finished 
... that is an awfully large number of trials.

Of course software `should' be perfect, even free software, but the
developers are told several times a day on R-help what they `should' do,
which seems mean-spirited.  The constructive thing to do would be to 
submit a fully-tested patch.

-- 
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