Monte Carlo Methods, and why they are useful
What are Monte Carlo Methods
A Monte Carlo method is an algorithm that obtains a numerical approximation using repeated random trials. This was originally proposed by Stanislaw Ulam, inspired by his uncles gambling habits in the Monte Carlo casino in Monaco.
Example 1.
The mean of a random variable can be estimated by taking an average of independent trials:
This is useful in practice if the random variable is easy to simulate; but hard to compute analytically.
Example 2 (Numerical integration).
Let
The advantage of
Example 3 (Travelling Salesman).
Given
This has been extensively studied, and there are several well known combinatorial algorithms that yield results close to the optimal path in practical amounts of time. We will numerically approximate the solution using an algorithm known as simulated annealing.
Example 4 (Substitution Ciphers).
A substitution cipher is one where you create a key that is a permutation of the alphabet (e.g.
This is a needle in an enormous haystack.
If you could examine
Example 5 (Generative Modelling). Generative modelling algorithms are used to (for instance) produce realistic images from user input. They work by training a neural net on a large sample of images and learning a probability distribution associated with these images. Images are generated by using a Monte Carlo method to sample from this distribution.
Plan of the first half of this course
-
In order to use Monte Carlo methods, you need to be able to sample from a given distribution. We will start with a quick introduction to basic sampling algorithms.
-
We will then study the Metropolis Hastings algorithm; to understand why this works, we need to understand the basics of the convergence of Markov Chains to their stationary distribution.
-
We will analyze a few applications of the Metropolis Hastings algorithm, and study commonly used numerical diagnostics.
-
We will study simulated annealing and use it to solve a few optimization problems.
-
Time permitting, I might sketch the algorithms used in generative modelling. To fully understand these we need to understand basics of SDEs and Langevin Monte Carlo and related sampling algorithms, which we will not have the time for. We will black-box the required background and obtain some intuition about how generative modelling works.
We will implement many of these algorithms in Python.