Conditional sampling method
Generating samples from the distribution
sample.conditional(crf, size, clamped, sample.method, ...)
crf
: The CRFsize
: The sample sizeclamped
: The vector of fixed values for clamped nodes, 0 for unfixed nodessample.method
: The sampling method to solve the clamped CRF...
: The parameters for sample.method
This function will return a matrix with size
rows and crf$n.nodes
columns, in which each row is a sampled configuration.
Conditional sampling (takes another sampling method as input)
library(CRF) data(Small) s <- sample.conditional(Small$crf, 100, c(0,1,0,0), sample.exact)