Learn R Programming

deal (version 1.1-15)

perturb: Perturbs a network

Description

Randomly insert/delete/turn arrows to obtain another network.

Usage

perturb(nw,data,prior,degree=nw$n,trylist=rep(list(NULL),nw$n),
        nocalc=FALSE,timetrace=TRUE)

Arguments

nw
The network from which arrows are added/removed/turned.
data
Data frame used for learning the network.
prior
A joint prior. See jointprior().
degree
The number of attempts to randomly insert/remove/turn an arrow.
trylist
Used internally for reusing learning of nodes.
nocalc
If TRUE, the network score is not updated
timetrace
Timing information available.

Value

  • A list with two elements,
  • nwA network family with all created networks.
  • trylistUpdated.

Details

Given the initial network, a new network is constructed by randomly choosing an action: remove, turn, add. After the action is chosen, we choose randomly among all possibilities of that action. If there are no possibilites, the unchanged network is returned.

References

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

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.new   <- perturb(fit,rats,fit.prior,degree=10)$nw

Run the code above in your browser using DataLab