| pcor | R Documentation |
Function computing the partial correlation matrix or standardized precision matrix from an input precision matrix.
pcor(P, pc = TRUE)
P |
(Possibly regularized) precision |
pc |
A |
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.
A partial correlation matrix or a standardized precision
matrix.
Carel F.W. Peeters <carel.peeters@wur.nl>, Wessel N. van Wieringen
ridgeP, covML
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.