Given a correlation matrix and vector of standard deviations (or vector of means and vector of variation coefficients) returns a covariance matrix.
Usage
mCorrCov(mcorr, sigma = 1, mu = NULL, coefvar = NULL)
Value
mCorrCov gives the covariance matrix for a specified correlation matrix.
Arguments
mcorr
a (non-empty) numeric correlation matrix.
sigma
an optional vector of standard deviations.
mu
an optional vector of means.
coefvar
an optional vector of coefficients of variation.
Details
coefvar = sigma/mu.
If sigma, mu or coefvar are not specified, it´s assumed that default values for standard error's are 1. Length of standard error's is created using number of rows of correlation matrix.
It's necessary to provide sigma or mu and coefvar (both) in order to obtain a desired covariance matrix.
Length of vectors is taken using rep. Pay attention if vectors don't have same length!