sim.chordal {NetworkToolbox} | R Documentation |
Simulate Chordal Network
Description
Simulates a chordal network based on number of nodes. Data will also be simulated based on the true network structure
Usage
sim.chordal(
nodes,
inverse = c("cases", "matrix"),
n = NULL,
ordinal = FALSE,
ordLevels = NULL,
idio = NULL,
eps = NULL
)
Arguments
nodes |
Numeric. Number of nodes in the simulated network |
inverse |
Character. Method to produce inverse covariance matrix.
|
n |
Numeric. Number of cases in the simulated dataset |
ordinal |
Boolean.
Should simulated continuous data be converted to ordinal?
Defaults to |
ordLevels |
Numeric.
If |
idio |
Numeric.
DESCRIPTION.
Defaults to |
eps |
Numeric.
DESCRIPTION.
Defaults to |
Value
Returns a list containing:
cliques |
The cliques in the network |
separators |
The separators in the network |
inverse |
Simulated inverse covariance matrix of the network |
data |
Simulated data from sim.correlation in the |
Author(s)
Guido Previde Massara <gprevide@gmail.com>
References
Massara, G. P. & Aste, T. (2019). Learning clique forests. ArXiv.
Examples
#Continuous data
sim.Norm <- sim.chordal(nodes = 20, inverse = "cases", n = 1000)
#Ordinal data
sim.Likert <- sim.chordal(nodes = 20, inverse = "cases", n = 1000, ordinal = TRUE)
#Dichotomous data
sim.Binary <- sim.chordal(nodes = 20, inverse = "cases", n = 1000, ordinal = TRUE, ordLevels = 5)