<< CL_colNorm Utilities CL_cov2cor >>

CelestLab >> Utilities > CL_cor2cov

CL_cor2cov

Correlation to covariance matrix

Calling Sequence

cov = CL_cor2cov(cor,sd)

Description

Parameters

cor:

Correlation matrix (NxNxK)

sd:

Standard deviations vector (NxK)

cov:

Covariance matrix (NxNxK)

Authors

See also

Examples

// Random covariance matrix :
N=6; K=2;
mat = rand(N,N,K,key="normal");
cov = mat'*mat;  // symetrical
[cor,sd] = CL_cov2cor(cov);

// Retrieving the covariance :
cov2 = CL_cor2cov(cor,sd) ;
<< CL_colNorm Utilities CL_cov2cor >>