# Question about SMC step tuning (older version)

Hi,

I’m trying to understand the tune() procedure of the older SMC implementation (the random walk version). I understand the motivation behind scaling the step size of each chain according to previous acceptance rates, but cannot make sense of the actual scaling formula. Is there a probabilistic motivation, or is this just a heuristic formula? My intuition is that this is the first iteration to solve some implicit equation, but I might be completely wrong.

I don’t expect a detailed explanation, but I would appreciate if somebody points me in the right direction (papers, books, theorems, etc.).

The code in question:
ave_scaling = np.exp(np.log(self.scalings.mean()) + (self.acc_per_chain.mean() - 0.234))
self.scalings = 0.5 * (ave_scaling + np.exp(np.log(self.scalings) + (self.acc_per_chain - 0.234)))

`0.234` is the target acceptance ratio for the random walk Kernel. The value is 0.234 since that’s optimal for Random Walk Metropolis kernel with Gaussian like target .
So these 2 lines of code compute the current target scaling in `ave_scaling` (it’s an approximation), and push the current scaling `self.scalings` towards this target a little bit .

 Roberts GO, Gelman A, Gilks WR. Weak convergence and optimal scaling of random walk Metropolis algorithms. The annals of applied probability. 1997;7(1):110-20.
 Del Moral, Pierre, Arnaud Doucet, and Ajay Jasra. An adaptive sequential Monte Carlo method for approximate Bayesian computation. Statistics and Computing, 22.5(1009-1020), 2012