Description Usage Arguments Details Value Author(s) Examples
Repairing a SEM model that is cyclic.
1 | repairCyclicModel(stringModel = NULL, numVar = NULL, longitudinal = NULL)
|
stringModel |
binary vector with length
|
numVar |
number of variables. |
longitudinal |
|
The main idea of this function is to seek cyclic(s) with
any possible length from a given model, and then to cut the cyclic,
so as to make the model acyclic. Moreover, this function is used in
stableSpec
to ensure no cyclic model in the computation.
a binary vector with the same length of input, representing a repaired model (acyclic).
Ridho Rahmadi r.rahmadi@cs.ru.nl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | num_vars <- 6
longi_a <- FALSE
longi_b <- TRUE
# Assume that the generated model below is cyclic
# a cross-sectional model
model_a <- round(runif(num_vars * num_vars))
# a longitudinal model
model_b <- c(round(runif(num_vars * num_vars)),
round(runif(num_vars * (num_vars-1))))
repaired_model_a <- repairCyclicModel(stringModel=model_a, numVar=num_vars,
longitudinal=longi_a)
repaired_model_b <- repairCyclicModel(stringModel=model_b, numVar=num_vars,
longitudinal=longi_b)
repaired_model_a
repaired_model_b
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.