cov2corr
Convert covariance to standard deviation and correlation coefficient
Description
[
converts covariance to standard deviations and correlation coefficients.ExpSigma
,ExpCorrC
] = cov2corr(ExpCovariance
)
Examples
Convert Covariance to Standard Deviations and Correlation Coefficients
This example shows how to convert a covariance matrix to standard deviations and correlation coefficients.
ExpCovariance = [0.25 -0.5 -0.5 4.0]; [ExpSigma, ExpCorrC] = cov2corr(ExpCovariance)
ExpSigma = 1×2
0.5000 2.0000
ExpCorrC = 2×2
1.0000 -0.5000
-0.5000 1.0000
Input Arguments
Output Arguments
ExpSigma
— Standard deviation of each process
vector
Standard deviation of each process, returned as an
1
-by-n
vector.
The entries of ExpCorrC
range from 1
(completely correlated) to -1
(completely
anti-correlated). A value of 0
in the
(i,j) entry indicates that the
i'th and j'th processes are
uncorrelated.
ExpSigma(i) = sqrt( ExpCovariance(i,i) ); ExpCorrC(i,j) = ExpCovariance(i,j)/( ExpSigma(i)*ExpSigma(j) );
Data Types: double
ExpCorrC
— Correlation coefficients
matrix
Correlation coefficients, returned as an
n
-by-n
matrix.
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)