Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# Re: st: unexpected -rbinomial- behaviour

 From Jeph Herrin To statalist@hsphsun2.harvard.edu Subject Re: st: unexpected -rbinomial- behaviour Date Wed, 15 Sep 2010 12:12:42 -0400

I meant only the endpoints on p; eg

rbinomial(1e+10,0)

should in theory always return 0.

On 9/15/2010 11:25 AM, Steve Samuels wrote:

--

" But it would have been easy enough to trap the endpoints and return
a meaningful (rather than missing) value."

Jeph, I don't think its so simple. What value would you report for
cases like this:

di rbinomial(1e+10,1e-9)    // n x p = 10
.
Steve

On Tue, Sep 14, 2010 at 5:26 PM, Jeph Herrin<stata@spandrel.net>  wrote:

But it would have been easy enough to trap the endpoints and
return a meaningful (rather than missing) value.

On 9/14/2010 4:34 PM, Tirthankar Chakravarty wrote:


Jeph,

The Stata function -rbinomial- is not defined for p=0. From
h rbinomial
rbinomial(n, p)
Domain n:     1 to 1e+11
Domain p:     1e-8 to 1-1e-8
Range:        0 to n

distribution is correct - the domain of the Binomial distribution is p
\in [0,1]. My guess would be that the p=/=0 condition is a limitation
of the simulation algorithm.

T

On Tue, Sep 14, 2010 at 12:54 PM, Jeph Herrin<stata@spandrel.net>    wrote:


Am I wrong to expect rbinomial(n,0) = 0?

. di rbinomial(10,0)
.

I would think that if P(success)= 0, then E(successes)=0.

Jeph

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/





*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/