Terms Developed in Context
The terms below connect the mathematical model, implementation choices, computed diagnostics, and limits of the scientific claim.
- Rare event
An outcome with small target probability that is difficult to estimate by ordinary sampling. In this lecture it is used to address Can importance sampling reduce variance without changing the target expectation?
Model connection: Read the term against Importance sampling and the governing relation \(\mathbb E_p[f(X)]=\mathbb E_q\left[f(X)\frac{p(X)}{q(X)}\right]\). The relevant computational evidence is a controlled output, residual, invariant, or refinement sequence rather than visual smoothness alone.
Interpretive limit: A lower standard error in one seeded run is not a guarantee; compare repeated independent seeds or analytic variance and never omit likelihood weights. This distinction separates numerical behavior from physical accuracy and model adequacy.
- Importance sampling
Sampling from a proposal distribution and weighting outcomes to recover a target expectation. In this lecture it is used to address Can importance sampling reduce variance without changing the target expectation?
Model connection: Read the term against Proposal distribution and the governing relation \(\mathbb E_p[f(X)]=\mathbb E_q\left[f(X)\frac{p(X)}{q(X)}\right]\). The relevant computational evidence is a controlled output, residual, invariant, or refinement sequence rather than visual smoothness alone.
Interpretive limit: A lower standard error in one seeded run is not a guarantee; compare repeated independent seeds or analytic variance and never omit likelihood weights. This distinction separates numerical behavior from physical accuracy and model adequacy.
- Proposal distribution
The alternative probability law from which simulated samples are drawn. In this lecture it is used to address Can importance sampling reduce variance without changing the target expectation?
Model connection: Read the term against Likelihood ratio and the governing relation \(\mathbb E_p[f(X)]=\mathbb E_q\left[f(X)\frac{p(X)}{q(X)}\right]\). The relevant computational evidence is a controlled output, residual, invariant, or refinement sequence rather than visual smoothness alone.
Interpretive limit: A lower standard error in one seeded run is not a guarantee; compare repeated independent seeds or analytic variance and never omit likelihood weights. This distinction separates numerical behavior from physical accuracy and model adequacy.
- Likelihood ratio
The target-density to proposal-density weight applied to each sampled outcome. In this lecture it is used to address Can importance sampling reduce variance without changing the target expectation?
Model connection: Read the term against Effective sample size and the governing relation \(\mathbb E_p[f(X)]=\mathbb E_q\left[f(X)\frac{p(X)}{q(X)}\right]\). The relevant computational evidence is a controlled output, residual, invariant, or refinement sequence rather than visual smoothness alone.
Interpretive limit: A lower standard error in one seeded run is not a guarantee; compare repeated independent seeds or analytic variance and never omit likelihood weights. This distinction separates numerical behavior from physical accuracy and model adequacy.
- Effective sample size
A diagnostic of how weight concentration reduces the information content of weighted samples. In this lecture it is used to address Can importance sampling reduce variance without changing the target expectation?
Model connection: Read the term against Rare event and the governing relation \(\mathbb E_p[f(X)]=\mathbb E_q\left[f(X)\frac{p(X)}{q(X)}\right]\). The relevant computational evidence is a controlled output, residual, invariant, or refinement sequence rather than visual smoothness alone.
Interpretive limit: A lower standard error in one seeded run is not a guarantee; compare repeated independent seeds or analytic variance and never omit likelihood weights. This distinction separates numerical behavior from physical accuracy and model adequacy.
Problem and physical meaning
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.
Can importance sampling reduce variance without changing the target expectation? Begin from the scientific observable or state variable, and name what is directly specified versus inferred. The model should be simple enough to validate, but not quietly presented as the entire astrophysical system.
Model and derivation
The governing expression for this lecture is:
Define the symbols and the independent variable before numerical evaluation. Dimensional analysis checks that both sides have matching units; if the model is dimensionless, state the adopted scale factors and the transformation back to physical units.
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.
Numerical implementation
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.
Keep physical quantities and numerical arrays conceptually separate. Convert units at well-defined boundaries, preserve raw inputs, and record dtype, solver, tolerances/timestep, grid, and software versions. A numerical method is part of the model evidence, not an invisible implementation detail.
Worked, programmatically computed example
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.
These values are generated in src/astr474_computations.py, then shared with lecture/lab/assignment renderers. Re-run the generator after changing an input; do not hand-edit a displayed result without recomputing dependent artifacts.
At least one independent check is required: an analytic solution, a second numerical method, a conservation law, or a controlled convergence sequence. When these disagree, diagnose units, frame, discretization, source terms, and model scope before selecting a result.
Error budget and limitations
A lower standard error in one seeded run is not a guarantee; compare repeated independent seeds or analytic variance and never omit likelihood weights.
Classify each uncertainty before combining terms: local/global solver error, timestep or spatial discretization, Monte Carlo sampling, parameter uncertainty, measurement uncertainty, and model discrepancy are not interchangeable. Conservation can test internal consistency but does not prove the model is physically complete.
Connection to evidence and research practice
Lab 06 compares ordinary and tilted Bernoulli estimators of a rare transmission probability.
For real parameters, the source record distinguishes the fetched product and epoch from derived values. For synthetic experiments, the initial conditions, generator, seed, and exact file are recorded. A simulation is not an observation, even when its parameters resemble a real object.
Misconceptions to avoid
- More displayed digits do not imply more physical accuracy.
- A successful solver exit or smooth plot does not establish convergence.
- Agreement between two solvers with the same wrong model is not independent physical validation.
- A formal covariance or Monte Carlo interval is conditional on the adopted model and noise process.
Study and review questions
- Can importance sampling reduce variance without changing the target expectation?
- Which numerical parameter would you vary first, what observable would you track, and how would you know the sequence reached an asymptotic regime?
- Design one independent check and state what failure would change your scientific interpretation.
Preparation for the next lecture: explain how this method's assumptions change when the problem becomes more coupled, stochastic, or data-driven.
Lecture-specific derivation and assumptions
For target density p(x) and proposal q(x), require q(x)>0 wherever f(x)p(x) is nonzero. Then E_q[f(X)p(X)/q(X)]=integral f(x)p(x) dx=E_p[f(X)], proving unbiasedness. For a Bernoulli success indicator under target probability p and proposal q, the weighted contribution is p/q on success and zero on failure. Weight variability controls variance; effective sample size is often summarized by (sum w)^2/sum(w^2), but it does not replace direct uncertainty analysis.
Algorithm trace and computed-output interpretation
At tau=4, compute the exact rare-event probability and compare N=10,000 ordinary draws with proposal q=0.2. Apply p/q only to proposal successes, retain the zero contribution for failures, and calculate the sample standard error from weighted contributions. Derive the likelihood ratio before sampling and repeat independent seeds; a single result with lower error is not proof that the proposal is universally superior.
Computed result: 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.
The proposal changes the sampling law, not the target scientific quantity. A proposal with insufficient support creates bias; extreme weights can make nominally large N behave like a much smaller effective sample. For this two-outcome example, all weights and variance can be calculated exactly, providing a useful audit of the implementation.
Two-meeting teaching arc
Each weekly module is taught in two 75-minute meetings. The sequence below includes a formative check in each meeting and is intended to use the lecture's worked computation, not merely present it.
- Meeting 1 (75 min): 10 min rare-event problem; 20 min change-of-measure derivation; 20 min Bernoulli likelihood weights; 20 min support and variance; 5 min predict a bad proposal failure.
- Meeting 2 (75 min): 10 min recap; 20 min compute ordinary and weighted estimates; 25 min compare independent seeds and ESS; 15 min diagnose weight concentration; 5 min identify when to reject the estimator.
Targeted study questions
- What support condition is needed for unbiased importance sampling?
- Derive the variance of the weighted Bernoulli estimator as a function of q.
- Choose q to minimize that variance and explain why a practical proposal may not know the optimum.
References and provenance: course reference log. Generated 2026-09-27.