fitConGraph {ggm}R Documentation

Fitting of Gaussian concentration graph models

Description

Fits a concentration graph (a covariance selection model) to a sample covariance matrix, assuming a Gaussian model.

Usage

fitConGraph(amat, S, n, pri = FALSE, alg=2, tol = 1e-06)

Arguments

amat a square Boolean matrix representing the adjacency matrix of the DAG
S a symmetric positive definite matrix, the sample covariance matrix
n an postive integer, the sample size
pri a logical value. If TRUE a the value of the deviance at each iteration is printed.
alg and integer specifying the algorithm: if alg=1 then the covariance matrix is updated, if alg=2 the concentration matrix is updated.
tol a small positive number indicating the tolerance used in convergence tests.

Details

Algorithms for fitting Gaussian graphical models specified by undirected graphs are discussed in Speed & Kiiveri (1986). This function is based on the iterative proportional fitting algorithm described on p. 184 of Whittaker (1990).

Value

Shat the fitted covariance matrix.
dev the `deviance' of the model.
df the degrees of freedom.
it the iterations.

Author(s)

Giovanni M. Marchetti

References

Cox, D. R. & Wermuth, N. (1996). Multivariate dependencies. London: Chapman & Hall.

Speed, T.P. & Kiiveri, H (1986). Gaussian Markov distributions over finite graphs. Annals of Statistics, 14, 138–150.

Whittaker, J. (1990). Graphical models in applied multivariate statistics. Chichester: Wiley.

See Also

UG, fitDag, cliques, marks

Examples

## A model for the sample covariance matrix of the
## mathematics marks (Whittaker, 1990)
data(marks)
S <- cov(marks) * 87 / 88
## A butterfly concentration graph
fitConGraph(UG(~ mechanics*vectors*algebra + algebra*analysis*statistics), S , n = 88)

[Package ggm version 1.0.2 Index]