# Monte Carlo integration and variance

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 = ∫^{\infty}_{\infty} 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= ∫^{\infty}_{\infty} (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:

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.

EDIT: 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?

• You may want to include a bit more detail, such as who "they" are. Maybe include the text to which you're referring. I'm guessing the issue is with the variance of the estimate of $\int f(x) dx$. How are the authors suggesting you reduce this variance? Dec 31 '15 at 15:14
• @dsaxton I provided some formulas. The authors suggest using stratified/importance sampling or using control variates Dec 31 '15 at 15:20