random_parentslist {stagedtrees} | R Documentation |
Generate a random parentslist
object (DAG)
Description
generate a random DAG coded as
parentslist
object.
Usage
random_parentslist(n, k = 2, maxp = n)
Arguments
n |
number of variables. |
k |
maximum number of levels for each variable. |
maxp |
maximum cardinality of parents sets. |
Details
For each variable a subset of random cardinality
(maximum maxp
) of the preceding
variables is randomly selected as parents set.
The possible levels of each variables are randomly selected
in 2,...,k
.
Value
a parentslist
object.
Examples
random_parentslist(5, 3, 2)
## we can generate the associated staged tree
pl <- random_parentslist(4, 2, 2)
plot(as_sevt(pl), main = as.character(pl))
[Package stagedtrees version 2.3.0 Index]