[R] Strange means of numbers drawn from rpois

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Wed Nov 8 16:32:58 CET 2000


Alan Arnholt <arnholt at math.appstate.edu> writes:

> Kjetil,
> 
> I get "expected" results using a windows machine version 
> 1.1.1.
> 

I'm not at all happy with this:

Solaris : 
> range(sapply(1:2000, function(n) mean(rpois(10000, 15.0))))
[1] 15.0524 15.3403

Linux (1.1.1):
> range(sapply(1:2000, function(n) mean(rpois(10000, 15.0))))
[1] 15.0595 15.3663

Linux (1.2.0 pre):
> range(sapply(1:2000, function(n) mean(rpois(10000, 15.0))))
[1] 14.3791 14.6555

The procedure seems to be getting stuck generating means just above
15.0 or around 14.5. The 1.1.1 run started off like this:

> sapply(1:15, function(n) mean(rpois(10000, n+0.)))
 [1]  1.0006  2.0136  3.0239  3.9795  5.0292  5.9888  7.0101  7.9058  8.9772
[10]  9.5557 10.5125 11.4522 12.5265 13.4270 14.5742
> sapply(1:15, function(n) mean(rpois(10000, n+0.)))
 [1]  1.0094  1.9796  2.9633  3.9877  5.0483  6.0335  6.9966  7.9727  9.0225
[10]  9.4975 10.5473 11.4476 12.4487 13.5871 14.4855
> sapply(1:15, function(n) mean(rpois(10000, n+0.)))
 [1]  1.0121  1.9939  3.0023  3.9635  4.9544  6.0144  6.9735  7.9900  9.0084
[10]  9.5156 10.5689 11.5872 12.5461 13.5204 14.5182
> sapply(1:15, function(n) mean(rpois(10000, n+0.)))
 [1]  0.9879  2.0095  2.9689  4.0110  4.9970  6.0013  7.0118  7.9585  8.9915
[10]  9.4942 10.9539 12.1061 13.1538 14.1939 15.2268
> sapply(1:15, function(n) mean(rpois(10000, n+0.)))
 [1]  1.0092  2.0295  2.9964  4.0196  4.9673  6.0266  7.0023  8.0051  8.9427
[10]  9.9276 11.0051 12.1399 13.2233 14.1429 15.2280

whereafter every single attmept to call mean(rpois(10000, 15)) in
various guises gave values above 15.
-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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