An auxiliary function that computes all local correlations simultaneously in O(n^2).
LocalCov(A, B, RX, RY)is a properly transformed distance matrix
is the second distance matrix properly transformed
is the column-ranking matrix of A
is the column-ranking matrix of B.
covXY is all local covariances computed iteratively.