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

pruneMatrix

Prune square matrix to those variables having nonzero entries


Description

Convenience function that prunes a square matrix to those variables (features) having nonzero row (column) entries (i.e., to features implied in graphical connections).

Usage

pruneMatrix(M)

Arguments

M

(Possibly sparsified) square matrix.

Value

A pruned matrix.

Author(s)

Carel F.W. Peeters <cf.peeters@vumc.nl>

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]

## Obtain regularized precision under optimal penalty
OPT <- optPenalty.LOOCV(X, lambdaMin = .5, lambdaMax = 30, step = 100)

## Determine support regularized standardized precision under optimal penalty
PC0 <- sparsify(symm(OPT$optPrec), threshold = "localFDR")$sparseParCor

## Prune sparsified partial correlation matrix
PC0P <- pruneMatrix(PC0)

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.