The goal of random sampling is to generalize hard random variables from easy RVs. This allows us to compute hard integrals by using sampling to solve deterministic problems.
Definition (Random Sampling RVs)
Let be a random variable with the PDF and CDF respectively. We accomplish our goal of sampling from the PDF by producing independent and identically distributed (iid) RVs with PDF .
In practice, sampling RVs in means generating numbers with likelihood defined by .
Example 1 (Monte Carlo Estimation of Pi)
Suppose we wanted to find the area of a unit circle in a plane. Let
Let
Note that is the Uniform Distribution. Now, the area of th sample space, is . Thus,
where is the area of the unit circle. Since is a Bernoulli RV, then .
After trials, we have iid random variables. Using the Strong Law of Large Numbers, we see
Effectively, we are counting the number of the dots that hit the circle with the summation, and finding the mean.
Example 2 (Multidimensional Hypercube Integral)
Compute the integral of a function over a dimensional hypercube . Let
Numerically, integrating this is the same as doing this over a grid, dividing the domain into boxes of size . Let the center of each box be be . The sum is our integral,
The term means we need many points. Even with and total divisions, we need or billion points (which is computationally expensive!)
Instead, we can do Monte Carlo Integration. First, generate iid RVs . Since the PDF of each RV is , then
Note that is the RV of any value of this distribution since they are identical. Then we can define an experiment with trials. Let
Again, by Strong LLN, as , then . We can create an Estimator for and get an error of .
Example 3 (Ising Model)
See Ising Model.