modelPop {stablespec} | R Documentation |
Random SEM models.
Description
Generating recursive (acyclic) SEM models represented by binary vectors.
Usage
modelPop(nPop = NULL, numVar = NULL, longitudinal = NULL,
consMatrix = NULL)
Arguments
nPop |
number of models to generate or population size. |
numVar |
number of variables. |
longitudinal |
|
consMatrix |
|
Details
This function generates nPop
random SEM models which are
represented by binary vectors; 1 means there is a causal path from,
e.g., variable A
to B
and 0 otherwise. In addition, the generated models
have passed the cyclic test to ensure they are all acyclic. The function
also includes minPop
models which representing models
from each model complexity, i.e., minPop = numVar(numVar-1)/2+1
,
if longitudinal = FALSE
, or
minPop = (numVar(numVar-1)/2+1)+numVar^2
, otherwise.
If nPop <= minPop
then
this function will generate minPop
models.
Value
nPop
or minPop
by m
matrix
,
where m
is the length of the binary vector depending
of the given number of variables
and also whether longitudinal or cross-sectional model.
Author(s)
Ridho Rahmadi r.rahmadi@cs.ru.nl
Examples
#assumming a prior knowledge that variable 1 does not cause variable 2
models <- modelPop(nPop=25, numVar=6,
longitudinal=FALSE, consMatrix = matrix(c(1, 2), 1, 2))
models