Learn R Programming

deal (version 1.1-1)

post: Calculation of parameter posteriors for continuous node

Description

Learning parameters and calculating network score contribution

Usage

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)

Arguments

mu
The prior mean of the regression parameters. Dimension 1 + number of continuous parents.
tau
The prior parameter tau. Symmetric matrix with number of columns and rows equal to 1 plus number of continous parents.
rho
The prior parameter rho. An integer.
phi
The prior parameter phi. An integer.
y
Data vector of observations of the current node.
z
Matrix with a column of ones and columns with the observations of the continuous parents.
timetrace
For timing purposes.

Value

  • Updated parameters and log-network score contribution of current node.

Details

These functions are called by the learning routines (learn, learnnode). 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.

References

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

See Also

learnnode

Examples

Run this code
data(rats)
  fit       <- network(rats,specifygraph=FALSE,inspect=FALSE)
  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])

Run the code above in your browser using DataLab