From thomas@biostat.washington.edu  Fri Apr  7 16:33:13 2000
From: thomas@biostat.washington.edu (Thomas Lumley)
Date: Fri, 7 Apr 2000 08:33:13 -0700 (PDT)
Subject: [Rd] Bug in qbinom? (PR#511)
In-Reply-To: <200004071515.RAA13504@pubhealth.ku.dk>
Message-ID: <Pine.GSO.4.21.0004070829110.20598-100000@mail.biostat.washington.edu>

On Fri, 7 Apr 2000 dtrenkler@nts6.oec.uni-osnabrueck.de wrote:

> n_10;p_0.5;jjx_0:n;qbinom(pbinom(jjx,n,p),n,p) #  This one works as
> expected
> 
> n_100;p_0.5;jjx_0:n;qbinom(pbinom(jjx,n,p),n,p)  # This one causes
> severe problems

The problem is in qbinom(1-epsilon,100,0.5) for epsilon between 10^-15 and
10^-17. It appears to go for ever.

> pbinom(jjx,n,p)[89]-1 
[1] -1.110223e-16

An even simpler version is
   qbinom(1-1e-16,2,0.5)

Presumably a check for zero needs some fuzz.

	-thomas

Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] Bug in qbinom? (PR#511)
Thomas Lumley