# Discrete correlation function (sample cross-covariance)

$$$$C_{AA}(\tau) =\frac{1}{T} \int_{0}^T d\bar{t} A(\bar{t})A(\bar{t}+\tau)$$$$ with $$\tau < T$$. How can I prove that by discritizing the variable $$\bar{t}$$, i.e., $$\bar{t}=i \Delta t$$, with $$T=N \Delta t$$, I obtain

$$$$C_{AA}(j)=\frac{1}{N} \sum_{i=1}^{N-j} A_i A_{i+j} \label{eq1}$$$$

I started by making the following substitution of variables $$t\rightarrow\bar{t}+\tau$$, $$dt=d\bar{t}$$, yielding

$$$$C_{AA}\left(\tau\right) = \frac{1}{T}\int_{0}^{T-\tau}dtA\left(t-\tau\right)A\left(t\right)$$$$

Using now $$t\rightarrow t_{i}=i\Delta t$$ and $$\tau=j\Delta t$$ (with $$T=\Delta t\times N$$) we obtain $$$$C_{AA}\left(j\right) =\frac{1}{\Delta t\times N}\sum_{i=1}^{N-j}\Delta tA_{i\Delta t-j\Delta t}A_{i\Delta t} =\frac{1}{N}\sum_{i=1}^{N-j}A_i A_{i-j}$$$$

However, this formula desagrees slightly from the equation I'm supposed to obtain.

You didn't find the right boundaries of integration, after the sub. the boundaries are $$\tau$$ and $$T+\tau$$.