Learn R Programming

deal (version 1.1-2)

autosearch: Autosearch

Description

Greedy search for a network with high networkscore

Usage

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

Arguments

initnw
The initial network from which the search is started.
data
Dataframe used for learning the network, see network.
prior
A joint prior, see jointprior.
maxiter
Maximum search steps in the search algorithm.
trylist
Used internally for reusing learning of nodes, see maketrylist.
trace
If TRUE, plots the networks during search.
timetrace
If TRUE, prints some timing information on the screen.
smalldf
Used for analysing networks with time-varying nodes, see timeslice.
showban
Passed to plot.network.
saveall
If TRUE, all networks explored in the search is returned (memory consuming). Otherwise only the best is returned.

Value

  • A list with two elements
  • nwA networkfamily with all (or the best) tried networks. Duplicate networks have not been removed (use nwfunique).
  • trylistUpdated.

Details

In each step, a list of networks is created with either one extra arrow, one less arrow or with 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 contain all tried networks (depending on the value of saveall).

References

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

See Also

heuristic

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
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
hisc      <- nwfsort(hisc)

Run the code above in your browser using DataLab