Language Reference


CORR2COV Function

CORR2COV (R, sd);

The CORR2COV function is part of the IMLMLIB library . The CORR2COV function converts a correlation matrix into a covariance matrix. The first argument, R, is the correlation matrix, and the second argument, sd, is a vector such that sd[j] is the standard deviation of the jth column. An example follows:

R = {1.00 0.25 0.90,
     0.25 1.00 0.50,
     0.90 0.50 1.00};
sd = {1 4 9};             /* std devs of the vars */
S = Corr2Cov(R, sd);      /* convert correlation to covariance */
print S;

Figure 24.81: Covariance Matrix

S
1 1 8.1
1 16 18
8.1 18 81



The function scales the correlation matrix so that $S = DRD$, where $D=\mbox{diag}(\mbox{sd})$ is the diagonal matrix of standard deviations.

To convert from a covariance matrix to a correlation matrix, use the COV2CORR function .