Learn R Programming

CRF (version 0.4-3)

infer.sample: Inference method using sampling

Description

Computing the partition function and marginal probabilities

Usage

infer.sample(crf, sample.method, ...)

Arguments

crf

The CRF

sample.method

The sampling method

...

The parameters for sample.method

Value

This function will return a list with components:

node.bel

Node belief. It is a matrix with crf$n.nodes rows and crf$max.state columns.

edge.bel

Edge belief. It is a list of matrices. The size of list is crf$n.edges and the matrix i has crf$n.states[crf$edges[i,1]] rows and crf$n.states[crf$edges[i,2]] columns.

logZ

The logarithmic value of CRF normalization factor Z.

Details

Approximate inference using sampling (takes a sampling method as input)

Examples

Run this code
# NOT RUN {
library(CRF)
data(Small)
i <- infer.sample(Small$crf, sample.exact, 10000)

# }

Run the code above in your browser using DataLab