Learn R Programming

ProbBayes (version 1.1)

gibbs_discrete: Gibbs sampling of a bivariate discrete distribution

Description

Implements Gibbs sampling for an arbitrary bivariate discrete distribution

Usage

gibbs_discrete(p, i = 1, iter = 1000)

Arguments

p

matrix defining the probabiity distribution

i

starting row of the matrix

iter

number of cycles of algorithm

Value

matrix of simulated draws from algorithm

Examples

Run this code
# 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