Mathematica 9 has a new CorrelationFunction. Sadly the joy does not last long, as I can't get it to work with vectors. I would like to make a velocity correlation function. That is, given a list of n vectors I would like to calculate:

For example, this is almost instantaneous:
testdata = RandomVariate[BinormalDistribution[{10, 20}, 0.4], {10000}];
AbsoluteTiming[
x = CorrelationFunction[testdata[[All, 1]], {0, 1000}];
y = CorrelationFunction[testdata[[All, 2]], {0, 1000}];
]
ListPlot[{x, y}, PlotRange -> {0, 1}]
(the test data here is not the best as it is by definition uncorrelated)
Here I would like the autocorrelation of 2D vectors evenly spaced in time. But this does not work:
r = CorrelationFunction[testdata, {0, 100}];
How can I make an autocorrelation for vectors? Or do I have to go the manual way?
ClearAll[AbsoluteAutocorrelationT, AutocorrelationT]
AbsoluteAutocorrelationT[l_, 0] := Total[(#.#) & /@ l];
AbsoluteAutocorrelationT[l_, n_] :=
Total@Table[l[[i]].l[[i + n]], {i, Length[l] - n}];
AutocorrelationT[l_, range_] := Block[{t0, ti},
t0 = AbsoluteAutocorrelationT[l, 0];
ti = AbsoluteAutocorrelationT[l, #] & /@ (Range @@ range);
(ti/t0)];
AbsoluteTiming[r = AutocorrelationT[testdata, {1, 1000}];]
Which is 200 times slower. I know I can compile this (but than I have to worry about overflows in the sum, etc.)



{{t1, x1}, ..., {tn, xn}}. If I misunderstood your question and you want the n-dimensional autocorrelation for values sampled on a regular grid, rather than that for 1-d but unevenly spaced data, you can get it yourself usingListCorrelate. – Oleksandr R. Feb 25 at 17:59absCorr[lists_, n_] := Length@lists AbsoluteCorrelationFunction[#, n] & /@ Transpose@lists // Total– Rojo Feb 25 at 19:56