Covariance to correlation matrix
[corm, sd] = CL_cov2cor(covm)
Computes the correlation matrix and the standard deviation vector from the covariance matrix.
The correlation matrix and standard deviation vector are defined as follows:
- corm(i,i) = 1
- corm(i,j) = covm(i,j) / (sd(i) * sd(j))
- sd(i) = covm(i,i)^(1/2)
Notes:
- The covariance matrix should be symetrical (not checked).
- An error is raised if one diagonal term is not positive.
- If one diagonal term of the covariance matrix is 0, the corresponding diagonal term of the correlation matrix is 1; other terms of the correlation matrix on the same row or column are set to %nan.
Covariance matrix (NxNxK)
Correlation matrix (NxNxK)
Standard deviation vector (NxK)
CNES - DCT/SB