perturb                 package:deal                 R Documentation

_P_e_r_t_u_r_b_s _a _n_e_t_w_o_r_k

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

      nw: an object of class `network', from which arrows are
          added/removed/turned.

    data: a data frame used for learning the network, see `network'.

   prior: a list containing parameter priors, generated by
          `jointprior'.

  degree: an integer, which gives the number of attempts to randomly
          insert/remove/turn an arrow.

 trylist: a list used internally for reusing learning of nodes, see
          `maketrylist'.

  nocalc: a logical. If `TRUE' no learning procedure is called, see eg.
          `simulation'.

timetrace: a logical. If `TRUE', prints some timing information on the
          screen.

_D_e_t_a_i_l_s:

     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.

_V_a_l_u_e:

     A list with two elements, 

      nw: an object of class `network' with the generated network.

 trylist: an updated list used internally for reusing learning of
          nodes, see `maketrylist'.

_A_u_t_h_o_r(_s):

     Susanne Gammelgaard Bttcher alma@math.auc.dk, 
     Claus Dethlefsen dethlef@math.auc.dk.

_R_e_f_e_r_e_n_c_e_s:

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

_E_x_a_m_p_l_e_s:

     set.seed(200)
     data(rats)
     fit       <- network(rats)
     fit.prior <- jointprior(fit)
     fit       <- learn(fit,rats,fit.prior)$nw
     fit.new   <- perturb(fit,rats,fit.prior,degree=10)$nw

     data(ksl)
     ksl.nw    <- network(ksl)
     ksl.rand  <- perturb(ksl.nw,nocalc=TRUE,degree=10)$nw 
     plot(ksl.rand)

