Sunday, August 7, 2011

nebulae12 asked: [MC integration] Don't you already have to know something about the volume of integration in order to determine if a point inside the hypercube is also in the region of integration?

In this post, we talked about using Monte Carlo methods to evaluate an integral numerically.

The answer here is that you do need to know what your region of integration is. To be clear: MC integration can’t be used to find out what the region of integration is, because that’s your choice! Pragmatically, this region Ω can be defined by bounding functions: if you were integrating on a semicircle, for example, your bounds might be x ∈ [-1,1] and 0 ≤ y ≤ (1-x2)½. So you have a way to ask “given the point p, is p ∈ Ω?” But what you don’t have is an easy way to ask about the volume of Ω. The latter functionality is provided by the Monte Carlo process, by comparing the number of points in the hypercube that fall inside and outside of Ω.

In terms of programming, you might “define” the region as a function that takes a point in your domain and gives back a boolean value. The function would basically be (with && as the logical AND operator):

Domain(p) = f1(p) && f2(p) && f3(p) && …

Where fi are your individual conditions (you might have one for each integral, for example, if you’re doing a multidimensional integral); together these fi must be sufficient to determine Ω = { p ∈ Rn | Domain(p) }.

Notes

  1. sayitwithscience posted this