gibbs_discrete {ProbBayes}R Documentation

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

Author(s)

Jim Albert

Examples

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)

[Package ProbBayes version 1.1 Index]