Monte Carlo Estimators

Resources

Summary

Let's say we have to compute some quantity, which is difficult to compute, let's say some integral of a difficult function ff. Then what we do in this method, sample some points from some distribution and then evaluate that function on those points and then do some computation of those function evaluation at those points to estimate the quantity in interest.

It's basically using sampling from some simple known distribution to estimate something difficult. By evaluating the quantity on those samples points and taking average of all those to estimate the quantity.

First Principal

I think the first principal which monte carlo methods use is the relation between expectation vs integration. This relation relates the problems of numerical computation (computing some difficult quantity) to problem of expectation computation which can be easily computed as numerical average.

Let's say the difficult numerical computation is finding a integral of very difficult function ff, now the ff​ is very difficult such that analytic integration of ff​ which is ∫01f(x)dx\int_0^1 f(x)dx​ not is not feasible. So how do we estimate this integral

so now we can write ∫01f(x)dx\int_0^1 f(x)dx​as

∫01f(x)dx=∫01f(x)⋅1dx=Ex∼U[0,1][f(x)]\int_0^1 f(x)dx = \int_0^1 f(x) \cdot 1dx = E_{x\sim U[0,1]}[f(x)]

​So we converted the problem of integration to finding the expected value. Now to estimate Ex∼U[0,1][f(x)]E_{x\sim U[0,1]}[f(x)]we can use average. So we can calculate E[f(x)]=1N∑i=1Nf(xi)E[f(x)] = \frac{1}{N} \sum_{i=1}^N f(x_i)where xi∼U[0,1]x_i \sim U[0,1]. Now since the the interval of integration was [0,1] and we used Uniform distribution to sample the points, we could directly take the average of function evaluated at sample points. But if the can choose which distribution p(x)p(x)​ to use to sample xx​ to evaluate ff​at. So for any arbitrary p(x)p(x)​we can write the above integral as.

∫f(x)dx=∫f(x)p(x)p(x)dx=Ex∼p(x)[f(x)p(x)]\int f(x) dx = \int \frac{f(x)}{p(x)} p(x) dx = E_{x\sim p(x)}[\frac{f(x)}{p(x)}]

​So basically this will give unbiased estimator to estimate the integral. The choice of p(x)p(x)​ dictates the convergence of monte carlo estimate to true value of integral.

The factor of 1p(x)\frac{1}{p(x)}​relates to the concept of Importance Sampling because when we sample xx according to p(x)p(x)we need to counter that effect, hence downweighting by that factor.

Problems with Monte Carlo

Since there is sampling from a probability distribution, monte carlo method hardly sample in the very low probability regions, so it doesn't evaluate on those samples.

Last updated