post {deal} | R Documentation |
Learns the parameters and calculates the network score contribution for continuous nodes.
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)
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. |
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.
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. |
Susanne Gammelgaard Bøttcher alma@math.auc.dk,
Claus Dethlefsen dethlef@math.auc.dk.
Further information about deal can be found at:
http://www.math.auc.dk/novo/deal.
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])