I'm using the Metropolis algorithm for 2D up to 5D for the Ising Model and I want to compute the spin-spin correlation function.
$$c(r)=<s_is_r>−〈s_i〉〈s_r 〉$$ but I'm not sure how to estimate
$$<s_is_r> = \frac{1}{N}\sum s_is_r$$
What can I do for $s_is_r$ numerically?