sample.chain {CRF} | R Documentation |
Generating samples from the distribution
sample.chain(crf, size)
crf |
The CRF |
size |
The sample size |
Exact sampling for chain-structured graphs with the forward-filter backward-sample algorithm
This function will return a matrix with size
rows and crf$n.nodes
columns,
in which each row is a sampled configuration.
library(CRF)
data(Small)
s <- sample.chain(Small$crf, 100)