Learn R Programming

jti (version 1.0.0)

pot_list: A check and extraction of clique potentials from a Markov random field to be used in the junction tree algorithm

Description

A check and extraction of clique potentials from a Markov random field to be used in the junction tree algorithm

Usage

pot_list(x, g)

# S3 method for data.frame pot_list(x, g)

Arguments

x

Character data.frame

g

A decomposable Markov random field as an igraph object.

Examples

Run this code

# Typically one would use the ess package:
# library(ess)
# g  <- ess::fit_graph(derma)
# pl <- pot_list(derma, ess::as_igraph(g))
# pl

# Another example
g <- igraph::sample_gnm(ncol(asia), 12)
while(!igraph::is.chordal(g)$chordal) g <- igraph::sample_gnm(ncol(asia), 12, FALSE)
igraph::V(g)$name <- colnames(asia)
plot(g)
pot_list(asia, g)

Run the code above in your browser using DataLab