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?