powered by
Implements Gibbs sampling of the beta-binomial distribution
gibbs_betabin(n, a, b, p = 0.5, iter = 1000)
binomial sample size
first beta shape parameter
second beta shape parameter
starting value of proportion in algorithm
number of iterations
matrix of simulated draws from the algorithm
# NOT RUN { sp <- gibbs_betabin(20, 5, 5, 100) # }
Run the code above in your browser using DataLab