Learn R Programming

deal (version 1.1-2)

jointprior: Setup a joint prior distribution for the parameters

Description

Given a network with a prob attribute for each node, the joint prior distribution of the parameters is derived.

Usage

jointprior(nw,N=NA,phiprior="bottcher",timetrace=FALSE,smalldf=NA) 
jointdisc(nw,timetrace=FALSE)
jointcont(nw,timetrace=FALSE)

Arguments

nw
A network. Each node must have a prob attribute to describe the local probability distribution, see network.
N
The size of the imaginary database. If this is too small, errors might occur. If no N is given, the procedure tries to set a value as low as possible.
phiprior
The way of specifying the prior for phi. Either phiprior="bottcher" or phiprior="heckerman" can be used.
timetrace
If TRUE, prints some timing information on the screen.
smalldf
Used for analysing networks with time-varying nodes, see timeslice.

Value

  • A list with the following elements
  • jointalphaThe joint prior for the discrete variables.
  • jointnuJoint prior for nu.
  • jointrhoJoint prior for rho.
  • jointmuJoint prior for mu.
  • jointsigmaSigma matrices (not used in further calculations).
  • jointphiJoint prior for phi.

Details

For the discrete part of the network, the joint distribution is calculated by multiplying together the local probability distributions. Then, jointalpha is determined by multiplying each entry in the joint probability distribution by the size of the imaginary database N. For the mixed part of the network, for each configuration of the discrete variables, the joint (Gaussian) distribution of the continuous variables are constructed and is represented by jointmu (one row for each configuration of the discrete parents) and jointsigma (a list of matrices -- one for each configuration of the discrete parentes). The configurations of the discrete parents are ordered according to findex. The algorithm for constructing the joint distribution of the continuous variables is described in eg. Shachter and Kenley (1989). Then, the joint distribution of the parameters are deduced and expressed by jointalpha for the Dirichlet distribution; jointnu, jointrho, mu and jointphi for the Gaussian-inverse Wishart distribution. For the configuration i of the discrete variables, $$\nu_i=\rho_i=\alpha_i$$ and $$\phi_i = (\nu_i -1)\Sigma_i$$ if phiprior="bottcher" and $$\phi_i = \nu_i(\rho_i -2)\Sigma_i/(\nu_i+1)$$ if phiprior="heckerman".

References

Shachter and Kenley (1989), Gaussian influence diagrams. Management Science 35:527--550. Further information about Deal can be found at: http://www.math.auc.dk/novo/deal.

See Also

network

Examples

Run this code
data(rats)
rats.nw    <- network(rats)
rats.prior <- jointprior(rats.nw,12)

Run the code above in your browser using DataLab