Lesson 2 of 3 · Importance sampling for rare events
Oversample rare paths without overstating their probability
20 minute lesson · 3 checks along the way
Your goal for this lessonRecover a target impact probability from deliberately biased computational samples and diagnose missing support or incorrect normalization.
In this lesson 4 sections · 3 checks
Read & understand
Recognize why a rare event can be absent from a sample
Suppose a fully specified fictional orbit model assigns impact probability 0.0001. If 1,000 independent simulations draw from that model, the probability that none impacts is (1 − 0.0001)^1000 ≈ 0.904833. Zero observed impacts is therefore quite likely even though the model probability is nonzero. Increasing simulation count helps, but rare events can make direct sampling expensive. The Sentry-II method paper describes importance sampling as one part of a much richer impact-monitoring calculation; the small discrete example here isolates its weighting principle.
Partition a fictional state space into four mutually exclusive, exhaustive bins A, B, C and D. Their target probabilities q are [0.9997, 0.0002, 0.00009, 0.00001], which sum to one. Only C and D lead to impact in this stipulated model, so the exact answer is qC + qD = 0.0001. Real analyses do not receive a four-bin table with known truth. We deliberately supply it so every computational step can be checked independently and a mistaken estimator cannot hide behind an unknown answer.
Read & understand
Sample a proposal and restore the target weights
Instead of drawing from q, choose a proposal p = [0.25, 0.25, 0.25, 0.25]. It visits the rare impact bins much more often. A sampled state i receives importance weight wi = qi/pi, giving [3.9988, 0.0008, 0.00036, 0.00004]. Define Ii as one for an impacting state and zero otherwise. For N independent proposal draws, estimate the target probability with P̂ = (1/N)Σ Iiwi. A state that the proposal overrepresents receives a small weight; the ratio is target divided by proposal, not its inverse.
Imagine one realization containing one draw from each bin, N = 4. Its estimate is (0 + 0 + 0.00036 + 0.00004)/4 = 0.0001, while its raw impact fraction is 2/4 = 0.5. That large raw fraction describes our sampling design, not a changed asteroid hazard. The identity Eₚ[Iq/p] = Σ pi Ii qi/pi = Σ Ii qi explains the correction. Exact agreement in this balanced realization is convenient, not a promise that four random draws will always contain one of each state.
Check 1 of 3
10 pointsUse the reading above. You can try again without losing points.
Read & understand
Distinguish sample variation from a changed physical model
A second possible realization has counts [2,3,1,2], so N = 8. Its weighted impact sum is 0.00036 + 2×0.00004 = 0.00044; dividing by eight gives 0.000055. The raw impact fraction, 3/8 = 0.375, again answers the wrong question. The different weighted result reflects finite sampling with the same target model. It does not show that new observations changed the orbit. For this known-normalization estimator, divide by the number of draws. Dividing by the sum of realized weights creates a different, self-normalized estimator.
An alternate proposal p = [0.7,0.1,0.15,0.05] with counts [7,1,1,1] has N = 10. Its impacting weights are 0.00009/0.15 = 0.0006 and 0.00001/0.05 = 0.0002, giving P̂ = 0.00008; the raw fraction is 0.2. Alternatively, change the target to q = [0.9994,0.0004,0.00015,0.00005], restore the uniform proposal and use counts [1,2,2,3]. The estimate is [2×0.0006 + 3×0.0002]/8 = 0.000225, compared with that new target’s exact 0.0002. State explicitly whether a comparison changes sampling, evidence or both.
Oversample a rare event; restore its weight
Original discrete importance-sampling example. Correct weighting does not eliminate finite-sample variation or repair a proposal that omits a contributing target region.
Open full-size diagram in a new tab: Oversample a rare event; restore its weightCheck 2 of 3
10 pointsUse the reading above. You can try again without losing points.
Read & understand
Check support and precision before trusting the estimate
The proposal must have positive probability wherever the target’s impact contribution is nonzero. If pD = 0 while qD = 0.00001 and D impacts, no number of proposal draws can represent that missing contribution. A calculation covering only C would miss ten percent of the original total. More samples cannot repair absent support. Non-impacting states contribute zero to this particular integral; estimating other quantities can require broader support. Choose the requirement for the actual quantity being calculated rather than treating one successful estimate as universal validation.
Weighting alone also does not guarantee useful precision. With independent draws, variance of the sample mean is the single-draw variance divided by N. For the original uniform proposal, E[(Iq/p)²] = 0.25×0.00036² + 0.25×0.00004² = 3.28×10⁻⁸. Subtracting P² leaves 2.28×10⁻⁸, versus P(1−P) = 9.999×10⁻⁵ for direct indicator sampling. This favorable example does not make every proposal good. Inspect support, weight concentration, estimator uncertainty and dynamical assumptions before turning a computational result into a statement about a real object.
Check 3 of 3
10 pointsUse the reading above. You can try again without losing points.
Put it together
Your lesson progress
Each check connects to a part of the story. Complete all 3 to earn your 25-point lesson bonus.
Explore further · Optional
Go to the source
Explore the evidence behind this lesson. These optional readings and videos open in a new tab.