You are viewing the course site for a past offering of this course. The current offering may be found here.
Lecture 12: Monte Carlo Integration (55)
crystal-zq-wang

I think I'm still struggling to wrap my head around the idea of inversion a little bit. From what I understand, we use this method to pick some x from a given f(X) and pdf/cdf of X, which is useful to us for Monte Carlo sampling. Then, given that we chose some Xi to represent P(our chosen x), we isolate what the chosen x should be?

nobugnohair

We can then use the sampling of Xi [0, 1) to get the corresponding sample of x

Staffathakrar1

@crystal-zq-wang That's entirely correct! As you stated, generally, the goal of the inverse transform sampling method is to generate some random sample number given a non-uniform probability distribution.

Just as a reminder, a CDF is defined as the probability that a sample from some distribution (let's call it X) will take on a value <=x. Because the probability of x being sampled is the "y" value on the curve, it follows that this CDF term will end up being the area under the curve that exists with the defined x bounds. As such, the CDF takes in some value x and returns some probability from the interval [0,1).

As such, we can see that the inverse of the CDF would do the opposite -- given a probability in the interval [0,1), we return the corresponding value of x. Now, let's try to sample random values x. To achieve this, we use a uniform random variable (which, again, exists in the range [0,1]), which will randomly return some probability value, and in turn, randomly sample a value x from the distribution given. If we run this inverse sampling function a few times, we'll get a set of random values existing within our distribution.

Something to note here is also that given the shape of the inverse CDF, you'll be more likely to sample values with a higher probability of occurring, which is why we use this method for importance sampling in practice. This can be seen by inspection if you look at a graph of the function!

You must be enrolled in the course to comment