View source: R/random_parentslist.R
random_parentslist | R Documentation |
parentslist
object (DAG)generate a random DAG coded as
parentslist
object.
random_parentslist(n, k = 2, maxp = n)
n |
number of variables. |
k |
maximum number of levels for each variable. |
maxp |
maximum cardinality of parents sets. |
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
.
a parentslist
object.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.