[R] Strange means of numbers drawn from rpois

ben@zoo.ufl.edu ben at zoo.ufl.edu
Wed Nov 8 17:06:43 CET 2000


  Happens on linux RH 6.0 R-1.1.1 as well, and furthermore a brief poke
into src/nmath/rpois.c shows that it's using a different method for
lambda>=10, so there's reason to believe there's a fairly localized (but
scary!!!) bug.  I can't really understand/find/fix it, without a lot more
work and looking up the original reference (the rejection method given in
_Numerical Recipes_ is quite different) ...

 I'd say the following is a pretty clear indication of a bug ...

> mean(rpois(100000,9.99))
[1] 10.00021
> mean(rpois(100000,10.0))
[1] 9.50424


-- 
318 Carr Hall                                bolker at zoo.ufl.edu
Zoology Department, University of Florida    http://www.zoo.ufl.edu/bolker
Box 118525                                   (ph)  352-392-5697
Gainesville, FL 32611-8525                   (fax) 352-392-3704

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list