extractCorr: Extracting correlations from a covariance matrix

Description Usage Arguments Value Examples

Description

Extracting correlations from a covariance matrix

Usage

1

Arguments

mat

A covariance matrix.

Value

The correlation matrix embedded in mat.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 2 dimensional case
d <- 2
tmp <- matrix(rnorm(d^2), d, d)
mcov <- tcrossprod(tmp, tmp)

# Covariance matrix
mcov

# Correlation matrix
extractCorr(mcov)

mfasiolo/synlik_release documentation built on May 22, 2019, 7:55 p.m.