post                  package:deal                  R Documentation

_C_a_l_c_u_l_a_t_i_o_n _o_f _p_a_r_a_m_e_t_e_r _p_o_s_t_e_r_i_o_r_s _f_o_r _c_o_n_t_i_n_u_o_u_s _n_o_d_e

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

     Learns the parameters and calculates the network score
     contribution for continuous nodes.

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

     post   (mu,tau,rho,phi,y,z,timetrace=FALSE) 
     postM  (mu,tau,rho,phi,y,z,timetrace=FALSE) 
     postc  (mu,tau,rho,phi,y,z,timetrace=FALSE) 
     postcc (mu,tau,rho,phi,y,z,timetrace=FALSE) 
     post0  (mu,tau,rho,phi,y,timetrace=FALSE) 
     postc0c(mu,tau,rho,phi,y,timetrace=FALSE) 

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

      mu: a numeric vector of dimension 1 + the number of continuous
          parents. `mu' is a parameter in the local master, see
          `conditional'.

     tau: a numeric matrix, which gives the unscaled precision matrix
          of regression parameters. Symmetric matrix with number of
          columns and rows equal to 1 plus number of continous parents.

     rho: a numeric, which gives a parameter in the distribution of the
          scale parameter.

     phi: a numeric, which gives a parameter in the distribution of the
          scale parameter.

       y: a numeric vector of observations of the current node.

       z: a numeric matrix with a column of ones and columns with the
          observations of the continuous parents.

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

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

     These functions are called by the learning routines (see `learn')
     and is only intended for internal use. In fact, only postc0c and
     postcc are used for speed reasons. The remaining functions are
     included for experimental purposes.

     post0: posterior for continuous node with 0 parents as batch
     learning.

     postc0c: as post0, but using sequential learning in C.

     postc: posterior for continuous node with continuous parents.
     Sequential learning.

     post: as postc, but as batch learning.

     postM: as post, but using the Matrix library.

     postcc: as postc, but using C.

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

     A list with the following components, 

      mu: numeric vector, giving the posterior mean of the regression
          parameters.

     tau: a numeric matrix, which gives the posterior unscaled
          precision matrix of regression parameters.

     rho: a numeric, which gives the posterior of a parameter in the
          distribution of the scale parameter.

     phi: a numeric, which gives the posterior of a parameter in the
          distribution of the scale parameter.

  loglik: a numeric, which gives the log-likelihood contribution to the
          network score for this node.

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

_S_e_e _A_l_s_o:

     `learnnode', `conditional'

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

       data(rats)
       fit       <- network(rats)
       fit.prior <- jointprior(fit,12)
       W1        <- fit$nodes$W1
       W1        <- cond.node(W1,fit,fit.prior)
       W1.post   <-  postc0c(W1$condprior[[1]]$mu,
                            W1$condprior[[1]]$tau,
                            W1$condprior[[1]]$rho,
                            W1$condprior[[1]]$phi,
                            rats[,W1$idx])

