Monte Carlo integration and variance

237 Views Asked by At

With the monte carlo integration of a function f(x), what do they mean with the variance? Is it the variance of the function we want to integrate?

$I = ∫^{\inf}_{inf} f(x)p(x) dx$ (with p(x) some probability distribution function)

$I \approx$ $\frac{1}{N}$ $\sum^{N}_{i=1} f(x_{i}) $ (Approximation, with $x_{i}$ sampled according to p(x) )

$V= \sigma^2= ∫^{\inf}_{inf} (f(x)- I)^2 p(x) dx $

How does stratified/importance sampling reduce this variance? What I can't seem to grasp is why we'd need more samples taken from the areas where higher peaks are at, like in this figure:

enter image description here

Somehow I thought it had to do with peaks accounting for more area. But I just don't see the problem with just uniformly sampling the x values.

I think I'm missing the point of variance reduction here. We want to 'speed up' our Monte Carlo integration, so we want to be able to integrate faster with as much samples as before. Therefore, sampling more in the peaks is going to get us a faster approximation of the area?