Beta-binomial random number generator

1.1k Views Asked by At

Could someone help me find a random number generator from a Beta-Binomial distribution in MATLAB, R or SAS?

Thank you!

1

There are 1 best solutions below

1
On BEST ANSWER

According to the Wikipedia, the beta-binomial is a compound distribution, namely, it's like a binomial distribution in which the $p$ parameter is randomly drawn from a beta distribution.

Matlab's Statistic Toolbox has functions to generate binomial random numbers (binornd; see its documentation) and beta-distributed random numbers (betarnd; see its documentation), so it should be pretty straightforward.