Correlation Coefficient (Corrcoef)

6 visualizaciones (últimos 30 días)
Muhammad
Muhammad el 17 de Ag. de 2015
Respondida: the cyclist el 17 de Ag. de 2015
Suppose I have a matrix A=[3,2;2,3]. If I want to find the correlation coefficients of A using Aij/(Aii*Ajj)^1/2, I get the matrix C=[1 0.666;0.666 1](This result is also true, if I use the matlab command cov2corr()). But if I use the matlab command corrcoef(), which is using the same formula to calculate the correlation coefficients, I get the result C=[1 -1;-1 1]. Why is the result different? Kindly guide me.

Respuesta aceptada

the cyclist
the cyclist el 17 de Ag. de 2015
Aij/(Aii*Ajj)^1/2
is not the matrix of correlation coefficients of A.
Cij/(Cii*Cjj)^1/2
is the matrix of correlation coefficients of A, where C is the covariance matrix of A.
This is explained in the Description section of the documentation for corrcoef.

Más respuestas (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by