Learn R Programming

deal (version 1.1-1)

heuristic: Heuristic greedy search with random restart

Description

Tries to find the network with highest networkscore.

Usage

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

Arguments

initnw
The initial network wherefrom search is started. It is also this network that is perturbed when restarting.
data
Dataframe used for learning the network, see network.
prior
A joint prior, see jointprior.
maxiter
Max search steps in the search algorithm (see autosearch).
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 tried networks while searching.
timetrace
If TRUE, prints some timing information on the screen.
smalldf
Used for analysing networks with time-varying nodes, see timeslice.

Value

  • A list with two elements
  • nwA networkfamily with all created networks.
  • trylistUpdated.

Details

Calls autosearch on the initnw. Then restarts by perturbing initnw degree times and calling autosearch again. The number of restarts is given by the option restart. If restart=0, the procedure is little more than a call to autosearch.

References

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

See Also

autosearch,perturb

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
  hisc      <- heuristic(fit,rats,fit.prior,restart=5,degree=3)$nw

Run the code above in your browser using DataLab