gibbs_betabin function

Gibbs sampling of the beta-binomial distribution

Gibbs sampling of the beta-binomial distribution

Implements Gibbs sampling of the beta-binomial distribution

gibbs_betabin(n, a, b, p = 0.5, iter = 1000)

Arguments

  • n: binomial sample size
  • a: first beta shape parameter
  • b: second beta shape parameter
  • p: starting value of proportion in algorithm
  • iter: number of iterations

Returns

matrix of simulated draws from the algorithm

Author(s)

Jim Albert

Examples

sp <- gibbs_betabin(20, 5, 5, 100)