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

pcor

Compute partial correlation matrix or standardized precision matrix


Description

Function computing the partial correlation matrix or standardized precision matrix from an input precision matrix.

Usage

pcor(P, pc = TRUE)

Arguments

P

(Possibly regularized) precision matrix.

pc

A logical indicating if the partial correlation matrix should be computed.

Details

The function assumes that the input matrix is a precision matrix. If pc = FALSE the standardized precision matrix, rather than the partial correlation matrix, is given as the output value. The standardized precision matrix is equal to the partial correlation matrix up to the sign of off-diagonal entries.

Value

A partial correlation matrix or a standardized precision 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 partial correlation matrix
pcor(P)

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.