| Financial Toolbox | Search  Help Desk |
| cov2corr | Examples See Also |
Convert covariance to standard deviation and correlation coefficient.
Syntax
[ExpSigma, ExpCorrC] = cov2corr(ExpCovariance)
Arguments
ExpCovariance |
N- by-N covariance matrix, e.g., from cov or ewstats. N is the number of random processes. |
Description
cov2corr
converts covariance to standard deviations and correlation coefficients.
ExpSigma is a 1-by-N vector with the standard deviation of each process.
ExpCorrC is an N-by-N matrix of correlation coefficients.
ExpSigma(i) = sqrt(ExpCovariance(i,i)) ExpCorrC(i,j) = ExpCovariance(i,j)/(ExpSigma(i)*ExpSigma(j))
Example
ExpCovariance = [0.25 -0.5
-0.5 4.0];
[ExpSigma, ExpCorrC] = cov2corr(ExpCovariance)
Expected results:
ExpSigma =
0.5 2.0
ExpCorrC =
1.0 -0.5
-0.5 1.0
See Also
corr2cov, corrcoef, cov, ewstats, std