Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

adjacentMat

Transform real matrix into an adjacency matrix


Description

Function that transforms a real matrix into an adjacency matrix. Intended use: Turn sparsified precision matrix into an adjacency matrix for undirected graphical representation.

Usage

adjacentMat(M, diag = FALSE)

Arguments

M

(Possibly sparsified precision) matrix.

diag

A logical indicating if the diagonal elements should be retained.

Value

Function returns an adjacency matrix.

Author(s)

Carel F.W. Peeters <cf.peeters@vumc.nl>, Wessel N. van Wieringen

See Also

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 regularized precision matrix
P <- ridgeP(Cx, lambda = 10, type = "Alt")

## Obtain sparsified partial correlation matrix
PC0 <- sparsify(P, threshold = "localFDR", FDRcut = .8)

## Obtain adjacency matrix
adjacentMat(PC0$sparsePrecision)

rags2ridges

Ridge Estimation of Precision Matrices from High-Dimensional Data

v2.2.4
GPL (>= 2)
Authors
Carel F.W. Peeters [cre, aut], Anders Ellern Bilgrau [aut], Wessel N. van Wieringen [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.