Franz J. Vesely > Running Averages
 




<



Running averages

Given a sequence $\{y_{n}, \; n=0, \dots \} $ we may define a running average with memory as

$ \langle y \rangle_{n} \, \equiv \frac{\textstyle 1}{\textstyle A} \sum \limits_{i=0}^{K} y_{n-i} \, \exp [-ai] \;\;\;{\rm with} \;\;\; A \equiv \sum \limits_{i=0}^{K} \exp[-ai] \;\;\;\; $ (1)

where $K$ is a large number. Obviously, for $a \rightarrow 0$ the quantity $<y>_{n}$ is identical to an ordinary average over the preceding $K$ values of $y$. On the other hand, if $a$ is large, only $y_{n}$ and a very few preceding values of $y$ contribute to the average.

It is easy to see that
$ \langle y \rangle_{n+1} = \langle y \rangle_{n}\, \exp[-a] + \frac{\textstyle y_{n+1}}{\textstyle A} \;\;\;\; $ (2)


Now we assume that $a$ is small, such that $aK \approx 0$. Then we have

$ A = \sum_{i=0}^{\infty} \exp[-ai] \approx \frac{1}{a} \int_{0}^{\infty}dx \exp[-x] =\frac{1}{a} \;\;\;\; $ (3)


Thus:
Choose $a \leq 0.05$ and write the running average as
$ \langle y \rangle_{n+1} = \langle y \rangle_{n}\, \exp[-a] + a \, y_{n+1} \;\;\;\; $ (4)

Since $a$ is small we may also write
$ \langle y \rangle_{n+1} = \langle y \rangle_{n}\, (1-a) + a \, y_{n+1} \;\;\;\; $ (5)


Specific application:
$y$ may denote the acceptance of the current Monte Carlo step; then $y_{n}$ is either $0$ or $1$. In order to optimize the step size in configuration space we want the running average of the acceptance. Starting with an estimated $<y>_{0}=0.5$ and choosing $a=1/50$ we have either $\langle y \rangle_{1} = 0.98 \langle y \rangle_{0} + 1/50 = 0.51$ or $\langle y \rangle_{1} = 0.98 \langle y \rangle_{0} =0.49$ etcetera.


F. J. Vesely / U of Vienna / 2002