cov2pcor calculates the partial correlation matrix from an (empirical) covariance matrix while conc2pcor calculates the partial correlation matrix from a concentration matrix (inverse covariance matrix).

cov2pcor(V)

conc2pcor(K)

Arguments

V

Covariance matrix

K

Concentration matrix

Value

A matrix with the same dimension as V.

Author

Søren Højsgaard, sorenh@math.aau.dk

Examples


data(math)
S <- cov.wt(math)$cov
cov2pcor(S)
#>             me         ve        al          an         st
#> me  1.00000000 0.32928814 0.2304083 -0.00160892 0.02458581
#> ve  0.32928814 1.00000000 0.2808196  0.07810254 0.02024438
#> al  0.23040832 0.28081958 1.0000000  0.43185649 0.35682506
#> an -0.00160892 0.07810254 0.4318565  1.00000000 0.25280353
#> st  0.02458581 0.02024438 0.3568251  0.25280353 1.00000000