0

I am evaluating the correlation coefficient between columns of matrices - of potentially large sizes, and multiple times.

To be more precise, I am calculating the correlation of a column in matrix A with all columns in matrix B - therefore an element C_ij in matrix C is the correlation between column i of matrix A and column j of matrix B.

Is it possible to vectorize this entire operation? So far I have found https://waterprogramming.wordpress.com/2014/06/13/numpy-vectorized-correlation-coefficient/ which helps, as it lets me vectorize the calculation slightly - but not as much as it potentially could be optimized (as I evaluate a column with all columns at once, instead of all columns with all columns at once).

Is there a way to optimize this further?

prkist
  • 431
  • 5
  • 13
  • 1
    Looked relevant - [Computing the correlation coefficient between two multi-dimensional arrays](http://stackoverflow.com/questions/30143417/computing-the-correlation-coefficient-between-two-multi-dimensional-arrays), with the rows and columns reversed. – Divakar Apr 20 '16 at 15:06
  • Excellent, thank you very much! – prkist Apr 20 '16 at 15:11

0 Answers0