dgm_sim_from_graph {ess}R Documentation

Simulate observations from a decomposable graphical model

Description

Simulate observations from a decomposable graphical model

Usage

dgm_sim_from_graph(g, lvls, nsim = 1000, cell_rate = 0.5)

Arguments

g

An adjacency list

lvls

Named list with levels of the discrete variables

nsim

Number of simulations

cell_rate

Control discrete cell probabilities

Value

This function returns a matrix of dimension where each row correspond to a simulated observation from a DGM represented by g.

Examples


g = list(
  A = c("B", "X", "Y"),
  B = c("A", "Y"),
  X = c("A", "Y"),
  Y = c("A", "X", "B")
)

lvls <- list(
  A = c("0", "1"),
  B = c("0", "1"),
  X = c("a", "b", "c"),
  Y = c("0", "1", "2")
)

dgm_sim_from_graph(g, lvls, nsim = 10)
#'

[Package ess version 1.1.2 Index]