node                  package:deal                  R Documentation

_R_e_p_r_e_s_e_n_t_a_t_i_o_n _o_f _n_o_d_e_s

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

     An important part of a `network' is the list of nodes. The nodes
     summarize the local properties of a node, given the parents of the
     node.

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

     node (idx,parents,type="discrete",name=paste(idx),
                      levels=2,levelnames=paste(1:levels),position=c(0,0)) 
     print (x,filename=NA,condposterior=TRUE,condprior=TRUE,...) 
     plot (x,cexscale=10,notext=FALSE,...)
     prob.node (x,nw,df)
     nodes(nw)
     "nodes<-"(nw,value)

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

       x: an object of class `node'.

 parents: a numeric vector with indices of the parents of the node.

     idx: an integer, which gives the index of the node (the column
          number of the corresponding data frame).

    type: a string, which gives the type of the node. Either
          `"discrete"' (for factors) or `"continuous"' (for numeric).

    name: a string, which gives the name used when plotting and
          printing. Defaults to the column  name in the data frame.

  levels: an integer. If `type' is `"discrete"', this is the number of
          levels for the discrete variable.

levelnames: if `type' is `"discrete"', this is a vector of strings
          (same length as `levels') with the names of the levels. If
          `type' is `"continuous"', the argument is ignored.

position: a numeric vector with coordinates where the node should
          appear in the  plot. Usually set by `network' and
          `drawnetwork'.

      df: a data frame, where the columns define the variables. A
          continuous variable should have type `numeric' and discrete
          varibles should have type `factor'.

      nw: an object of class `network'.

   value: a list of elements of class `node'.

filename: a string or `NA'. If not `NA', output is printed to a file.

condprior: a logical. If `TRUE', the conditional prior is printed, see
          `conditional'.

condposterior: a logical. If `TRUE', the conditional posterior is
          printed, see `learn'.

cexscale: a numeric. Scale parameter to set the size of the nodes.

  notext: a logical. If `TRUE', no text is displayed in the nodes on
          the plot.

     ...: additional plot arguments.

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

     The operations on a node are typically done when operating on a
     `network', so these functions are not to be called directly. 

     When a network is created with `network', the nodes in the
     nodelist are created using the `node' procedure.

     Local probability distributions are added as the property `prob'
     to each node using `prob.node'. If the node is continuous, this is
     a numeric vector with  the conditional variance and the
     conditional regression coefficients arising from a regression on
     the continuous parents, using data. If the node has discrete
     parents, `prob' is a matrix with a row for each configuration of
     the discrete parents. If the node is discrete, `prob' is a
     multiway array which gives the conditional probability
     distribution for each configuration of the discrete parents. The
     generated `prob' can be replaced to match the prior information
     available.

     `nodes' gives the list of nodes of a network.

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

     An object of class `node', which is a list with the following
     elements (properties), 

     idx: an integer. A unique index for this node. It MUST correspond
          to the column index of the variable in the data frame.

    name: a string. The printed name of the node.

    type: a string. Either `"continuous"' or `"discrete"'.

  levels: an integer. If the node is of type `"discrete"', this integer
          is the  number of levels of the node.

levelnames: if `type' is `"discrete"', this is a vector of strings
          (same length as `levels') with the names of the levels. If
          `type' is `"continuous"', the node does not have this
          property.

 parents: a vector of indices of the parents to this node. It is best
          to manage this vector using the `insert' function.

    prob: a numeric vector, matrix or multiway array, giving the
          initial probability distribution. If the node is discrete,
          `prob' is a multiway array. If the node is continuous, `prob'
          is a matrix with one row for each configuration of the
          discrete parents, reducing to a vector if the node has no
          discrete parents.

condprior: a list, generated by `conditional' giving the parameter
          priors deduced from `jointprior' using the master prior
          procedure (see `localmaster'). 

condposterior: a list, which gives the parameter posteriors obtained
          from `learnnode'.

  loglik: a numeric giving the log likelihood contribution for this
          node, calculated in `learnnode'.

 simprob: a numeric vector, matrix or multiway array similar to `prob',
          added by `makesimprob' and used by `simulation'.

_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>.

