GGMnetworkStats {rags2ridges} | R Documentation |
Gaussian graphical model network statistics
Description
Function that calculates various network statistics from a sparse precision matrix. The sparse precision matrix is taken to represent the conditional indepence graph of a Gaussian graphical model.
Usage
GGMnetworkStats(sparseP, as.table = FALSE)
Arguments
sparseP |
Sparse precision/partial correlation |
as.table |
A |
Details
The function calculates various network statistics from a sparse matrix. The
input matrix P
is assumed to be a sparse precision or partial
correlation matrix. The sparse matrix is taken to represent a conditional
independence graph. In the Gaussian setting, conditional independence
corresponds to zero entries in the (standardized) precision matrix. Each
node in the graph represents a Gaussian variable, and each undirected edge
represents conditional dependence in the sense of a nonzero corresponding
precision entry.
The function calculates various measures of centrality: node degree, betweenness centrality, closeness centrality, and eigenvalue centrality. It also calculates the number of positive and the number of negative edges for each node. In addition, for each variate the mutual information (with all other variates), the variance, and the partial variance is represented. It is also indicated if the graph is chordal (i.e., triangulated). For more information on network measures, consult, e.g., Newman (2010).
Value
An object of class list
when as.table = FALSE
:
degree |
A |
betweenness |
A |
closeness |
A |
eigenCentrality |
A |
nNeg |
An |
nPos |
An |
chordal |
A |
mutualInfo |
A |
variance |
A |
partialVariance |
A
|
When
as.table = TRUE
the list items above (with the exception of
chordal
) are represented in tabular form as an object of class
matrix
.
Author(s)
Carel F.W. Peeters <carel.peeters@wur.nl>, Wessel N. van Wieringen
References
Newman, M.E.J. (2010). "Networks: an introduction", Oxford University Press.
See Also
ridgeP
, covML
, sparsify
,
Ugraph
Examples
## Obtain some (high-dimensional) data
p = 25
n = 10
set.seed(333)
X = matrix(rnorm(n*p), nrow = n, ncol = p)
colnames(X)[1:25] = letters[1:25]
Cx <- covML(X)
## Obtain sparsified partial correlation matrix
Pridge <- ridgeP(Cx, 10, type = "Alt")
PCsparse <- sparsify(Pridge , threshold = "top")$sparseParCor
## Represent the graph and calculate GGM network statistics
Ugraph(PCsparse, "fancy")
## Not run: GGMnetworkStats(PCsparse)