How the maximum step size in Monte Carlo simulations should be adjusted

Similar documents
Multiple time step Monte Carlo

THE DETAILED BALANCE ENERGY-SCALED DISPLACEMENT MONTE CARLO ALGORITHM

Multicanonical parallel tempering

Advanced sampling. fluids of strongly orientation-dependent interactions (e.g., dipoles, hydrogen bonds)

Monte Carlo simulation calculation of the critical coupling constant for two-dimensional continuum 4 theory

ICCP Project 2 - Advanced Monte Carlo Methods Choose one of the three options below

A simple technique to estimate partition functions and equilibrium constants from Monte Carlo simulations

Physics 115/242 Monte Carlo simulations in Statistical Physics

CE 530 Molecular Simulation

Monte Carlo (MC) Simulation Methods. Elisa Fadda

Monte Carlo Simulation of the Ising Model. Abstract

Nosé-Hoover chain method for nonequilibrium molecular dynamics simulation

UB association bias algorithm applied to the simulation of hydrogen fluoride

Minicourse on: Markov Chain Monte Carlo: Simulation Techniques in Statistics

Their Statistical Analvsis. With Web-Based Fortran Code. Berg

Improved Holt Method for Irregular Time Series

Kinetic Monte Carlo. Heiko Rieger. Theoretical Physics Saarland University Saarbrücken, Germany

Coarse-Grained Models!

Markov Processes. Stochastic process. Markov process

Appendix A.1 Derivation of Nesterov s Accelerated Gradient as a Momentum Method

Potts And XY, Together At Last

The Effect of Discontinuous Wave Functions. on Optimizations of VMC Calculations. of Quantum Systems

Let s start by reviewing what we learned last time. Here is the basic line of reasoning for Einstein Solids

A New Method to Determine First-Order Transition Points from Finite-Size Data

Hanoi 7/11/2018. Ngo Van Thanh, Institute of Physics, Hanoi, Vietnam.

Markov Chain Monte Carlo Simulations and Their Statistical Analysis An Overview

Monte Caro simulations

Chapter 5 - Systems under pressure 62

Melting line of the Lennard-Jones system, infinite size, and full potential

Coulomb Balance. Figure 1: The Coulomb Balance apparatus.

1 Correlation between an independent variable and the error

Monte Carlo Methods in Statistical Mechanics

Phase transitions of quadrupolar fluids

COLLATZ CONJECTURE: IS IT FALSE?

Metropolis/Variational Monte Carlo. Microscopic Theories of Nuclear Structure, Dynamics and Electroweak Currents June 12-30, 2017, ECT*, Trento, Italy

Chapter 12 PAWL-Forced Simulated Tempering

Available online at ScienceDirect. Physics Procedia 57 (2014 ) 82 86

Computer Simulation of Peptide Adsorption

Physics 115/242 Comparison of methods for integrating the simple harmonic oscillator.

Monte Carlo. Lecture 15 4/9/18. Harvard SEAS AP 275 Atomistic Modeling of Materials Boris Kozinsky

Quantum Monte Carlo Methods in Statistical Mechanics

GENERATION OF COLORED NOISE

SIMU L TED ATED ANNEA L NG ING

André Schleife Department of Materials Science and Engineering

arxiv: v1 [cond-mat.stat-mech] 7 Mar 2019

Law of large numbers for Markov chains

Random Walks A&T and F&S 3.1.2

An introduction to Bayesian reasoning in particle physics

Exploring the energy landscape

3.320 Lecture 18 (4/12/05)

Abstract In mean-field theory, i.e. infinite-range interactions, the transition between metastable and unstable states of a thermodynamic system is sh

CS 781 Lecture 9 March 10, 2011 Topics: Local Search and Optimization Metropolis Algorithm Greedy Optimization Hopfield Networks Max Cut Problem Nash

Systematic Coarse-Graining and Concurrent Multiresolution Simulation of Molecular Liquids

Thermodynamic behaviour of mixtures containing CO 2. A molecular simulation study

Department of Chemical Engineering University of California, Santa Barbara Spring Exercise 3. Due: Thursday, 5/3/12

arxiv: v1 [physics.soc-ph] 9 Jan 2010

On the Calculation of the Chemical Potential. Using the Particle Deletion Scheme

Behaviour of simple population models under ecological processes

A Study of the Thermal Properties of a One. Dimensional Lennard-Jones System

Chem 7040 Statistical Thermodynamics Problem Set #6 - Computational Due 1 Oct at beginning of class

1. Introductory Examples

A Search and Jump Algorithm for Markov Chain Monte Carlo Sampling. Christopher Jennison. Adriana Ibrahim. Seminar at University of Kuwait

Modeling the Free Energy Landscape for Janus Particle Self-Assembly in the Gas Phase. Andy Long Kridsanaphong Limtragool

A new algorithm for Reverse Monte Carlo simulations

MatSci 331 Homework 4 Molecular Dynamics and Monte Carlo: Stress, heat capacity, quantum nuclear effects, and simulated annealing

Forecasting Levels of log Variables in Vector Autoregressions

A =, where d n w = dw

Lecture notes on Regression: Markov Chain Monte Carlo (MCMC)

Monte Carlo Simulations for a Soft Sphere Fluid

Chem 3502/4502 Physical Chemistry II (Quantum Mechanics) 3 Credits Spring Semester 2006 Christopher J. Cramer. Lecture 9, February 8, 2006

Context-dependent spatial analysis: A role for GIS?

A PPM Phase Shifter Design

Randomized Algorithms

Markov chain optimisation for energy systems (MC-ES)

6 Markov Chain Monte Carlo (MCMC)

5. Simulated Annealing 5.1 Basic Concepts. Fall 2010 Instructor: Dr. Masoud Yaghini

Part I. Experimental Error

Radiation from planets

Error Analysis of the Poisson P 3 MForce Field Scheme for Particle-Based Simulations of Biological Systems

CHEM-UA 652: Thermodynamics and Kinetics

Parametric Inference on Strong Dependence

Comment on Conjectures on exact solution of three-dimensional (3D) simple orthorhombic Ising lattices

Physics 403. Segev BenZvi. Numerical Methods, Maximum Likelihood, and Least Squares. Department of Physics and Astronomy University of Rochester

DRAFT: A2.1 Activity rate Loppersum

Thermodynamics of Three-phase Equilibrium in Lennard Jones System with a Simplified Equation of State

Online solution of the average cost Kullback-Leibler optimization problem

Simulations with MM Force Fields. Monte Carlo (MC) and Molecular Dynamics (MD) Video II.vi

DSMC Simulation of Entry Vehicle Flowfields Using a Collision-Based Chemical Kinetics Approach

Staging Is More Important than Perturbation Method for Computation of Enthalpy and Entropy Changes in Complex Systems

Markov Chain Monte Carlo methods

Variational Principal Components

How Many Holes Can an Unbordered Partial Word Contain?

Variational Bayesian Inference Techniques

The Bias-Variance dilemma of the Monte Carlo. method. Technion - Israel Institute of Technology, Technion City, Haifa 32000, Israel

Model dependence of AFM simulations in non-contact mode

Gibbs ensemble simulation of phase equilibrium in the hard core two-yukawa fluid model for the Lennard-Jones fluid

Understanding Molecular Simulation 2009 Monte Carlo and Molecular Dynamics in different ensembles. Srikanth Sastry

Controlled healing of graphene nanopore

Density Functional Theory of the Interface between Solid and Superfluid Helium 4

Markov Chain Monte Carlo. Simulated Annealing.

Transcription:

Physics Procedia Physics Procedia 00 (2013) 1 6 How the maximum step size in Monte Carlo simulations should be adjusted Robert H. Swendsen Physics Department, Carnegie Mellon University, Pittsburgh, PA 15217, USA Abstract Since the work by Miller, Amon, and Reinhardt, which correctly warned against the indiscriminate adjustment of the maximum step size during Monte Carlo (MC) simulations, some researchers have believed that adjusting the maximum step size always leads to systematic errors. In this paper, I demonstrate that when periodic adjustments are done properly, they can improve the overall accuracy of simulations without introducing errors. Keywords: Monte Carlo, Optimization 1. Introduction About ten years ago, Miller, Amon, and Reinhardt published an important warning about the indiscriminate adjustment of the maximum step size in Monte Carlo (MC) simulations.[1] Their main point is, of course, correct; frequent updating of the maximum step size can introduce an undesirable bias into the results of a Monte Carlo simulation. On the other hand, their warning might lead people to believe that adjusting the maximum step size is always to be avoided. This is not the case, as I will show in this paper. The question of whether automatic updating methods should be used is an important one, especially for inhomogeneous systems in which many di erent step sizes must be optimized for di erent variables in the model. It is especially important for systems in which local environments change during the simulation, so that the optimal Monte Carlo moves will also change. Both of these features are present in simulations of biological molecules. The gains from using updating methods are substantial, especially in applications to simulations of biological molecules. For a small test case of a 22-atom molecule, the improvement over either molecular dynamics (MD) or standard Monte Carlo (MC) was at least three orders of magnitude in computer time.[4] The application of adaptive methods for adjusting the maximum MC step size during simulated annealing is not problematic. The presence of a small bias is not an issue when the purpose of the simulation is to find the ground state. The main concern is that any updating procedure violates the Markov condition that while each new configuration can depend on the previous configuration, it should be independent of any earlier configuration. By using data from the history of the Monte Carlo simulation, all updating procedures violate the Markov condition to some extent. The question is to what extent an almost Markov algorithm su ers from a systematic bias due to this violation. The most important aspect of the problem that has led me to di erent conclusions than Miller, Amon, and Reinhardt[1] is that I have analyzed the magnitude of the systematic bias as a function of the length of the interval over which data is averaged for the next update. This has made it easy to construct a criterion to ensure that the systematic bias is smaller than the inevitable random errors in a Monte Carlo simulation. Another di erence between the work reported in this paper and that of Miller, Amon, and Reinhardt[1] is that I have used the Acceptance Ratio Method (ARM) and Dynamically Optimized Monte Carlo (DOMC), which my

R.H. Swendsen / Physics Procedia 00 (2013) 1 6 2 collaborators and I had previously introduced for automatically optimizing step sizes.[2][3][4] [5] These methods both increase the e ciency of the updating and reduce the magnitude of the bias. In the following, I first discuss the choice of maximum step size without updating during the simulation. Then I review the updating algorithm used by Miller, Amon, and Reinhardt [1] and the ARM and DOMC methods I had developed with my collaborators.[2][3][4] [5] Next I consider the sources of bias in simulations that violate the Markov condition and how the bias scales with the length of the interval between updates. I then give results of simulations on simple systems to show the magnitude of the bias introduced by these optimization methods and demonstrate why the bias becomes negligible when simple precautions are taken. Finally, I revisit the examples used by Miller, Amon, and Reinhardt[1] to demonstrate that the magnitude of the systematic bias can be made smaller than the statistical uncertainty in measurements made during each simulation. 2. Ideal step sizes for MC simulations The goal of the adaptive methods discussed in this paper is to compute the optimum step size for MC simulations automatically, either before or during the simulation itself. To achieve this, we must first know what the optimal step size is. Unfortunately, there is no clear consensus on this point. In my opinion, the most reasonable criterion for choosing the optimal step size is the minimization of the error in the quantities being measured. This brings up the important point that the optimal step size depends on the specific quantity being measured, and not just the system being simulated. This will be illustrated below in Table 1. 1 Miller, Amon, and Reinhardt used the common rule of thumb that the acceptance ratio should be 0.5, but commented (correctly) that this might be too high for some systems.[1] About twenty years ago, my co-workers and I showed that the rule of thumb is indeed very good for optimizing energy measurements in a simulation of the onedimensional simple harmonic oscillator (SHO), but that the optimal value is lower for an SHO in higher dimensions.[2, 3, 4] Since these results do not seem to be well known, I have repeated these calculations for this paper. Consider the simulation of an SHO in D dimensions. The potential energy is be given in the usual form, V ~r = 1 2 K ~r 2, (1) where ~r is the D-dimensional position. Proposed steps in the Metropolis MC algorithm were chosen uniformly in a sphere of radius. The maximum step size is conveniently given in terms of the dimensionless quantity F, where[2, 3, 4] F 2 = 1 2 K 2, (2) and = 1/k B T represents the inverse temperature. To minimize the error, I found the minimum of the integrated correlation time for measurements of both the energy and position. Optimal acceptance ratios and step sizes for measurements of energy and average position are shown in Table 1. 3. Optimization methods 3.1. Updating method used by Miller, Amon, Reinhardt The updating method used by Miller, Amon, and Reinhardt was to multiply the step size by a factor of 1.05 when the acceptance ratio was greater than 1/2, and multiply it by a factor 0.95 when the acceptance ratio was less than 1/2.[1] This method has the great advantage of simplicity, but it was not claimed to be optimal. A feature of the algorithm used by Miller, Amon, and Reinhardt[1] that will be play a role in understanding the di erences in my conclusions and theirs is that the magnitude of their adjustments do not become smaller as the averaging interval increases. The algorithms described in the next two subsections both reduce the average magnitude of the updating correction as the averaging period increases. 1 During the discussion of my talk, Prof. Bernd Berg noted that his calculations had found an optimal acceptance ratio for the one-dimensional SHO that was considerably lower than the value I had given.[6] The di erence was due to the fact that Prof. Berg had minimized the error in the measurement of the average position, while my collaborators and I had minimized the error in the energy. As can be seen from Table 1, we were both correct. The optimal acceptance ratio for position measurements in Table 1 agrees with Prof. Berg s results.[6]

R.H. Swendsen / Physics Procedia 00 (2013) 1 6 3 Dimension P opt (energy) F opt (energy) P opt (position) F opt (position) 1 0.48 2.2 0.41 2.7 2 0.42 1.8 0.31 2.3 3 0.38 1.7 0.27 2.2 Table 1: The optimal step sizes for MC simulations of simple harmonic oscillators in one, two, and three dimensions. The second and third columns show the acceptance ratios and the values of the dimensionless step size, F, that minimize the error in the energy, while the fourth and fifth columns show the corresponding values to minimize the error in determining the average position. The MC simulations used in constructing this table had run lengths of 10 8 MC steps. 3.2. Acceptance Ratio Method (ARM) In developing ARM several years before the work of Miller, Amon, and Reinhardt[1], my co-workers and I also adaptively adjusting the acceptance ratio to a predetermined optimal value.[2, 3, 4] However, the method we developed is quite di erent from the algorithm used by Miller, Amon, and Reinhardt. My co-workers and I observed that while the acceptance ratio is proportional to the inverse of the step size for very large values of, it is very nearly an exponential function of the step size (P exp( ), where is a constant) in the region of interest (F < 4). This suggested an updating equation of the form new = old ln (P ideal /P), where P ideal is the ideal acceptance ratio for the chosen moves. To protect against the cases of the sampled probability P old being either zero or one, we modified this equation to give a maximum change in by a factor of a factor of r or 1/r. new = old ln(ap ideal + b) ln(ap old + b) The constants a and b are chosen so that new = r old when P old = 1 and new = the constants a and b can be found easily and quickly by iterating the equations (3) old /r when P old = 0. The values of c (ap ideal + b) r (4) a (ap ideal + b) 1/r c (5) b c (6) The most commonly used values for r are 3.0 (for which a = 0.672924 and b = 0.0644284 when P ideal = 0.5) and 5.0 (for which a = 0.8298866 and b = 0.0146276 when P ideal = 0.5), although the e ciency of the method is not strongly dependent on the choice. This algorithm is extremely robust and e ective. The main disadvantages are that it allows only a discrete set of new values for the step size, and it is only applicable when there is a single parameter specifying the MC moves. These limitations are addressed by DOMC. 3.3. Dynamically Optimized Monte Carlo (DOMC) The original derivation of the DOMC equations was based on an analysis of a simple harmonic oscillator, although the result turn out to be far more general in practice. The basic idea is to obtain information about the e ective potential probed by a given MC move during the course of a simulation. For a one-dimensional simple harmonic oscillator with potential energy E = (1/2)Kx 2, it is easy to derive the equation [ E] = K h x 2i, (7) where E and x are the changes in energy and position during an MC update, and the square brackets indicate an average over all attempted MC moves, whether or not they were accepted. Using Eq. (7) to obtain an estimate of the spring constant K, we can combine it with Eq. (2) to obtain the basic DOMC equation. 0 h x 2i 1 = F B@ [ E] CA 1/2 (8)

R.H. Swendsen / Physics Procedia 00 (2013) 1 6 4 Eq. (8) has a number of advantages, including greater accuracy in determining the ideal step size, and being generalizable to higher dimensional moves. One disadvantage of DOMC is that although it treats double-well potentials very well, it becomes ine cient for potentials with large convex regions, as will be discussed below in section 5. A weakness of DOMC is that fluctuations can result in the measured value of [ E] being very small, or even negative, which prevents the use of Eq. (8). In practice, programs using DOMC are always written to protect it by switching to an ARM update whenever this happens. Suitable values of the dimensionless quantity F 2 = (1/2) K 2 (where = 1/k B T) can be read from Table 1. For systems in which the exact form of the local potential probed by a particular MC move is not known or changes with time, the value of F = 2 is most useful. Although F = 2 might not be optimal, the dependence of the correlation time on F is usually su ciently broad that that the exact value chosen is not critical. 4. Non-Markovian bias Biases due to violations of detailed balance due to non-markovian algorithms can be divided into two types. 1. Type I bias, which occurs even for simulations of simple harmonic oscillators, reflects the fact that the current position is correlated with the newly updated value of the step size. 2. Type II bias, which occurs for double-well potentials. It is more serious, because it tends to sample the narrower of the two wells with a higher than thermal probability. I have performed a number of simulations to illustrate the extent of these biases and to demonstrate how to control their e ects. Unfortunately, space does not permit me to present all relevant data, but I will summarize the main results. 4.1. Type I bias Data from DOMC simulations of a one-dimensional SHO shows that the systematic bias due to averaging the quantities in Eq. (8) over a finite updating period t update go to zero as (t ave ) 2. Since the error in any measured quantity goes to zero with the total length of simulation t total as (t total ) 1/2, the Type 1 bias will remain less than the statistical error due to fluctuations as long as t update < (t total ) 1/4. For an MC simulation of 10 8 steps, this means that 10 6 updates could be made at intervals of 100 MC steps without adversely a ecting the results. Since the safe lower limits for equilibrium simulations with DOMC are most often determined by the other type of bias, Type I bias is not of any practical concern. 4.2. Type II bias Type II bias occurs for asymmetric potentials, and it is more serious. For example, if we consider an asymmetric double-well potential, the narrower of the two wells will tend to be sampled with a higher than thermal probability. The origin of this e ect is that if the particle is in the narrower of the two wells, an updating algorithm will produce a smaller step size. This will lead to a longer waiting time before the particle escapes from the narrow well. On the other hand, if the particle is in the broader well, an updating algorithm will give a larger step size, allowing the particle to return to the narrower well more quickly. Therefore the simulation will show a bias towards the narrower well. As the averaging time is increased beyond the escape time for the narrower well, the particle spends more time sampling the entire potential. The initial bias toward the narrower well therefore decreases as t escape /t update. This should be compared to the statistical error from the finite length of the full simulation t total, which is inversely proportional to p t total. Therefore, if the averaging time is chosen as t update p ttotal, (9) the bias will be reduced at least as rapidly as the statistical error error for increasing total simulation time t total. Conveniently, simulations show that in all cases tested the bias is less than the error whenever Eq. (9) is satisfied, so that Eq. (9) provides the basis for safe updating in adaptive adjustment of MC step sizes. Trial simulations for a wide variety of asymmetric simulations have shown that when Eq. (9) is used, the bias is less than the statistical error.[2, 3, 4] This means that during a simulation of 10 6 sweeps, 1000 updates of the simulation parameters can be performed without introducing any significant bias into the results.

5. Comparison with Miller, Amon, and Reinhardt R.H. Swendsen / Physics Procedia 00 (2013) 1 6 5 Miller, Amon, and Reinhardt based their criticism of adjusting the MC step size during a simulation primarily on two calculations.[1] Their first calculation used a one-dimensional Lennard-Jones potential " 12 6 # V(x) = 4 (10) x x that was truncated at x = 5.0. This is indeed di cult for updating method because the large convex region. It is an extreme case of Type 2 bias. Miller, Amon, and Reinhardt used the updating algorithm described above with the assumption that the ideal acceptance ratio was 1/2.[1] This is unfortunate since a short calculation reveals that the optimal acceptance ratio for this potential is close to 1/4. Their simulations collected data from 10 7 MC steps, with updates at 25 steps for one set of runs and 100 steps for another set of runs. This choice of updating interval should be contrasted with the condition of safe updating given in Eq. (9), which would dictate updating no more frequently than once every 3000 steps. Their data clearly shows the importance of increasing the length of the updating interval since their results using an interval of 100 MC steps are significantly better than those for 25 MC steps. To perform a more useful check of the safe updating condition, I did ten simulations of the truncated Lennard- Jones potential at a temperature of T = 0.25, where the bias was largest, using ARM with P ideal = 0.25. In a simulation of 10 8 MC steps and updates every 10 4 MC steps, I found that the bias in the average energy was 0.000065, which is about a quarter of the statistical error of 0.00026. The errors for the specific heat and the average position were each less than half the statistical error. These results are completely consistent with the essential validity of Eq. (9) for ensuring safe updating. As mentioned above, DOMC gives an ine cient simulation for this potential, although the bias is still smaller than the statistical error. A second example given by Miller, Amon, and Reinhardt involved 108 particles in a cubic box with periodic boundary conditions.[1] The potential energy was given by pairwise Lennard-Jones interactions of the form of Eq. (10) without a cuto. The interactions between any two of four special particles was taken to be five times as strong as the other interactions, so that the special particles tended to stay together. The quantity measured was the average interaction energy between the special particles. Fig. 3 in their paper showed estimates of the average interaction energy for varying values of the number of MC sweeps between updates of the step size. Since their run length was 4 10 6 MC sweeps, a safe updating interval according to Eq. (9) would be 2 10 3 MC sweeps. As can be seen from Fig. 3 in their paper, Miller, Amon, and Reinhardt found that the bias was less than the statistical uncertainty for an updating interval greater than 900 MC sweeps, again confirming the criterion in Eq. (9).[1] 6. Summary Although Miller, Amon, and Reinhardt have done a service for researchers using Monte Carlo computer simulations in warning of the dangers of too frequent updating of MC step sizes, their results should not be taken to mean that updating always leads to incorrect results. In this paper, I have shown that following a simple rule allows us to enjoy the advantages of updating step sizes during MC simulations without introducing a significant bias. Acknowledgements I would like to thank Bernd Berg for his insightful comments. I would also like to thank David Landau for the many excellent workshops he has organized. I have enjoyed them all. [1] M. A. Miller, L. M. Amon, W. P. Reinhardt, Should one adjust the maximum step size in a Metropolis Monte Carlo simulation? Chem. Phys. Lett., 331, 278-284 (2000). [2] D. Bouzida, S. Kumar, and R. H. Swendsen. Almost Markov processes, in D.P. Landau, K.K Mon, and H.-B Schüttler, editors, Computer Simulation Studies in Condensed Matter Physics III. Springer Proceedings in Physics, Vol. 53, pages 193 196, Springer-Verlag, Berlin, Heidelberg, 1991. [3] D. Bouzida, S. Kumar, R.H. Swendsen, E cient Monte Carlo methods forthe computer simulation of biological molecules, Phys. Rev. A 45, 8894-8901 (1992).

R.H. Swendsen / Physics Procedia 00 (2013) 1 6 6 [4] D. Bouzida, S. Kumar, and R.H. Swendsen, A Simulated Annealing Approach for Probing Biomolecular Structures, Proceedings of the Twenty-Sixth Annual Hawai International Conference on System Sciences 1993, Ed. T.N. Mudge, V. Milutinovic, and L Hunter (IEEE Computer Society Press), pp.736-742. [5] M. Fasnacht and R.H. Swendsen, Avoiding a Pitfall in Dynamically Optimized Monte Carlo Method, in Computer Simulation Studies in Condensed Matter Physics XIII (Athens, Georgia, 21-25 February 2000), ed. D.P. Landau, S.P. Lewis, and H.-B. Schüttler (Springer-Verlag, Berlin-Heidelberg, 2000) p. 81. [6] Bernd A. Berg, Markov Chain Monte Carlo Simulations and thier Statistical Analysis: With Web-based Fortran code, (World-Scientific, London, 2004), pp. 230-237.