powered by
Implements Gibbs sampling for an arbitrary bivariate discrete distribution
gibbs_discrete(p, i = 1, iter = 1000)
matrix defining the probabiity distribution
starting row of the matrix
number of cycles of algorithm
matrix of simulated draws from algorithm
# NOT RUN { p <- matrix(c(4, 3, 2, 1, 3, 4, 3, 2, 2, 3, 4, 3, 1, 2, 3, 4) / 40, 4, 4, byrow = TRUE) out <- gibbs_discrete(p, 1, 100) # }
Run the code above in your browser using DataLab