structMatrix: Finds graphical structure from a covariance matrix

View source: R/invVar.R

structMatrixR Documentation

Finds graphical structure from a covariance matrix

Description

This function finds an undirected graphical representation of a multivariate normal distribution with the given covariance matrix, by associating edges with non-zero entries. Graphical structure is given as an adjacency matrix.

Usage

structMatrix(X, threshold = 0.1)

Arguments

X

A variance matrix.

threshold

A numeric value giving the threshold for a value to be considered “non-zero”.

Details

For a multivariate normal model, zero entries in the inverse covariance matrix correspond to conditional independence statements true in the multivariate normal distribution (Whitaker, 1990; Dempster, 1972). Thus, every non-zero entry in the inverse correlation matrix corresponds to an edge in an undirected graphical model for the structure.

The threshold parameter is used to determine how close to zero a value must be to be considered zero. This allows for both estimation error and numerical precision when inverting the covariance matrix.

Value

An adjacency matrix of the same size and shape as X. In this matrix result[i,j] is TRUE if and only if Node i and Node j are neighbors in the graph.

Note

Models of this kind are known as “Covariance Selection Models” and were first studied by Dempster (1972).

Author(s)

Russell Almond

References

Dempster, A.P. (1972) Covariance Selection. Biometrics, 28, 157–175.

Whittaker, J. (1990). Graphical Models in Applied Multivariate Statistics. Wiley.

See Also

scaleMatrix, mcSearch, buildParentList

Examples

data(MathGrades)

MG.struct <- structMatrix(MathGrades$var)


ralmond/CPTtools documentation built on Dec. 27, 2024, 7:15 a.m.