sample.conditional function

Conditional sampling method

Conditional sampling method

Generating samples from the distribution

sample.conditional(crf, size, clamped, sample.method, ...)

Arguments

  • crf: The CRF
  • size: The sample size
  • clamped: The vector of fixed values for clamped nodes, 0 for unfixed nodes
  • sample.method: The sampling method to solve the clamped CRF
  • ...: The parameters for sample.method

Returns

This function will return a matrix with size rows and crf$n.nodes columns, in which each row is a sampled configuration.

Details

Conditional sampling (takes another sampling method as input)

Examples

library(CRF) data(Small) s <- sample.conditional(Small$crf, 100, c(0,1,0,0), sample.exact)
  • Maintainer: Ling-Yun Wu
  • License: GPL (>= 2)
  • Last published: 2019-12-01