sample.gibbs: Sampling method using single-site Gibbs sampler
Description
Generating samples from the distributionUsage
sample.gibbs(crf, size, burn.in = 1000, start = apply(crf$node.pot, 1,
which.max))
Arguments
burn.in
The number of samples at the beginning that will be discarded
start
An initial configuration
Value
- This function will return a matrix with
size rows and crf$n.nodes columns,
in which each row is a sampled configuration.
Details
Approximate sampling using a single-site Gibbs samplerExamples
Run this codelibrary(CRF)
data(Small)
s <- sample.gibbs(Small$crf, 100)
Run the code above in your browser using DataLab