Learn R Programming

ess (version 1.1.2)

fit_graph: Fit a decomposable graphical model

Description

A generic method for structure learning in decomposable graphical models

Usage

fit_graph(
  df,
  type = "fwd",
  q = 0.5,
  trace = FALSE,
  sparse_qic = FALSE,
  thres = 5,
  wrap = TRUE
)

Arguments

df

Character data.frame

type

Character ("fwd", "bwd", "tree" or "tfwd")

q

Penalty term in the stopping criterion where 0 = AIC and 1 = BIC. Anything in between is referred to as qic

trace

Logical indicating whether or not to trace the procedure

sparse_qic

Logical. If nrow(df) is small, the tables tends to be sparse. In these cases the usual penalty term of AIC and BIC is often too restrictive. If sparse_qic is TRUE this penality is computed according to a sparse criteria. The criteria resembles the usual penalty as nrow(df) grows.

thres

A threshold mechanism for choosing between two different ways of calculating the entropy.

wrap

logical specifying if the result of a run with type = "tree" should be converted to a "fwd" object

Value

A gengraph object representing a decomposable graph.

Details

The types are

  • "fwd": forward selection

  • "bwd": backward selection

  • "tree": Chow-Liu tree (first order interactions only)

  • "tfwd": A combination of "tree" and "fwd". This can speed up runtime considerably in high dimensions.

Using adj_lst on an object returned by fit_graph gives the adjacency list corresponding to the graph. Similarly one can use adj_mat to obtain an adjacency matrix. Applying the rip function on an adjacency list returns the cliques and separators of the graph.

References

https://arxiv.org/abs/1301.2267, 10.1109/ictai.2004.100

See Also

adj_lst, adj_mat, as_igraph, gengraph

Examples

Run this code
# NOT RUN {
g <- fit_graph(derma)
print(g)
plot(g)

# Adjacency matrix and adjacency list
adjm <- adj_mat(g)
adjl <- adj_lst(g)

# }

Run the code above in your browser using DataLab