# Autocorrelation and autocorrelation time

I have Metropolis-Markov algorithm and I need to determine integrated autocorrelation time. In order to do that i have to find autocorrelation and I don't quite get what to do.

For example, after equilibration I did N sweeps, took measurements at each one and I obtained N results $$O_i,i=1...N$$, for some observable.

Definition of autocorrelation says

$$A_O (t)=\frac{\langle O_i O_{i+t}\rangle-\langle O_i\rangle^2}{\langle O_i^2\rangle-\langle O_i\rangle^2}$$

What are those averages over? Should I average over $$i$$?

Related Set Theory, Logic, Probability, Statistics News on Phys.org
One more question. I have obtained N sweeps, so basically time goes from $$i=0$$ to $$i=N$$. When I want to obtain autocorrelation for lag $$t=N-1$$ i just have

$$A_O(t=N-1)=\frac{O_1 O_N-\langle O\rangle^2}{\sigma_O^2}$$

so I don't have any averaging for term $$O_1 O_N$$. Is that right or duration of my data should always be longer than maximum lag I'm calculating autocorrelation for?

EnumaElish