mrfse.sample {mrfse}R Documentation

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)

Arguments

sampler

A sampler created by mrfse.create.sampler function

n

Size of sample

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.

Author(s)

Rodrigo Carvalho

Examples

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)

[Package mrfse version 0.4.1 Index]