Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Two point correlation function in MKL?

csnatarajan
Beginner
617 Views

Hello all,

I was wondering if there is an implementation of a two-point correlation function for 3D arrays in MKL (Either direct or fourier transform based) ?

Appreciate any suggestion, Thanks,

C.S.N

0 Kudos
5 Replies
Victor_Gladkikh
New Contributor I
617 Views

Hi,

MKL provides a set of routines intended to perform linear convolution and correlation transformations for single and double precision real and complex data. Our current implementation provides:

Fourier algorithms for one-dimensional single and double precision real and complex data

Fourier algorithms for multi-dimensional single and double precision real and complex data

Direct algorithms for one-dimensional single and double precision real and complex data

Direct algorithms for multi-dimensional single and double precision real and complex data

For more details please see MKL manual point 10 (Statistical function).

Please let us know if you still have questions.

Victor

0 Kudos
csnatarajan
Beginner
617 Views

Hi Victor,

thanks for the quick response. After going through manual I am still a bit confused, rather naively! It looks like it can compute the two-point corr. func if I stream the same array for u and v (pg 2971 sec 10) and loop for all "r <= sizeof(u)/2", but I am not entirely sure how it works! Is there a complete example for a 3d array that you can point me to for the multidimensional correlation function?

Cheers and thanks again,

C.S.N

0 Kudos
Victor_Gladkikh
New Contributor I
617 Views

Hi

Examples for using 2D and higher dimensional correlation functions with MKL will be added in one of future releases (I cannot provide the exact data). Meanwhile, the 1D example provided in the MKL Reference Manual could be a start for what you want to accomplish. And I would appreciate if you give more details of the computation you need, because Im afraid I dont fully understand your statement, especially loop over all r part of it. . Could you provide full description of function which you want to calculate?

Victor

0 Kudos
csnatarajan
Beginner
617 Views

Hi Victor,

My apologies for the late response, somehow missed your reply!

What I was trying to say is this : Correlation coefficient is scale independent, by this I mean we have one number to describe the (dis)similarity between two datasets, same is the case with autocorrelation!

What I am trying to calculate is the similarity at different length scales for a given data set! For example, if we have a (boolean) scalar field over a 2-D grid, say N*N, what is the correlation of, say, zeros at different length scales? This would involve (for a correlation distance r), if the medium is statistically isotropic, calculating the number of times the scalar field has the same phase value at ((i,j), (i+r,j)) and ((i,j),(i, j+r)) for all (i,j).

Thus in some sense this is a naive search, count and average! Since a simple implimentation, by comparing, is O(N^2), the fastest implimentation I could think of was a kd-tree (we have very large data sets), However, after some lit. search last week, it seems there are faster tree based algos!

I wast wondering if MKL/VSL has implimented such a statistic before I sat down and got my hands dirty!

Thanks and Cheers,

C.S.N

0 Kudos
Victor_Gladkikh
New Contributor I
617 Views

Hi,

As I can understand you need sum of value of function W(d,s) for all (d,s) where distance between (0,0) and (d,s) is r, where W(d,s) is linear correlation that is for 2D data set W(d,s) = sum(u(i,j)v(i+d,j+s)) for all (i,j)

In this case you can compute correlation function (using MKL) and compute what you need based on linear correlation function.But MKL provide only direct and Fourier algorithm.

Victor

0 Kudos
Reply