cor2cov: Convert from standard deviation and correlation matrix to...

View source: R/linpk.R

cor2covR Documentation

Convert from standard deviation and correlation matrix to covariance matrix.

Description

Convert from standard deviation and correlation matrix to covariance matrix.

Usage

cor2cov(cor, sd)

Arguments

cor

A correlation matrix. If sd is missing, the diagonal entries are taken to be the standard deviations, otherwise they are ignored.

sd

A vector of standard deviations (optional).

Value

A covariance matrix.

Examples

cor2cov(matrix(c(1, 0.5, 0.5, 1), 2, 2), 0.1)
cor2cov(LTmat(c(0.39, 0.67, 0.28), .names=c("CL", "VC")))

benjaminrich/linpk documentation built on April 18, 2024, 2:13 a.m.