kjetil.kjernsmo@astro.uio.no
2000-Nov-08 16:23 UTC
[Rd] Re: [R] Strange means of numbers drawn from rpois (PR#730)
On 8 Nov 2000, Peter Dalgaard BSA wrote:>Done...Great!>(This kind of behaviour has been observed on various platforms and >various compilers, sometimes getting stuck around 15.15 and sometimes >around 14.5. Others report no problems. Very strange. I've seen one >case where it apparently shifted from one regime to the other.)Yes, it does that here too.... The following is a verbatim excerpt from my session:> sapply(1:15, function(n) mean(rpois(1000000, n)))[1] 0.999031 2.000444 3.002296 3.997795 4.998880 5.995267 7.001894 [8] 7.999983 9.000267 9.513537 10.507142 11.502634 12.498944 13.498615 [15] 14.502410> rpoisfunction (n, lambda) .Internal(rpois(n, lambda))> version_ platform alphaev6-dec-osf4.0e arch alphaev6 os osf4.0e system alphaev6, osf4.0e status major 1 minor 1.1 year 2000 month August day 15 language R> plot(sapply(1:15, function(n) mean(rpois(1000000, n))), t='l') > sapply(1:15, function(n) mean(rpois(1000000, n)))[1] 0.997961 1.999509 3.000748 3.999825 5.002983 6.004424 6.998825 [8] 7.997999 8.998341 9.766942 10.781751 11.817181 12.856154 13.900369 [15] 14.999378 And from looking at 11, it is apparent that something happened... Also, by inspecting the graph produced by plot, it may seem as if it happens in the plot call... But this is really hard to see, but you might want to have a look. Best, Kjetil -- Kjetil Kjernsmo Graduate astronomy-student Problems worthy of attack University of Oslo, Norway Prove their worth by hitting back E-mail: kjetikj@astro.uio.no - Piet Hein Homepage <URL:http://www.astro.uio.no/~kjetikj/> Webmaster@skepsis.no -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Peter Dalgaard BSA
2000-Nov-08 16:51 UTC
[Rd] Re: [R] Strange means of numbers drawn from rpois (PR#730)
kjetil.kjernsmo@astro.uio.no writes:> On 8 Nov 2000, Peter Dalgaard BSA wrote: > > >Done... > > Great!However, be careful not to reply to the version of the mail without a PR# if there's a Cc: to R-bugs. Now there are *two* reports in the repository... I've poked around a bit and it seems that the problem has to do with the code that tries to save time by reusing calculations if mu =muprev:> range(sapply(1:2000, function(n) mean(rpois(10000, c(15,15+1e-8)))))[1] 14.8692 15.1200 -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._