In the past few classes we have taken a look at Monte Carlo methods, which are computational techniques for doing statistics instead of doing calculus. That is, instead of calculating definite integrals, we instead sample from an appropriate probability distribution and then take sample averages.
The guiding expression is just this:
if each is drawn from the distribution with density
.
Monte Carlo methods are useful when the sampling process is easier (or easier to implement) than direct integration would be (say, by quadrature methods). Monte Carlo methods stand as an interest contrast to the usual narrative that statistical estimates are less precise than direct probability calculations: with Monte Carlo approach we turn a probability problem (i.e. calculating an expectation) into a statistics problem! (Albeit on where we can collect an arbitrarily large number of sample observations.)
The importance of Monte Carlo methods for Bayesian statistics lies in the fact that many (most?) models do not admit “closed-form” expressions for posterior summaries. Instead, the strategy will be to draw samples from the posterior distribution of a parameter or parameters of interest and then calculate Monte Carlo estimates of various quantities (means of functions of the parameters, probabilities, quantiles, etc).
In class so far we have covered two techniques for drawing from univariate probability distributions: the inverse CDF method and rejection sampling. We also saw a method for calculating the expected value of a function by drawing samples from a different probability distribution, a strategy called importance sampling. Somewhat counter-intuitively, importance sampling can be more efficient than naive sampling, depending on what function is being integrated.
In the next few classes we will continue to consider computational techniques for drawing from probability distributions, including the Metropolis-Hastings algorithm and Gibbs sampling.
Here are the class slides.
Here is an R script demoing some of these techniques.
Here is the corresponding set of exercises.
