Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

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

From |
rgates@stata.com (Richard Gates, StataCorp) |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Re: Random draws from a negative binomial distribution |

Date |
Wed, 19 Jun 2013 15:33:56 -0500 |

Dirk Enzmann has tickled a domain limit of Stata's -rnbinomial()- function. He states: > Unfortunately, I am not able to solve the following problem in Stata > which I can solve easily using R: > > As far as I can see Stata does not allow to draw random values from a > negative binomial distribution if "size" (= 1/alpha) is less than 0.1 > (see -h rnbinomial-). I tried to circumvent this problem by (1) creating > random draws from a gamma distribution with shape parameter = size and > scale parameter = (1-prob)/prob, with prob = size/(size+mu), and > subsequently creating random draws from a poisson distribution with > parameter m = the result of the previous random draws from the gamma > distribution. However, if size is small, this does not help either. We have determined that the domain limit for the size parameter, labeled as n in Stata's documentation, is too conservative for a certain region of the parameter space, when n<0.1 but n*(1-p)/p<100 and p^n>1e-4. Dirk's example falls into this region. We will update -rnbinomial()- in Stata 12 and Stata 13 to produce a result in this region. -- Rich rgates@stata.com * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/

- Prev by Date:
**Re: st: use13 : an experimental Stata command to import datasets in new Stata 13 format into older versions of Stata** - Next by Date:
**st: using expressions in margins command** - Previous by thread:
**st: Re: Random draws from a negative binomial distribution** - Next by thread:
**Re: st: Re: Random draws from a negative binomial distribution** - Index(es):