I am trying to calculate the autocorrelation time for a 2-D Ising model Monte Carlo simulation. As the autocorrelation function, I am using $$\chi (t) = \frac{1}{t_{max}-t} \sum_{t' = 0}^{t_{max}-t-1} m(t')m(t'+t)-\frac{1}{t_{max}-t}\sum_{t' =0}^{t_{max}-t-1} m(t') \cdot \frac{1}{t_{max}-t} \sum_{t' =0}^{t_{max}-t-1} m(t'+t)$$

with $t_{max}=1000$ and where $m$ is the magnetisation. I am running a $100 \times 100$ Ising model with no external magnetic field, coupling constant $J=1$ (ferromagnetic) and at temperature $T=2.4$. Once I run this on the magnetisation computed after each Monte Carlo sweep of the lattice (after equilibration), I plotted the negative log of the autocorrelation against time (Monte Carlo sweeps) to linearise it and use the reciprocal of the slope as my autocorrelation time $\tau$. However, the plot only looks linear initially and then breaks into a strange periodicity (see image): Autocorrelation against time

What is going on here? How do I fix this to get an accurate value for the autocorrelation time?


This looks like the expected behaviour, assuming that the plotted function is $-\ln |C(t)|$ where $C(t)$ is the correlation function of the magnetization per spin and $|\cdots|$ is the absolute value. For a relatively short run of 1000 sweeps, at a temperature above the critical point, $C(t)$ will decrease towards zero, and then fluctuate about zero due to statistical noise. I believe that this noise is what you are seeing, looking more dramatic because of the logarithmic scale.

If you simply plotted $C(t)$ vs $t$ and fitted a curve of the form $\exp(-t/\tau)$ to determine the correlation time $\tau$, the noise would look less worrying. Also, to improve the statistics, and hence the signal to noise ratio, your run should be much longer. This becomes more important near the critical point. You'll need to investigate this empirically: obviously, as a guide, the run length should be many times the estimated value of $\tau$.

You may find it easier if you begin the investigation with a somewhat smaller system, say $20\times20$, to get a feel for the run lengths needed to estimate $C(t)$ and hence $\tau$ with acceptable values of noise on $C(t)$.


Just for information, there is another definition of the correlation time which can be used, especially when the functional form of $C(t)$ is not well approximated by an exponential. First, make sure that $C(t)$ is normalized so that $C(0)=1$. Then $$ \tau = \int_0^{\infty} dt \, C(t) $$ where you do the integral numerically, and the upper limit can be chosen large enough that $C(t)$ has decayed essentially to zero. This doesn't avoid the problem of noise, your runs still need to be long enough to reduce the noise as much as possible, but it does avoid the need to do a fit. For exponential decay, the answer will be the same as the fitting method.

  • $\begingroup$ Also, why is it that I must lengthen my run and not shorten it? The plot seems to show expected behaviour for small values of t and breaks into noise later. My intuition tells me that a longer run would simply increase this period of noise. Why am I wrong? $\endgroup$ – Varun Dec 5 '18 at 6:26
  • $\begingroup$ The function $C(t)$ depends on the time difference between the two measurements of magnetization. A longer run will enable you to average over more time origins $t'$ in your formula. This will improve the signal to noise ratio, and should reduce the amplitude of the oscillations around zero. The behaviour at short $t$, which indeed looks OK, should not be significantly changed. $\endgroup$ – user197851 Dec 5 '18 at 9:30
  • $\begingroup$ Incidentally, if your run is of length $t_{\text{max}}$, you don't need to compute $C(t)$ all the way out to $t=t_{\text{max}}$. If you have an estimate of $\tau$ already, $C(t)$ will be insignificant for $t\gg\tau$. $\endgroup$ – user197851 Dec 5 '18 at 9:39
  • $\begingroup$ That makes things a lot easier, thank you so much! $\endgroup$ – Varun Dec 5 '18 at 21:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.