9 Monte Carlo integration
Our goal is to compute the value of some integral with respect to a probability measure \(F\):
\[\int a(x) dF(x)\]
Suppose we have \(N\) i.i.d. samples \(X^1, \dots X^N\) from a distribution with density \(q(\cdot)\).
By the law of large numbers, we can get a consistent estimator of the expectation of any function \(\phi(X)\) w.r.t. \(q\).
By the law of large numbers, as \({N\rightarrow \infty}\):
\[ \frac{1}{N} \sum_{n=1}^{N} \phi(X^n) \rightarrow \mathbb E_{X \sim q(\cdot)}[\phi(X)] \]