[Rd] bug in rbinom? (PR#448)

Prof Brian Ripley Prof Brian Ripley <ripley@stats.ox.ac.uk>
Thu, 17 Feb 2000 12:48:21 +0000 (GMT)


> From: dtrenkler@nts6.oec.uni-osnabrueck.de
> Date: Thu, 17 Feb 2000 13:08:53 +0100 (MET)
> 

Thanks for the report: now fixed. rbinom was only checking if p was
unchanged, and not setting up correctly if n changed too.

> In version 0.99.0 for Windows NT I get the following:
> 
> > .Random.seed
> [1]     0 21012  4461 28299
> > rbinom(10,10,.3)
>  [1] 4 5 5 1 5 2 4 2 6 2
> > rbinom(10,9,.3)
>  [1] 0 0 0 0 0 0 0 0 0 0
> > rbinom(10,10,.3)
>  [1] 3 3 2 2 3 1 3 3 3 2
> > rbinom(10,11,.3)
>  [1] 0 0 0 0 0 0 0 0 0 0
> 
> 
> I tried similar inputs in version 0.65.1:
> 
> > .Random.seed
> [1]     0 16049    70 30225
> > rbinom(10,10,.3) 
>  [1] 3 5 3 1 1 3 3 2 5 1
> > rbinom(10,11,.3) 
>  [1] 1 3 2 3 4 3 4 2 1 5
> > rbinom(10,100,.3) 
>  [1] 20  0  0  0  0  0  0  0  0  0
> > rbinom(10,100,.3)
>  [1] 0 0 0 0 0 0 0 0 0 0
> 


-- 
Brian D. Ripley,                  ripley@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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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