Note

You are not reading the most up to date version of Gammapy documentation.
Access the latest stable version v1.3 or the list of Gammapy releases.

cov_to_corr

gammapy.stats.cov_to_corr(covariance)[source]

Compute correlation matrix from covariance matrix.

The correlation matrix c is related to the covariance matrix σ by:

cij=σijσiiσjj
Parameters:

covariance : ndarray

Covariance matrix

Returns:

correlation : ndarray

Correlation matrix