Learn R Programming

mrfse (version 0.4.2)

mrfse.sample: Generate a independent sample of a Markov random field

Description

Generate a independent sample of a Markov random field according to the probilities of the sampler.

Usage

mrfse.sample(sampler, n)

Value

A matrix whose number of columns is the number of nodes. Each line is a single independent sample of Markov random field given by the probabilites of sampler.

Arguments

sampler

A sampler created by mrfse.create.sampler function

n

Size of sample

Author

Rodrigo Carvalho

Examples

Run this code
library(mrfse)
adj = matrix(c(0, 1, 0, 0, 0, 0, 0, 1, 0), byrow=TRUE, ncol=3)
sampler = mrfse.create.sampler(adj, 3)
mrfse.sample(sampler, 3000)

Run the code above in your browser using DataLab