Learn R Programming

CRF (version 0.4-3)

sample.conditional: Conditional sampling method

Description

Generating samples from the distribution

Usage

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

Value

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

Run this code
# NOT RUN {
library(CRF)
data(Small)
s <- sample.conditional(Small$crf, 100, c(0,1,0,0), sample.exact)

# }

Run the code above in your browser using DataLab