Monte Carlo Methods & Variance Reduction
Monte Carlo replaces an expectation or integral with random draws and reports the sampling error of the resulting estimator. Importance sampling, control variates, stratification, Markov-chain Monte Carlo, and Gibbs updates change how evidence is obtained; diagnostics must distinguish target invariance from finite-run mixing and effective information.
Monte Carlo methods estimate a quantity by sampling rather than exhaustive summation or deterministic quadrature. They are especially valuable when dimension makes a regular grid impossible: doubling resolution in each of dimensions multiplies grid work by , whereas ordinary Monte Carlo's root-mean-square error remains proportional to under finite variance. That rate is slow, but it does not deteriorate directly with dimension.
Estimation begins with an expectation #
Suppose the target is
For independent draws ,
is unbiased, with variance . An estimated Monte Carlo standard error (MCSE) is
where is the sample standard deviation of the evaluated quantity. Reporting only hides numerical uncertainty from finite simulation.
To reduce independent-sampling error by a factor of ten requires roughly one hundred times as many draws. Better algorithms therefore try to reduce variance per unit cost, not merely increase .
Variance reduction uses structure #
Antithetic and stratified sampling #
Antithetic draws couple samples so their errors tend to cancel; for a monotone function under a uniform input, pairing with is a common example. Stratification divides the input space into regions and samples each, preventing random omission of important strata. Both require a structure that actually correlates with .
Control variates #
If has known expectation , estimate
The optimal scalar reduces variance when tracks . Estimating from the same data needs care in finite samples.
Importance sampling #
When direct draws from are hard but a proposal is easy,
The proposal must cover every region where matters. A few extreme weights create a formally correct but practically unstable estimator. Inspect normalized weights, tail behavior, and effective sample size; a large raw sample does not compensate for missing support.
MCMC trades independence for accessible transitions #
Markov-chain Monte Carlo constructs a transition kernel whose invariant distribution is the target . After initialization and finite transitions, states are correlated and may still reflect the start. For a scalar estimand, the variance of the sample mean is approximately
where accounts for autocorrelation. ESS and MCSE belong to a particular parameter or function; there is no single chain-wide sample quality number.
Run multiple dispersed chains. Rank-normalized split- compares between- and within-chain behavior and can reveal nonstationarity or scale disagreement; bulk and tail ESS quantify different regions. Values near one for are necessary evidence, not proof that all modes were found. A shared initialization in one mode can make every chain agree on the wrong region.
Warmup adapts and moves chains toward typical regions; discarding a finite prefix cannot guarantee convergence. Thinning usually throws away information and should be used for storage constraints, not as a cure for autocorrelation. A better transition kernel or longer run is the remedy.
Gibbs sampling uses full conditional distributions #
For a joint target , a systematic Gibbs sweep draws
Each update uses the newest available coordinates. To see why one coordinate update preserves the joint target, suppose . Keep and redraw . Then
Composing invariant coordinate kernels yields an invariant sweep. This explains correctness at stationarity; it does not establish irreducibility or fast mixing from an arbitrary start.
Block Gibbs samples several strongly coupled variables jointly. Random-scan Gibbs selects coordinates randomly; systematic scan applies a fixed order. Both can preserve the target under appropriate conditions, but they can have different reversibility and convergence rates.
Worked bivariate-normal Gibbs sampler #
For a standard bivariate normal with correlation ,
the full conditionals are
When is small, alternating draws move freely. As , the conditional variance shrinks and the chain advances in small correlated steps along a narrow diagonal. The target is unchanged, but ESS per sweep collapses. Joint rotation, blocking, or a different sampler addresses geometry that more iterations only brute-force.
Gibbs in Boltzmann machines #
An RBM's bipartite graph makes hidden units independent given the visible layer and visible units independent given the hidden layer. One block Gibbs step can therefore update an entire layer in parallel. Contrastive divergence begins near data and uses only a short chain, so its negative sample is intentionally not a converged independent draw from the model. That bias is an optimization approximation and must not be described as exact maximum likelihood.
A reproducible Monte Carlo report #
Record the target, estimand, sampler and transition parameters, initialization, warmup/adaptation, saved draws, independent chains, random seeds, ESS, MCSE, , trace/autocorrelation checks, and any divergences or mode-specific behavior. For importance sampling, add proposal support and weight diagnostics. For Gibbs, add scan order, blocks, and conditional parameterization.
Simulation produces an estimate plus simulation error. A method is not validated by producing many numbers; it is validated by showing that its draws explore the intended target and that the remaining Monte Carlo uncertainty is small enough for the decision.