Learn R Programming

deal (version 1.1-1)

addarrow: Adding/Turning/Removing arrows

Description

Create all networks with exactly one arrow added/turned/removed.

Usage

addarrow   (nw,df,prior,trylist=rep(list(NULL),nw$n),smalldf=NA) 
turnarrow  (nw,df,prior,trylist=rep(list(NULL),nw$n),smalldf=NA) 
removearrow(nw,df,prior,trylist=rep(list(NULL),nw$n),smalldf=NA)

Arguments

nw
The network from which arrows are added/removed/turned.
df
Dataframe used for learning the network, see network.
prior
A joint prior, see jointprior.
trylist
Used internally for reusing learning of nodes, see maketrylist.
smalldf
Used for analysing networks with time-varying nodes, see timeslice.

Value

  • A list with two elements
  • nwA networkfamily with all created networks. All networks have been learned.
  • trylistUpdated.

Details

Given the starting network, a list of networks is created with exactly one arrow added/turned/removed. All possible networks (with the restrictions in insert) is returned in the list of networks. All networks are learned with the data in df. Used by autosearch.

References

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

See Also

heuristic, autosearch, insert, addarrows, network, networkfamily

Examples

Run this code
data(rats)
fit        <- network(rats,specifygraph=FALSE,inspect=FALSE)
fit.prior  <- jointprior(fit,12)
fit        <- learn(fit,rats,fit.prior)$nw
rats.extra <- addarrow(fit,rats,fit.prior)$nw
plot(rats.extra)
rats.extra2<- addarrow(rats.extra[[2]],rats,fit.prior)$nw
plot(rats.extra2)

Run the code above in your browser using DataLab