The Monte Carlo Method in High Performance Computing Dieter W. Heermann Monte Carlo Methods 2015 Dieter W. Heermann (Monte Carlo Methods)The Monte Carlo Method in High Performance Computing 2015 1 / 1
Outline The Monte Carlo Method in High Performance Computing Dieter W. Heermann (Monte Carlo Methods)The Monte Carlo Method in High Performance Computing 2015 2 / 1
Revisiting the Poor Man s Monte Carlo Poor Man s Monte Carlo: Statistics Let X 1,...X n be iid random variables with E(X i ) = m = µ for all i. Then E( 1 n n i=1 X i) is an estimator for µ with variance v/n. Assume that we have κ processors available. Assume each processor j produces n samples independently. Then: E j := 1 n E = 1 κ n i=1 X (j) i (1) κ E j (2) j=1 Var(E) = v/(κn) (3) The variance is reduced linearly proportional to κ. Dieter W. Heermann (Monte Carlo Methods)The Monte Carlo Method in High Performance Computing 2015 3 / 1
Revisiting the Poor Man s Monte Carlo Assume now that each processor runs at different speeds. Each processor j obtains n j results. Then E = Assume that we know n j a priori. n j=1 E j κ j=1 n j Hence, if n j has not been reached after a prescribed time, then there is a problem with the processor. Dieter W. Heermann (Monte Carlo Methods)The Monte Carlo Method in High Performance Computing 2015 4 / 1
Revisiting the Poor Man s Monte Carlo { 0 does not report nj Let Z j = 1 otherwise Then n j=1 E = Z je j κ j=1 n jz j No bias. Possibility: The master process assigns the starting values (random number seeds). Lost results are re-computed. Dieter W. Heermann (Monte Carlo Methods)The Monte Carlo Method in High Performance Computing 2015 5 / 1
Revisiting the Poor Man s Monte Carlo Dropping of initial non-stationary state values. 1 nj E j := n j B j +1 i=b j X (j) i Then n j=1 E = Z je j κ j=1 n jz j Will not lead to an exact linear speed-up. Dieter W. Heermann (Monte Carlo Methods)The Monte Carlo Method in High Performance Computing 2015 6 / 1
Parallel Tempering Parallel Tempering Basic idea [1, 2, 3]: Run several (possibly as many as there are processors) individual Markov chains. Supplementing local configurational Metropolis moves with global swap moves that update an entire set of configurations. The replica exchanges are accepted with the Metropolis acceptance probability and rejected with the remaining probability. Induce mixing between the Markov chains. Detailed balance is enforced and the sampled distributions remain stationary. This can be used, for example as a means to accelerate the convergence of Monte Carlo simulations. Widely employed in chemistry, physics, biology, engineering and materials science [4]. Dieter W. Heermann (Monte Carlo Methods)The Monte Carlo Method in High Performance Computing 2015 7 / 1
Parallel Tempering x 0 (1) P (1) x 0 (10) P (10) Swap the elements of the Markov chains. The swap moves induce a random walk in for a given swap element. Dieter W. Heermann (Monte Carlo Methods)The Monte Carlo Method in High Performance Computing 2015 8 / 1
Parallel Tempering Let r uniform(0, 1) be a uniformly distributed random number. Accept or reject a swap between the Markov chains as r < P i(x j )P j (X i ) P i (X i )P j (X j ) Exchange step is not capable of destroying or creating new configurations. New configurations are generated within one Markov chain. Dieter W. Heermann (Monte Carlo Methods)The Monte Carlo Method in High Performance Computing 2015 9 / 1
Parallel Tempering Data Model Prior information D M I Target Posterior p X Α D,M,I Control system diagnostics Hybrid n no. of iterations X Α iterations parallel tempering X Α init start parameters Summary statistics MCMC Σ Α init start proposal Σ 's Best fit model & residuals Nonlinear model Β Tempering levels X Α marginals fitting program X Α 68.3% credible regions p D M,I marginal likelihood for model comparison Adaptive Two Stage Control System 1 Automates selection of an efficient set of Gaussian proposal distribution Σ 's using an annealing operation. 2 Monitors MCMC for emergence of significantly improved parameter set and resets MCMC. Includes a gene crossover algorithm to breed higher probability chains. Figure 1: Schematic of the Bayesian nonlinear model fitting program which employs the hybrid MCMC algorithm to carry out the Bayesian integrals. Taken from: Detecting Extra-solar Planets with a Bayesian hybrid MCMC Kepler periodogram P. C. Gregory, in JSM Proceedings 2008, Planets Around Other Suns Section. Denver, CO: American Statistical Association. Dieter W. Heermann (Monte Carlo Methods)The Monte Carlo Method in High Performance Computing 2015 10 / 1
Simulated Annealing Simulated Annealing Initialization i=0 xopt=x0; Fopt(xi)=Fobj(x0) i=i+1 xi+1=xi+ Fobj,i+1=Fobj(xi+1) No Is xi+1 feasible? Yes Fobj,i+1<Fopt Yes xopt=xi+1 No No Fopt=Fobj,i+1 Stopping criteria satisfied? Yes End Figure 2.8 Flow diagram of the Localized Random Search (LRS) Algorithm Figure taken from Plantwide Optimizing Control for the Continuous Bio-Ethanol Production Process (PhD Thesis) Silvia Mercedes Ochoa Cáceres Dieter W. Heermann (Monte Carlo Methods)The Monte Carlo Method in High Performance Computing 2015 11 / 1
Simulated Annealing PRODUCT F D2 PC Q C F D1 PC LC LC RECTIFICATION COLUMN FEED BEER COLUMN F B2 LC Q R2 F B1 Q R1 Figure 3.11 Flow diagram of a two-distillation column system for ethanol purification. Beer column: no condenser. Rectification column: partial condenser. Figure taken from Plantwide Optimizing Control for the Continuous Bio-Ethanol Production Process (PhD Thesis) Silvia Mercedes Ochoa Cáceres Dieter W. Heermann (Monte Carlo Methods)The Monte Carlo Method in High Performance Computing 2015 12 / 1
Literature Literature Swendsen, R. H. and Wang, J.-S. Replica Monte Carlo Simulation of Spin-Glasses, Phys. Rev. Lett., 57(21):2607?2609, (1986). C.J. Geyer, Markov Chain Monte Carlo Maximum Likelihood, in Computing Science and Statistics: Proceedings of the 23rd Symposium on the Interface, E.M. Keramidas, ed., American Statistical Association, New York (1991). Hukushima K and Nemoto K, Exchange Monte Carlo method and application to spin glass simulations, J. Phys. Soc. Japan 65 1604 (1996) David J. Earl and Michael W. Deem, Phys. Chem. Chem. Phys., 2005, 7, 3910-3916 Dieter W. Heermann (Monte Carlo Methods)The Monte Carlo Method in High Performance Computing 2015 13 / 1