## 3 Methods  
The process control technique identifies a process variable whose value has to be kept around its target and a manipulated variable \(MV\) whose value the controller changes _continually_ to stabilize the process variable. In our case the process variable is the acceptance rate \(a\) and the manipulated variable is the stepsize parameter \(\Delta\). The canonical proportional-integral derivative control equation (PID) is written as follows [13]:  
\[MV(t)=K_{C}\epsilon(t)+\frac{K_{C}}{\tau_{I}}\int_{0}^{t}\epsilon(t)dt+K_{C} \tau_{D}\frac{d\epsilon}{dt}+c_{s} \tag{1}\]  
where \(\epsilon\) is the current deviation of the process variable from its target, \(t\) is the time, and the controller parameters \(K_{C}\), \(\tau_{I}\), \(\tau_{D}\), \(c_{s}\), are the proportional gain, integral time, derivative time, and controller bias, respectively. It has been shown that the dynamic stability of a controlled system can be sensitive to the selection of the derivative time. Therefore, the derivative term is frequently omitted unless empirically shown to be necessary [14]. Furthermore, we implemented the differential form of the control equation:  
\[\frac{d\Delta}{dt}=K_{C}\frac{d\epsilon}{dt}+\frac{K_{C}}{\tau_{I}}\epsilon \tag{2}\]  
This transformation solves the so-called 'integral windup' problem, whereby an historic period of large deviation dominates the integral term [14]. It has the added benefit of eliminating the controller bias as an additional tuning parameter. In general, the controller tuning parameters \(K_{C}\) and \(\tau_{I}\) are chosen to make the controller most sensitive to changes in the process variable without introducing undue fluctuations in it as a result of controller-induced changes. The general method of arriving at such controller tuning parameters \(K_{C}\) and \(\tau_{I}\) is the open-loop protocol of [PERSON] and [PERSON] [15]. Note, however, that the controller behavior is much less sensitive to the precise values of \(K_{C}\) and \(\tau_{I}\) when compared to the sensitivity of the acceptance rate to the stepsize. The process control equation has an implicit time dependence that is not present in MC simulations. To emphasize this, we rewrite the control equation once more in finite difference form in terms of the simulation step number, \(i\):  
\[\Delta_{i+1}=\Delta_{i}+K_{C}(\epsilon_{i}-\epsilon_{i-1})+\frac{K_{C}}{\tau_{ I}}\epsilon_{i} \tag{3}\]  
The calculation of \(\epsilon_{i}\), however, requires some additional thought. Since any single step is either accepted or rejected, the acceptance rate at step \(i\) has to represent an average over a certain stretch of the simulation. To avoid having to either limit the controller action to simulation blocks or to having to store the acceptance information for a large number of steps, we chose to define the (average) acceptance rate \(a_{i}\) at step \(i\) as a weighted average of the previous acceptance rates, with successively smaller weight given to more distant contributions. This can be achieved using  
\[a_{i}=w_{\rm a}*a_{i-1}+(1-w_{\rm a})*M_{i}^{\rm acc/rej}=(1-w_{\rm a})\sum_{ j=1}^{i}M_{j}^{\rm acc/rej}*w_{\rm a}^{i-j}+M_{0}^{\rm acc/rej}*w_{\rm a}^{i} \tag{4}\]  
where \(M_{i}^{\rm acc/rej}\) is unity if the move was accepted at step \(i\) and zero if not. The second equation in Eq. (4) converts the recursion formula into an explicit one. Each application of the recursion introduces higher powers of \(w_{\rm a}\), resulting in the sum over the number of steps involving different powers of \(w_{\rm a}\). In order to include contributions from a long enough stretch of earlier moves, \(w_{\rm a}\) has to be close to one. As a result, this formula would give disproportionate weight to the first contribution unless it is zero (since everything else is multiplied by \((1-w_{\rm a})\)) and thus the deviation from the target acceptance rate would be underestimated for a significant portion of the run.