for \(x=0,1,2,...\), \(\alpha>0\), and \(\beta>0\), where \(n\) is the sample size, \(\alpha\) and \(\beta\) are the shape parameters and \(B(\alpha,\beta)\) is the complete beta function.
Usage
draw.beta.binomial(nrep,alpha,beta,n)
Arguments
nrep
Number of data points to generate.
alpha
First shape parameter.
beta
Second shape parameter.
n
Number of trials.
Value
A list of length five containing generated data, the theoretical mean, the empirical mean, the theoretical variance, and the empirical variance with names y, theo.mean, emp.mean, theo.var, and emp.var, respectively.
# NOT RUN {draw.beta.binomial(nrep=100000,alpha=0.2,beta=0.25,n=10)
draw.beta.binomial(nrep=100000,alpha=2,beta=3,n=10)
draw.beta.binomial(nrep=100000,alpha=600,beta=400,n=20)
# }