2. Monte Carlo Methods#

In this chapter we will be looking at Monte carlo methods, mainly for integration and optimisation

What is numerical integration?

Numerical integration, also called ‘quadrature,’ refers to methods in which the integral over continuous function is evaluated by computing the value of the function at finite number of points. By increasing the number of points where the function is evaluated, desired accuracy can be obtained. Numerical integration methods can be divided to simulation (stochastic) methods, such as Monte Carlo, and deterministic methods such as many quadrature rule methods.

Simulation Methods:

Simulation or stochastic methods are based on treating integrals as expectations. We obtain random samples \(\theta^{s}\) from the desired distribution \(p(\theta)\), and estimate the expectation of any function \(h(\theta|y)\)

\[ \int_{} h(\theta) p(\theta|y) d \theta = \mathbb{E} (h(\theta)|y) \sim \frac{1}{S} \sum_{s = 1}^{S} h(\theta^s) \]

Simulation methods can be used for high-dimensional distributions, and there are general algorithms which work for a wide variety of models.

Deterministic Methods:

Deterministic numerical integration methods are based on evaluating the integrand \(h(\theta) p(\theta|y)\) at selected points \(\theta^s\), as a weighted version of simulation method.

\[ \int_{} h(\theta) p(\theta|y) d \theta \sim \frac{1}{S} \sum_{s = 1}^{S} w_s h(\theta^s) p(\theta^s|y) \]

The weights are obtained using rules like the Simpsons rule, local polynomial approximations. Determin- istic numerical integration rules typically have lower variance than simulation methods, but selection of locations gets difficult in high dimensions.

Grid methods (a grid in the parameter space with equal weights) are also part of deterministic methods, but they are difficult to scale to higher dimensions.

Here, we will be studying simulation methods to evaluate integrals, but we will be comparing them with their deterministic counterparts to see how the comparison, and look for scope of collaboration between the two.