7. Metropolis Algorithm. Markov Chain and Monte Carlo Markov chain theory describes a particularly simple type of stochastic processes. Given a transition.

Slides:



Advertisements
Similar presentations
Monte Carlo Simulation Wednesday, 9/11/2002 Stochastic simulations consider particle interactions. Ensemble sampling Markov Chain Metropolis Sampling.
Advertisements

Review Of Statistical Mechanics
Lecture 13: Conformational Sampling: MC and MD Dr. Ronald M. Levy Contributions from Mike Andrec and Daniel Weinstock Statistical Thermodynamics.
Monte Carlo Methods and Statistical Physics
Ch 11. Sampling Models Pattern Recognition and Machine Learning, C. M. Bishop, Summarized by I.-H. Lee Biointelligence Laboratory, Seoul National.
Markov Chains 1.
11 - Markov Chains Jim Vallandingham.
Introduction to Sampling based inference and MCMC Ata Kaban School of Computer Science The University of Birmingham.
CHAPTER 16 MARKOV CHAIN MONTE CARLO
Lecture 3: Markov processes, master equation
Entropy Rates of a Stochastic Process
Graduate School of Information Sciences, Tohoku University
BAYESIAN INFERENCE Sampling techniques
Markov processes in a problem of the Caspian sea level forecasting Mikhail V. Bolgov Water Problem Institute of Russian Academy of Sciences.
CS774. Markov Random Field : Theory and Application Lecture 16 Kyomin Jung KAIST Nov
1 Quantum Monte Carlo Methods Jian-Sheng Wang Dept of Computational Science, National University of Singapore.
1 CE 530 Molecular Simulation Lecture 8 Markov Processes David A. Kofke Department of Chemical Engineering SUNY Buffalo
Monte Carlo Simulation Methods - ideal gas. Calculating properties by integration.
What if time ran backwards? If X n, 0 ≤ n ≤ N is a Markov chain, what about Y n = X N-n ? If X n follows the stationary distribution, Y n has stationary.
. PGM: Tirgul 8 Markov Chains. Stochastic Sampling  In previous class, we examined methods that use independent samples to estimate P(X = x |e ) Problem:
Computational statistics 2009 Random walk. Computational statistics 2009 Random walk with absorbing barrier.
The Gibbs sampler Suppose f is a function from S d to S. We generate a Markov chain by consecutively drawing from (called the full conditionals). The n’th.
1 Cluster Monte Carlo Algorithms & softening of first-order transition by disorder TIAN Liang.
Machine Learning CUNY Graduate Center Lecture 7b: Sampling.
Monte Carlo Methods in Partial Differential Equations.
Image Analysis and Markov Random Fields (MRFs) Quanren Xiong.
6. Markov Chain. State Space The state space is the set of values a random variable X can take. E.g.: integer 1 to 6 in a dice experiment, or the locations.
Advanced methods of molecular dynamics Monte Carlo methods
Monte Carlo Methods: Basics
Monte-Carlo simulations of the structure of complex liquids with various interaction potentials Alja ž Godec Advisers: prof. dr. Janko Jamnik and doc.
Free energies and phase transitions. Condition for phase coexistence in a one-component system:
TUTORIAL no. 2 Monte Carlo simulations: Lennard Jones gas G. Lattanzi Università degli studi di Bari “Aldo Moro” Trieste, July 10 th, 2012 CECAM school.
F.F. Assaad. MPI-Stuttgart. Universität-Stuttgart Numerical approaches to the correlated electron problem: Quantum Monte Carlo.  The Monte.
1 Lesson 3: Choosing from distributions Theory: LLN and Central Limit Theorem Theory: LLN and Central Limit Theorem Choosing from distributions Choosing.
Machine Learning Lecture 23: Statistical Estimation with Sampling Iain Murray’s MLSS lecture on videolectures.net:
Module 1: Statistical Issues in Micro simulation Paul Sousa.
1 Statistical Mechanics and Multi- Scale Simulation Methods ChBE Prof. C. Heath Turner Lecture 14 Some materials adapted from Prof. Keith E. Gubbins:
1 Monte Carlo Methods Wang Jian-Sheng Department of Physics.
Suppressing Random Walks in Markov Chain Monte Carlo Using Ordered Overrelaxation Radford M. Neal 발표자 : 장 정 호.
Bayes’ Nets: Sampling [These slides were created by Dan Klein and Pieter Abbeel for CS188 Intro to AI at UC Berkeley. All CS188 materials are available.
1 Cluster Monte Carlo Algorithms: Jian-Sheng Wang National University of Singapore.
Numerical Bayesian Techniques. outline How to evaluate Bayes integrals? Numerical integration Monte Carlo integration Importance sampling Metropolis algorithm.
Path Integral Quantum Monte Carlo Consider a harmonic oscillator potential a classical particle moves back and forth periodically in such a potential x(t)=
Ch. 14: Markov Chain Monte Carlo Methods based on Stephen Marsland, Machine Learning: An Algorithmic Perspective. CRC 2009.; C, Andrieu, N, de Freitas,
An Introduction to Markov Chain Monte Carlo Teg Grenager July 1, 2004.
Seminar on random walks on graphs Lecture No. 2 Mille Gandelsman,
Monte Carlo method: Basic ideas. deterministic vs. stochastic In deterministic models, the output of the model is fully determined by the parameter values.
Lecture #9: Introduction to Markov Chain Monte Carlo, part 3
An Introduction to Monte Carlo Methods in Statistical Physics Kristen A. Fichthorn The Pennsylvania State University University Park, PA
Monte Carlo in different ensembles Chapter 5
Javier Junquera Importance sampling Monte Carlo. Cambridge University Press, Cambridge, 2002 ISBN Bibliography.
CS774. Markov Random Field : Theory and Application Lecture 15 Kyomin Jung KAIST Oct
STA347 - week 91 Random Vectors and Matrices A random vector is a vector whose elements are random variables. The collective behavior of a p x 1 random.
Stochastic Processes and Transition Probabilities D Nagesh Kumar, IISc Water Resources Planning and Management: M6L5 Stochastic Optimization.
CS Statistical Machine learning Lecture 25 Yuan (Alan) Qi Purdue CS Nov
STAT 534: Statistical Computing
Basic Monte Carlo (chapter 3) Algorithm Detailed Balance Other points non-Boltzmann sampling.
Kevin Stevenson AST 4762/5765. What is MCMC?  Random sampling algorithm  Estimates model parameters and their uncertainty  Only samples regions of.
CS498-EA Reasoning in AI Lecture #19 Professor: Eyal Amir Fall Semester 2011.
The Monte Carlo Method/ Markov Chains/ Metropolitan Algorithm from sec in “Adaptive Cooperative Systems” -summarized by Jinsan Yang.
Introduction to Sampling based inference and MCMC
Markov Chain Monte Carlo methods --the final project of stat 6213
Advanced Statistical Computing Fall 2016
Jun Liu Department of Statistics Stanford University
Markov chain monte carlo
6. Markov Chain.
Haim Kaplan and Uri Zwick
7. Metropolis Algorithm.
Opinionated Lessons #39 MCMC and Gibbs Sampling in Statistics
Presentation transcript:

7. Metropolis Algorithm

Markov Chain and Monte Carlo Markov chain theory describes a particularly simple type of stochastic processes. Given a transition matrix, W, the invariant distribution P can be determined. Monte Carlo is a computer implementation of a Markov chain. In Monte Carlo, P is given, we need to find W such that P = P W.

A Computer Simulation of a Markov Chain 1.Let ξ 0, ξ 1, …, ξ n …, be a sequence of independent, uniformly distributed random variables between 0 and 1 2.Partition the set [0,1] into subintervals A j such that |A j |=(p 0 ) j, and A ij such that |A ij |=W(i ->j), and define two functions: 3.G 0 (u) = j if u  A j G(i,u) = j if u  A ij, then the chain is realized by 4.X 0 = G 0 (ξ 0 ), X n+1 = G(X n,ξ n+1 ) for n ≥ 0

Partition of Unit Interval 0 1 p1p1 p1+p2p1+p2 p1+p2+p3p1+p2+p3 A1A1 A2A2 A3A3 A4A4 A 1 is the subset [0,p 1 ), A 2 is the subset [p 1, p 1 +p 2 ), …, such that length |A j | = p j. u

Markov Chain Monte Carlo Generate a sequence of states X 0, X 1, …, X n, such that the limiting distribution is given by P(X) Move X by the transition probability W(X -> X’) Starting from arbitrary P 0 (X), we have P n+1 (X) = ∑ X’ P n (X’) W(X’ -> X) P n (X) approaches P(X) as n go to ∞

Ergodicity [W n ](X - > X’) > 0 For all n > n max, all X and X’ Detailed Balance P(X) W(X -> X’) = P(X’) W(X’ -> X) Necessary and sufficient conditions for convergence

Taking Statistics After equilibration, we estimate: It is necessary that we take data for each sample or at uniform interval. It is an error to omit samples (condition on things).

Choice of Transition Matrix W The choice of W determines a algorithm. The equation P = PW or P(X)W(X->X’)=P(X’)W(X’->X) has (infinitely) many solutions given P. Any one of them can be used for Monte Carlo simulation.

Metropolis Algorithm (1953) Metropolis algorithm takes W(X->X’) = T(X->X’) min ( 1, P(X’)/P(X) ) where X ≠ X’, and T is a symmetric stochastic matrix T(X -> X’) = T(X’ -> X)

The Paper (9300 citations up to 2006) THE JOURNAL OF CHEMICAL PHYSICS VOLUME 21, NUMBER 6 JUNE, 1953 Equation of State Calculations by Fast Computing Machines NICHOLAS METROPOLIS, ARIANNA W. ROSENBLUTH, MARSHALL N. ROSENBLUTH, AND AUGUSTA H. TELLER, Los Alamos Scientific Laboratory, Los Alamos, New Mexico AND EDWARD TELLER, * Department of Physics, University of Chicago, Chicago, Illinois (Received March 6, 1953) A general method, suitable for fast computing machines, for investigating such properties as equations of state for substances consisting of interacting individual molecules is described. The method consists of a modified Monte Carlo integration over configuration space. Results for the two-dimensional rigid-sphere system have been obtained on the Los Alamos MANIAC and are presented here. These results are compared to the free volume equation of state and to a four-term virial coefficient expansion. 1087

Model Gas/Fluid A collection of molecules interacts through some potential (hard core is treated), compute the equation of state: pressure P as function of particle density ρ=N/V. (Note the ideal gas law) PV = N k B T

The Statistical Mechanics Problem Compute multi-dimensional integral where potential energy

Importance Sampling “…, instead of choosing configurations randomly, …, we choose configuration with a probability exp(-E/k B T) and weight them evenly.” - from M(RT) 2 paper

The M(RT) 2 Move a particle at (x,y) according to x -> x + (2ξ 1 -1)a, y -> y + (2ξ 2 -1)a Compute ΔE = E new – E old If ΔE ≤ 0 accept the move If ΔE > 0, accept the move with probability exp ( -ΔE/(k B T) ), i.e., accept if ξ 3 < exp ( -ΔE/(k B T) ) Count the configuration as a sample whether accepted or rejected.

A Priori Probability T What is T(X->X’) in the Metropolis algorithm? And why it is symmetric?

The Calculation Number of particles N = 224 Monte Carlo sweep ≈ 60 Each sweep took 3 minutes on MANIAC Each data point took 5 hours

MANIAC the Computer and the Man Seated is Nick Metropolis, the background is the MANIAC vacuum tube computer

Summary of Metropolis Algorithm Make a local move proposal according to T(X n -> X’), X n is the current state Compute the acceptance rate r = min [ 1, P(X’)/P(X n ) ] Set

Metropolis-Hastings Algorithm where X≠X’. In this algorithm we remove the condition that T(X->X’) = T(X’->X)

Why Work? We check that P(X) is invariant with respect to the transition matrix W. This is easy if detailed balance is true. Take P(X) W(X -> Y) = P(Y) W(Y->X) Sum over X, we get ∑ X P(X)W(X->Y) = P(Y) ∑ X W(Y-X) = P(Y) ∑ X W(Y->X) = 1, because W is a stochastic matrix.

Detailed Balance Satisfied For X≠Y, we have W(X->Y) = T(X->Y) min[1, P(Y)T(Y->X)/(P(X)T(X->Y)) ] So if P(X)T(X->Y) > P(Y)T(Y->X), we get P(X)W(X->Y) = P(Y) T(Y->X), and P(Y)W(Y->X) = P(Y) T(Y->X) Same is true when the inequality is reversed. Detailed balance means P(X)W(X->Y) = P(Y) W(Y->X)

Ergodicity The unspecified part of Metropolis algorithm is T(X->X’), the choice of which determines if the Markov chain is ergodic. Choice of T(X->X’) is problem specific. We can adjust T(X->X’) such that acceptance rate r ≈ 0.5

Gibbs Sampler or Heat- Bath Algorithm If X is a collection of components, X=(x 1,x 2, …, x i, …, x N ), and if we can compute P(x i |x 1,…,x i-1,x i+1,..,x N ), we generate the new configuration by sampling x i according to the above conditional probability.