Learn R Programming

deal (version 1.1-15)

networkfamily: Generates and learns all networks for a set of variables.

Description

Method for generating and learning all networks that are possible for a given set of variables. These may be plotted or printed. Also, functions for sorting according to the network score (see nwfsort) and for making a network family unique (see nwfunique) are available.

Usage

networkfamily(data,nw=network(data), prior=jointprior(nw),
              trylist=rep(list(NULL),nw$n), timetrace=TRUE) 

## S3 method for class 'networkfamily':
print(x,...)
## S3 method for class 'networkfamily':
plot(x,layout=rep(min(1+floor(sqrt(length(nwf))),5),2),
        cexscale=5,arrowlength=0.1,scale=10,sscale=.7*scale,...)

Arguments

nw
The inital network from which the full network family is generated.
data
Data frame used for learning the parameters in each network.
prior
A joint prior. See jointprior.
trylist
Used internally for reusing learning of nodes. See maketrylist.
timetrace
For timing purposes.
x
A network family.
layout
2-dimensional vector of the number of plots in the rows and columns of each plotting page.
cexscale
arrowlength
scale
sscale
...
Other plot parameters passed to plot.network.

Value

  • The function networkfamily returns list with two components
  • nwThe network family.
  • trylistAn updated trylist (see maketrylist).

Details

networkfamily generates and learns all possible networks with the nodes given as in the initial network nw. This is done by successively trying to generate the networks with all possible arrows to/from each node (see addarrows). If there is a ban list present in nw (see network), then this is respected. After generation of all possible networks, a test for cycles (see cycletest) is performed and only networks with directed acyclic graphs are returned and learned.

References

Further information about Deal can be found at: http://www.math.auc.dk/novo/deal.

See Also

network, genlatex, heuristic, nwfsort, nwfunique, elementin, addarrows, cycletest

Examples

Run this code
data(rats)
allrats <- networkfamily(rats)$nw
plot(allrats)
print(allrats)

Run the code above in your browser using DataLab