createAbnDag | R Documentation |
Make DAG of class "abnDag"
createAbnDag( dag, data.df = NULL, data.dists = NULL, ...)
dag |
a matrix or a formula specifying a DAG, see ‘Details’. |
data.df |
named dataframe. |
data.dists |
named list giving the distribution for each node in the network. If not provided it will be sample and returned. |
... |
further arguments passed to or from other methods. |
An object of class class(abnDag)
contains a named matrix describing the DAG and possibly additional objects such as the associated distributions of the nodes.
If the dag is specified with a formula, either data.df
or data.dists
is required with the .
quantifier.
If the dag is specified with an unnamed matrix and both data.df
and data.dists
are missing, lower-case letters of the Roman alphabet are used for the node names.
abnDag object as list of dag, data.df, data.dists.
Create a legitimate DAGs
Create a legitimate DAG in the abn format.
An object of class abnDag
containing a named matrix and a named list giving the distribution for each node.
dagFromFormula <- createAbnDag(dag = ~a+b|a,
data.df = data.frame("a"=1, "b"=1),
data.dists = list(a="binomial", b="gaussian"))
dagFromMatrix <- createAbnDag(dag = matrix(c(0,1,0,0), 2, 2),
data.df = data.frame("a"=1, "b"=1),
data.dists = list(a="binomial", b="gaussian"))
plot(dagFromMatrix)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.