Skip to contents

Generate a covariance matrix.

Usage

cov_matrix(S, OMEGA)

Arguments

S

A vector of standard deviations

OMEGA

A correlation matrix

Value

an \(N \times N\) covariance matrix, where N = length(S).

Examples

sds <- c(1, 2)
corrs <- matrix(c(1, .5, .5, 1), nrow = 2)
cov_matrix(sds, corrs)
#>      [,1] [,2]
#> [1,]    1    1
#> [2,]    1    4