lmoffatt / macro_dr

GNU General Public License v3.0
1 stars 1 forks source link

optimal acceptance rate for themo jumps #218

Closed lmoffatt closed 1 month ago

lmoffatt commented 2 months ago

which is the optimal number of temperatures?

If the acceptance rate is too low it takes more tries to go from one temperature to the other, if the acceptance rate is too high, that means that we need to cross more temperatures to get to the same temperature difference.

To find out the optimal acceptance rate we need to compare two situations.

1) beta0, beta1, beta2

2) beta0, beta2

in situation 1 we have twice as many temperature steps, and therefore half as many walkers per temperature. Then situation 1 is better if

4 \cdot \Pr(0 \to 1) < \Pr(0 \to 1) \cdot \Pr(1 \to 2)

now lets assume that the acceptance is in the pure exponential regime:

\Pr(0 \to 2) \approx \exp( -(\beta_2- \beta_0)\cdot  (L_2- L_0))
\Pr(0 \to 2) \approx \exp( -(\beta_1- \beta_0)\cdot  (L_1- L_10)) \cdot \exp( -(\beta_2- \beta_1)\cdot  (L_2- L_1)) 

If we equilibrate acceptances then

 (\beta_1- \beta_0)\cdot  (L_1- L_10) =  (\beta_2- \beta_1)\cdot  (L_2- L_1)

lets assume that

\Delta L_1 = \alpha \Delta L_2  \qquad  \Delta \beta_1 = \gamma  \beta_2

then

\alpha \cdot \gamma \cdot \Delta L2 \cdot \Delta \beta_2 =  (1-\alpha) \cdot (1-\gamma) \cdot \Delta L2 \cdot \Delta \beta_2    

then

\gamma = (1-\alpha)

now, it is easy to prove that

(\beta_2- \beta_0) \cdot (L_2-L_0) >= 4 \cdot (\beta_1- \beta_0) \cdot (L_1-L_0)   
\exp (-(\beta_2- \beta_0) \cdot (L_2-L_0)) <= \exp( -4 \cdot (\beta_1- \beta_0) \cdot (L_1-L_0)  ) 

Then situation (double the temperatures) is surely better for acceptances equal or lower to 0.25

lmoffatt commented 1 month ago

251