clamp.crf {CRF}R Documentation

Make clamped CRF

Description

Generate clamped CRF by fixing the states of some nodes

Usage

clamp.crf(crf, clamped)

Arguments

crf

The CRF generated by make.crf

clamped

The vector of fixed states of nodes

Details

The function will generate a clamped CRF from a given CRF by fixing the states of some nodes. The vector clamped contains the desired state for each node while zero means the state is not fixed. The node and edge potentials are updated to the conditional potentials based on the clamped vector.

Value

The function will return a new CRF with additional components:

original

The original CRF.

clamped

The vector of fixed states of nodes.

node.id

The vector of the original node ids for nodes in the new CRF.

node.map

The vector of the new node ids for nodes in the original CRF.

edge.id

The vector of the original edge ids for edges in the new CRF.

edge.map

The vector of the new edge ids for edges in the original CRF.

See Also

make.crf, sub.crf, clamp.reset

Examples


library(CRF)
data(Small)
crf <- clamp.crf(Small$crf, c(0, 0, 1, 1))



[Package CRF version 0.4-3 Index]