Solved – Correlation between two 2D arrays

brownian motioncorrelationcross correlationpearson-r

I could not find anywhere, how to calculate correlation between two arrays. Say I do have Array1 with X and Y values and also Array2 with X and Y values. I tried to do some calculation and inserting two same arrays and expecting the correlation to be 1, but the result was something like -0.16…

I would be glad for any suggestion. Btw. I've found this Correlation coefficient between two arrays of 2D points? but still didnt find anything what could help me.

Best Answer

An array with 2 dimensions is a matrix. Since your arrays have 2 dimensions, you are looking to find the correlation between these two matrices.

Here is a question with answers in R: "Correlation between matrices in R"

Here is a question with answers in MATLAB: "Matlab correlation between two matrices"