mrfse_create_sampler: Create a sampler for Markov random field.

mrfse.create.samplerR Documentation

Create a sampler for Markov random field.

Description

Create a sampler for Markov random field from a DAG

Usage

mrfse.create.sampler(dag_adj, A)

Arguments

dag_adj

An direct acyclic graph adjacency matrix

A

Size of alphabet

Value

A list filled with the following components:

neigh: A list of neighborhood. For each i, neigh[[i]] is a markovian neighborhood of vertex i

probs: A list of probabilities. For each i, probs[[i]] is matrix of probabilities of vertex i given your markovian neighborhood. Those probabilites will be used to generate a sample.

moral_adj: moral graph of adj_dag

topol_sort: topological sort of adj_dag

num_nodes: number of nodes de adj_dag

A: alphabet size

Author(s)

Rodrigo Carvalho

Examples

library(mrfse)
adj = matrix(c(0, 1, 0, 0, 0, 0, 0, 1, 0), byrow=TRUE, ncol=3)
mrfse.create.sampler(adj, 3)

mrfse documentation built on Nov. 16, 2022, 5:06 p.m.