Bookmark and Share

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: unexpected -rbinomial- behaviour


From   Jeph Herrin <stata@spandrel.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: unexpected -rbinomial- behaviour
Date   Tue, 14 Sep 2010 17:26:56 -0400

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

Your probabilistic statement about the degenerate Binomial
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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index