to_covmatrix: Convert a Correlation Matrix to Covariance Matrix

View source: R/to_covmatrix.R

to_covmatrixR Documentation

Convert a Correlation Matrix to Covariance Matrix

Description

Given a correlation matrix and correct number of standard deviations, tocovmatrix() converts the correlation matrix to a covariance matrix. If you only have a vector correlation, you can convert it to a correlation matrix first, using the function to_cormatrix().

Usage

to_covmatrix(cor_matrix, sd_vec)

Arguments

cor_matrix

A a symmetric correlation matrix.

sd_vec

A vector of the variables' standard deviations.

Examples

mycormat <- to_cormatrix(cor_vec = c(0.3, 0.5, 0.6), n_dim=3)
to_covmatrix(mycormat, sd_vec = c(0.95, 0.98, 1.1))

Boklauth/AUTTT documentation built on Dec. 9, 2022, 7:37 a.m.