An integral as an average over samples
The topic Variational inference replaced the posterior with the best member of a family . That answer is fast but biased: whatever the family cannot represent is simply missing, and nothing in the output says how much. This topic takes the other road. Instead of approximating the posterior by a formula, we draw samples from it and average.
Almost everything we want from a posterior is an expectation. The posterior mean, the probability of a set , the posterior predictive:
All three have the form . If are independent draws from , the Monte Carlo estimate is the sample average:
It is unbiased, , and the law of large numbers gives when . If also , then
So the typical error is . The normal shape is a large- statement, not an exact one for every .
The running example is the coin from the topic The Bayesian approach: a uniform prior and three heads give the posterior with density on . Its mean is , the probability that the next toss is heads, and its standard deviation is . With posterior draws, the average of the lands within about of .
Two remarks. The rate contains no dimension: averaging works the same way for a 1000-dimensional . But , the cost of one draw and, later, how fast a chain mixes can all depend heavily on dimension. And the whole method rests on one assumption we have not earned yet: that we can draw from at all. The next three blocks do that in one dimension.