Learn R Programming

CRF (version 0.4-3)

sample.tree: Sampling method for tree- and forest-structured graphs

Description

Generating samples from the distribution

Usage

sample.tree(crf, size)

Arguments

crf

The CRF

size

The sample size

Value

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

Details

Exact sampling for tree- and forest-structured graphs with sum-product belief propagation and backward-sampling

Examples

Run this code
# NOT RUN {
library(CRF)
data(Small)
s <- sample.tree(Small$crf, 100)

# }

Run the code above in your browser using DataLab