ASTR 474 · Computational Astrophysics · Lecture 10

Lecture 10: Monte Carlo Radiation and Rare Events

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

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.

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.

\[\mathbb E_p[f(X)]=\mathbb E_q\left[f(X)\frac{p(X)}{q(X)}\right]\]

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.

  1. Write the model and its assumptions.
  2. Choose a solver and identify its stability, accuracy, and conservation properties.
  3. Record configuration, tolerances or timestep, and output sampling.
  4. Compare against an analytic limit, independent method, or controlled refinement.

Visual reasoning

Ordinary and likelihood-weighted rare-event estimates

Rare-event estimators with uncertainty barsTwo independent Monte Carlo estimators are compared with the exact transmission probability; likelihood weighting changes both the estimate and its sampling variance. ordinaryweighted exact p=e^-4estimated probability (error bars: one standard error)
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?

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

  1. Does the implemented equation match the intended physical model?
  2. Does the numerical result converge under a controlled method change?
  3. 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.

Sources

Technical references

Data and provenance details are recorded in reference-log.md. Last updated 2026-09-27.