Description Usage Arguments Value Author(s) Examples
View source: R/gibbs_discrete.R
Implements Gibbs sampling for an arbitrary bivariate discrete distribution
1 | gibbs_discrete(p, i = 1, iter = 1000)
|
p |
matrix defining the probabiity distribution |
i |
starting row of the matrix |
iter |
number of cycles of algorithm |
matrix of simulated draws from algorithm
Jim Albert
1 2 3 4 5 | 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)
|
Loading required package: LearnBayes
Loading required package: ggplot2
Loading required package: gridExtra
Loading required package: shiny
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.