autosearch {deal} | R Documentation |
From initial network, does local perturbations to increase network score.
autosearch(initnw,data,prior=jointprior(network(data)),maxiter=50, trylist= vector("list",initnw$n),trace=TRUE, timetrace=TRUE,showban=FALSE,saveall=FALSE,removecycles=FALSE) heuristic(initnw,data,prior=jointprior(network(data)), maxiter=100,restart=10,degree=initnw$n, trylist= vector("list",initnw$n),trace=TRUE, timetrace=TRUE,saveall=FALSE,removecycles=FALSE) modelstreng(x) makenw(tb,template) as.network(x,template)
initnw |
an object of class network , from which the
search is started. |
data |
a data frame used for learning the network, see
network . |
prior |
a list containing parameter priors, generated by
jointprior . |
maxiter |
an integer, which gives the maximum number of steps in the search algorithm. |
restart |
an integer, which gives the number of times to perturb
initnw and rerun the
search. |
degree |
an integer, which gives the degree of perturbation, see
perturb . |
trylist |
a list used internally for reusing learning of nodes,
see maketrylist . |
trace |
a logical. If TRUE , plots the accepted networks
during search. |
timetrace |
a logical. If TRUE , prints some timing
information on the screen. |
showban |
a logical passed to plot.network . If
FALSE , the banned arrows are not shown in the plots (if
trace is TRUE ). |
saveall |
obsolete. |
removecycles |
a logical. If TRUE , all networks explored in the
search is returned, except for networks containing a cycle. If FALSE , all networks are returned, including
cyclic networks. |
x |
an object of class network to be translated
into a string. |
tb |
a table output from autosearch or
heuristic in the list property tabel . Can be
translated into a networkfamily . |
template |
an object of class network with the same
nodes as the networks described in the table tb . |
In autosearch
, a list of networks is in each step
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 network has a higher network
score than the previous network, the search is terminated. The
network with the highest network score is returned, along with a list
containing all tried networks (depending on the value of removecycles
).
heuristics
restarts by perturbing initnw
degree
times and calling
autosearch
again. The number
of restarts is given by the option restart
.
A list with three elements,
nw |
an object of class network , which gives the
network with the highest score. |
tabel |
a table with all tried
networks. If removecycles is FALSE , the networks may contain
cycles. The table contains two columns: model with a
string representation of the model and score with the
corresponding log network score. The table can be translated to a
networkfamily using makenw . |
trylist |
an updated list used internally for reusing learning
of nodes, see maketrylist . |
Susanne Gammelgaard Bøttcher alma@math.auc.dk,
Claus Dethlefsen dethlef@math.auc.dk.
Further information about deal can be found at:
http://www.math.auc.dk/novo/deal.
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,trace=FALSE) hisc <- autosearch(fit,rats,fit.prior,trace=FALSE,removecycles=TRUE) # slower plot(hisc$nw) hisc2 <- heuristic(fit,rats,fit.prior,restart=10,trace=FALSE) plot(hisc2$nw) print(modelstreng(hisc2$nw)) plot(makenw(hisc2$tabel,fit))