pot_list {jti}R Documentation

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 class 'data.frame'
pot_list(x, g)

Arguments

x

Character data.frame

g

A decomposable Markov random field as an igraph object.

Examples


# 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)


[Package jti version 0.8.4 Index]