| dgm_sim_from_graph | R Documentation |
Simulate observations from a decomposable graphical model
dgm_sim_from_graph(g, lvls, nsim = 1000, cell_rate = 0.5)
g |
An adjacency list |
lvls |
Named list with levels of the discrete variables |
nsim |
Number of simulations |
cell_rate |
Control discrete cell probabilities |
This function returns a matrix of dimension where each row correspond
to a simulated observation from a DGM represented by g.
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)
#'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.