
Fast calculation of linear correlations
Peeyush Khare
Hello,
I have to calculate linear correlation coefficients for a 2D matrix with large dimensions (e.g. 30000 rows and 2000 or more columns). This can take a while to run and I have a couple such matrices . I am wondering if there is a faster way to run correlations in IGOR. Please advise.
Best,
Peeyush
I don't fully understand your problem; when you say "correlation coefficients" of a matrix do you mean covariance?
If so,
DisplayHelpTopic "MatrixOP"
and look under Functions for covariance(w).
August 14, 2024 at 09:28 am - Permalink
Hi s.r.chinn,
Yep, I mean Pearson correlation coefficients to check how well the individual columns linearly correlate. Thanks for the tips!
Best,
Peeyush
August 15, 2024 at 02:25 pm - Permalink
I have a form of Pearson correlation in my Image Profile tools to align rows or columns. I use Correlate/AUTO for that, which seems to be reasonably fast. I also implemented fitting to determine substep offsets. Here is my code from that tool. in1 and in2 at the two columns to compare (I loop over all columns to compare against the first):
August 15, 2024 at 08:23 pm - Permalink