Learn R Programming

deal (version 1.1-1)

autosearch: Greedy search

Description

From initial network, do local perturbations to increase network score.

Usage

autosearch(initnw,data,prior=jointprior(network(data)),maxiter=50,
           trylist= rep(list(NULL),initnw$n),trace=TRUE,
           timetrace=TRUE,showban=FALSE,saveall=FALSE) 

heuristic(initnw,data,prior=jointprior(network(data)),
          maxiter=100,restart=10,degree=initnw$n,
          trylist= rep(list(NULL),initnw$n),trace=TRUE,
          timetrace=TRUE,saveall=FALSE)

modelstreng(x)
makenw(tb,template)

Arguments

initnw
The initial network from which the search is started.
data
Data frame used for learning the network, see network.
prior
A joint prior, see jointprior.
maxiter
Maximum search steps in the search algorithm.
restart
The number of times to perturb initnw and rerun the search.
degree
Degree of perturbation, see perturb.
trylist
Used internally for reusing learning of nodes, see maketrylist.
trace
If TRUE, plots the accepted networks during search.
timetrace
If TRUE, prints some timing information on the screen.
showban
Passed to plot.network.
saveall
If TRUE, all networks explored in the search is returned (memory consuming). Otherwise, only the best is returned.
x
A network object to be translated into a string.
tb
A table output from autosearch or heuristic. Can be translated into a networkfamily.
template
The initial network being analysed.

Value

  • A list with three elements
  • nwThe network with highest score
  • tabelA table with all tried networks or only the some of the networks if saveall is FALSE. The table can be translated to a networkfamily using makenw.
  • trylistUpdated, learn.

Details

In autosearch, each step, a list of networks is created with either one arrow added, one arrow deleted or one arrow turned (if a cycle is not generated). The network scores of all the proposal networks are calculated and the network with the highest score is chosen for the next step in the search. If no proposed networks has a higher network score than the previous network, the search is terminated. The returned network list contains all tried networks (depending on the value of saveall). heuristics restarts by perturbing initnw degree times and calling autosearch again. The number of restarts is given by the option restart.

References

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

See Also

perturb

Examples

Run this code
data(rats)
fit       <- network(rats)
fit.prior <- jointprior(fit,12)
fit       <- learn(fit,rats,fit.prior)$nw
fit       <- insert(fit,2,1,rats,fit.prior)$nw
fit       <- insert(fit,1,3,rats,fit.prior)$nw
hisc      <- autosearch(fit,rats,fit.prior)$nw

Run the code above in your browser using DataLab