pyCthon
pyCthon

Reputation: 12341

Matlab computing correlation coefficents given a correlation matrix

I know there's a nice way to compute both the correlation matrix and the correlation coefficient using corr. However I'm already given a correlation matrix without the correlation coefficient. I don't want to recompute anything as far as covariances or correlation matrices.

What is the most efficient way to get the correlation coefficient?

Upvotes: 0

Views: 80

Answers (2)

P-Gn
P-Gn

Reputation: 24581

Is this a mathematical question rather than a Matlab question? If you already have the correlation matrix between two variables, the correlation coefficient is m_12/sqrt(m_11*m_22), where m_ij is the matrix element at row i and column j.

Upvotes: 1

lakshmen
lakshmen

Reputation: 29064

Use corrcoef(X). Have a look at corrcoef

Upvotes: 0

Related Questions