Learn R Programming

deal (version 1.2-4)

addarrows: Add arrows to/from node

Description

Create networks with all possible arrows to/from nodes with smaller indices added

Usage

addarrows(nw, node, data, prior,trylist=vector("list",nw$n))

Arguments

nw
an object of class network, in which arrows are inserted.
node
an integer, giving the index (column number in data) of the node in focus.
data
a data frame used for learning the network, see network.
prior
a list describing parameter priors, generated by jointprior.
trylist
a list, used internally for reusing learning of nodes, see maketrylist.

Value

  • A list with two elements
  • nwan object of class networkfamily with all created networks. All networks have been learned.
  • trylistan updated list, used internally for reusing learning of nodes, see maketrylist.

Details

Used by networkfamily when constructing all possible networks for a given node configuration. Tries to insert all possible arrows to (from) the node in focus from (to) nodes with smaller indices. Each arrow combination gives rise to extra networks. All networks are learned with the data in df using the prior information in prior.

References

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

See Also

networkfamily,addarrow

Examples

Run this code
data(rats)
rats.nw    <- network(rats)
rats.prior <- jointprior(rats.nw,12)
rats.nwl   <- addarrows(rats.nw,3,rats,rats.prior)$nw
plot(rats.nwl)

Run the code above in your browser using DataLab