Can importance sampling reduce variance without changing the target expectation?
14-week course · 3 credits · Week 10
Motivation
Can importance sampling reduce variance without changing the target expectation?
Importance sampling draws from a proposal distribution that oversamples rare outcomes, then corrects every draw by the target-to-proposal likelihood ratio. The estimator stays unbiased when support is adequate, but variance can rise if weights are unstable.
Today’s result must be interpretable as a physical statement with declared data, algorithm, uncertainty, and a check that could fail.
Learning objectives
After this lecture, you can
Can importance sampling reduce variance without changing the target expectation?
Define target and proposal distributions
A lower standard error in one seeded run is not a guarantee; compare repeated independent seeds or analytic variance and never omit likelihood weights.
Core language
Terms for This Lecture
Rare event
Definition: An outcome with small target probability that is difficult to estimate by ordinary sampling.
Why it matters here: It helps answer Can importance sampling reduce variance without changing the target expectation? within the numerical model described here.
Relationships: Connect it to Importance sampling, the governing expression \(\mathbb E_p[f(X)]=\mathbb E_q\left[f(X)\frac{p(X)}{q(X)}\right]\), and the computed diagnostic developed later in the lecture.
Boundary or common confusion: A lower standard error in one seeded run is not a guarantee; compare repeated independent seeds or analytic variance and never omit likelihood weights.
Importance sampling
Definition: Sampling from a proposal distribution and weighting outcomes to recover a target expectation.
Why it matters here: It helps answer Can importance sampling reduce variance without changing the target expectation? within the numerical model described here.
Relationships: Connect it to Proposal distribution, the governing expression \(\mathbb E_p[f(X)]=\mathbb E_q\left[f(X)\frac{p(X)}{q(X)}\right]\), and the computed diagnostic developed later in the lecture.
Boundary or common confusion: A lower standard error in one seeded run is not a guarantee; compare repeated independent seeds or analytic variance and never omit likelihood weights.
Proposal distribution
Definition: The alternative probability law from which simulated samples are drawn.
Why it matters here: It helps answer Can importance sampling reduce variance without changing the target expectation? within the numerical model described here.
Relationships: Connect it to Likelihood ratio, the governing expression \(\mathbb E_p[f(X)]=\mathbb E_q\left[f(X)\frac{p(X)}{q(X)}\right]\), and the computed diagnostic developed later in the lecture.
Boundary or common confusion: A lower standard error in one seeded run is not a guarantee; compare repeated independent seeds or analytic variance and never omit likelihood weights.
Likelihood ratio
Definition: The target-density to proposal-density weight applied to each sampled outcome.
Why it matters here: It helps answer Can importance sampling reduce variance without changing the target expectation? within the numerical model described here.
Relationships: Connect it to Effective sample size, the governing expression \(\mathbb E_p[f(X)]=\mathbb E_q\left[f(X)\frac{p(X)}{q(X)}\right]\), and the computed diagnostic developed later in the lecture.
Boundary or common confusion: A lower standard error in one seeded run is not a guarantee; compare repeated independent seeds or analytic variance and never omit likelihood weights.
Effective sample size
Definition: A diagnostic of how weight concentration reduces the information content of weighted samples.
Why it matters here: It helps answer Can importance sampling reduce variance without changing the target expectation? within the numerical model described here.
Relationships: Connect it to Rare event, the governing expression \(\mathbb E_p[f(X)]=\mathbb E_q\left[f(X)\frac{p(X)}{q(X)}\right]\), and the computed diagnostic developed later in the lecture.
Boundary or common confusion: A lower standard error in one seeded run is not a guarantee; compare repeated independent seeds or analytic variance and never omit likelihood weights.
Physical and mathematical model
State what is being evolved
Importance sampling draws from a proposal distribution that oversamples rare outcomes, then corrects every draw by the target-to-proposal likelihood ratio. The estimator stays unbiased when support is adequate, but variance can rise if weights are unstable.
Define the state, coordinates, units, initial/boundary conditions, and domain before interpreting solver output.
Numerical method
Algorithm choice is a modeling decision
Define target and proposal distributions; derive weights before sampling; compare estimates and standard errors under independent seeds; inspect weight concentration and effective sample size; retain an exact benchmark.
Write the model and its assumptions.
Choose a solver and identify its stability, accuracy, and conservation properties.
Record configuration, tolerances or timestep, and output sampling.
Compare against an analytic limit, independent method, or controlled refinement.
Visual reasoning
Ordinary and likelihood-weighted rare-event estimates
The exact probability is calculated from tau=4; estimates and standard errors are produced from fixed, recorded seeds.
Computed example
One result, with a check
At N=10000, ordinary-sampling standard error is 0.0013723; the likelihood-weighted proposal gives 0.00036502. One run is evidence for this seed, not a universal variance guarantee.
Inputs and method are generated by src/astr474_computations.py; the machine-readable values are in data/generated/computed_results.json.
A lower standard error in one seeded run is not a guarantee; compare repeated independent seeds or analytic variance and never omit likelihood weights.
Verification
What would falsify this result?
Repeat with a smaller timestep, tighter tolerance, or finer spatial grid.
Track conservation or residual structure in addition to visual agreement.
Check units, coordinate frame, boundary conditions, and invariants independently.
Change a random seed when the method is stochastic; report the resulting sampling uncertainty.
Do not report a smoother curve as proof of convergence.
Failure modes
Numerical agreement has a domain
A lower standard error in one seeded run is not a guarantee; compare repeated independent seeds or analytic variance and never omit likelihood weights.
Solver error, discretization error, stochastic error, parameter uncertainty, and model discrepancy are different quantities. Diagnose and report them separately.
Active reasoning
Make a prediction before rerunning
Can importance sampling reduce variance without changing the target expectation?
State a measurable outcome, a competing explanation, and the smallest computation that distinguishes them. Include an expected direction or scaling, then test it.
Workflow
From parameters to auditable output
Define target and proposal distributions; derive weights before sampling; compare estimates and standard errors under independent seeds; inspect weight concentration and effective sample size; retain an exact benchmark.
Record the exact command, package versions, data path, random seed if applicable, and output checksum. Keep raw inputs unchanged and generated files separate.
Transfer
Lab and problem-set connection
Lab 06 compares ordinary and tilted Bernoulli estimators of a rare transmission probability.
Submit plots with labeled axes/units, a concise uncertainty argument, and enough code or intermediate values for a peer to reproduce the claim.
Synthesis
Three durable checks
Does the implemented equation match the intended physical model?
Does the numerical result converge under a controlled method change?
Does the interpretation stay inside the validity and provenance limits?
A lower standard error in one seeded run is not a guarantee; compare repeated independent seeds or analytic variance and never omit likelihood weights.