In the Monte Carlo (MC) optimization we start from an initial guess for the energies
(=1,,10,loop) and do a random walk in the space of parameters in order to minimize the error function defined in Eq. 5.2. All MC techniques require the introduction of a fictive temperature that controls how the space of parameters is explored. This method is just a standard Simulated Annealing optimization algorithm  adapted to our particular problem that speeds up considerably the time to find the minimum as compared to standard Steepest Descent algorithms. The MC optimization is composed of the following steps:
- Initial guess. The error function is initially evaluated with the UO energies. We start from the unified values to enforce the system to explore the basin of attraction of these values.
- Quench algorithm. The system is allowed to evolve until the total error reaches a minimum. This stage involves several steps. First, a random variation of the NNBP energies is proposed. The set of new energies is accepted if the new calculated value of the error function decreases and the process is repeated. If the error function increases, the set of energies is rejected and a new energy values are proposed. When the acceptance ratio of the proposed steps is lower than 3%, the system is considered to have newly reached a minimum. This method is essentially a steepest descent algorithm with the advantage that the free energy derivatives need not be calculated (see Fig. 5.8a).
- Heat-quench algorithm. Once the system has found the first minimum, we start another MC search to explore other solutions in the vicinity of the minimum. Here we have to define a fictive temperature to accept or reject the proposed NNBP energies. Each new proposal is accepted or rejected using a Metropolis algorithm. According to the Metropolis algorithm, a move is always accepted if
(where is the change in the error after the proposal). If
, a random number from a standard uniform distribution
is generated and the move accepted if
and rejected if
During the heat-quench algorithm, the system is heated up to a large fictive temperature until the error is 50% higher than the error of the first minimum. Afterwards, the system is quenched until the acceptance ratio of steps is lower than 3%. This procedure is repeated many times. The multiple solutions found after the initial minimum allow us to estimate the error in the NNBP energies (see Fig. 5.8b). The possible values for the NNBP energies are Gaussian distributed in a region of width approximately equal to 0.05 kcalmol (see Fig. 5.8c).
The error landscape defined by Eq. 5.2 is not rough and there is no necessity to use a MC algorithm. Nevertheless, we find that the MC optimization with the heat-quench scheme is computationally more efficient (i.e., faster) than other optimization algorithms and other fictive temperature schemes (see Figs. 5.7 and 5.9). The analysis revealed that the optimization algorithm is robust and leads to the same solution when the initial conditions are modified, as will be shown in the next section. Different molecules and different sequences converge to energy values that are clustered around the same value. Appendix L describes in further details the errors in the MC optimization.
Monte Carlo optimization. (a) Quench algorithm. Evolution of the error function of different molecules during the quenching minimization. The main figure shows a log-log plot where the mean quadratic error decreases down close to 0.01 pN. The inset figure shows a linear plot of the same evolution. (b) Heat-quench algorithm. Evolution of the error during the heat-quench algorithm. (c) Histograms of solutions for one representative molecule obtained using the heat-quench algorithm. Each color represents one NNBP parameter and its Gaussian fit profile. Optimal solutions correspond to the most probable values of the distribution.
Temperature schedules. Upper panel shows the evolution of the error for a linear schedule (red curve) and a heat-quench algorithm (blue curve). The inset shows a zoomed region of the heat-quench algorithm. Note the rapid error decrease of the heat-quench algorithm. The lower panel shows the evolution of the temperature for each schedule.