I am not sure if autocorrelation is the correct term to use, but I would like a fast method that for a numpy array, c, calculates an average in the form of an array a with entries
a[n] = <c[n+k]c[k]>, where k runs over the entire array and the average is taken over all these starting points (maybe my notation is a bit off, but I hope it makes sense).
As an example I would like it to return the following for the array c = [1,2,3,4]
a = [numpy.mean([1x1, 2x2, 3x3, 4x4]), numpy.mean([1x2, 2x3, 3x4]), np.mean([1x3, 2x4]), np.mean([1x4])]
Is there a way to calculate such an average using built-in python functions?