Monte Carlo: Averages That Close In Like a Funnel
An interactive live film: sixteen runs estimate E[z²] = 1 by running means; they scatter at first and close in like the funnel 1 ± σ/√S, so halving the error costs four times the samples. Roll the dice for fresh runs.
Narration
We want the average of z squared, where z is a standard Gaussian. The exact answer is one, the dark line along the back.
Monte Carlo replaces that average by an average over random samples. Draw z, square it, and keep a running mean. That is one path, and it moves from left to right as the number of samples grows.
The rest of the narration is in the book's Companion.
More from Chapter 16
Interactive1:46The Reparameterization Trick: Differentiable SamplingChapter 16
Preview1:42Mean Field: Independent Factors for a Correlated PosteriorChapter 16
Preview1:45Posterior Collapse: When Latents Vanish into the PriorChapter 16
Preview1:36Expectation Maximization: Coordinate Ascent on the Lower BoundChapter 16
Preview1:55Importance-Weighted BoundsChapter 16