correlation matrix calculation