Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

createDag

Create a legitimate DAGs


Description

Create a legitimate DAG in the abn format.

Usage

createAbnDag( dag, data.df = NULL, data.dists = NULL, ...)

Arguments

dag

a matrix or a formula specifying a DAG, see ‘Details’.

data.df

named dataframe or named vector.

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.

Details

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.

Value

An object of class abnDag containing a named matrix and a named list giving the distribution for each node.

Examples

createAbnDag( ~a+b|a, data.df=c("a"=1, "b"=1))

plot( createAbnDag( matrix( c(0,1,0,0),2,2)))

abn

Modelling Multivariate Data with Additive Bayesian Networks

v2.5-0
GPL (>= 2)
Authors
Gilles Kratzer [aut, cre] (<https://orcid.org/0000-0002-5929-8935>), Fraser Iain Lewis [aut] (<https://orcid.org/0000-0003-4580-2712>), Reinhard Furrer [ctb] (<https://orcid.org/0000-0002-6319-2332>), Marta Pittavino [ctb] (<https://orcid.org/0000-0002-1232-1034>)
Initial release
2021-04-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.