Advanced sampling and rare eventsLesson 66 of 76 · 9 min
See a rare event more often
Estimate a rare normal-tail probability with a shifted proposal and correct weights.
Naive Monte Carlo can miss an event whose probability is far smaller than one divided by the trial budget. A zero event count then provides little relative precision. Importance sampling can deliberately visit the rare region more often while correcting the changed sampling distribution.
For a standard normal tail above five, draw instead from a normal distribution centred at five. The event now occurs often under the proposal. Multiply its indicator by the target-to-proposal ratio to estimate the original target probability.
The proposal hit rate is not the target event probability. Report weighted contributions and their MCSE, the proposal definition and an exact reference where available. For other rare events, a poor proposal can give unstable or misleading estimates despite many apparent hits.
is 1 for a proposal draw above five and 0 otherwise; w(X) is the target-to-proposal density ratio.
- Target event
- Sample nearer the event
- Return to the target scale
If half the shifted-proposal draws exceed five, is the standard-normal tail probability one half?
Write a prediction (optional)
Seeded teaching simulation
Select Run Python below with the code unchanged.
A saved draft is open. To run the published example, open Tools and select Restore example. Recover draft brings your code back.
Execution error
Technical error details
Your result
Published example output
This result comes from the original Python. Your runs appear above. Build environment ↗
Naive target hits: 0 of 30000 Proposal hit fraction: 0.4997 Importance estimate: 2.828881e-07 Estimated MCSE: 3.875393e-09 Exact target tail: 2.866516e-07
Read the first result
The weighted estimate returns to the original target scale. The shifted proposal’s frequent hits only make that target easier to estimate.
Try an edit
Change the last value in n, threshold, shift = 30000, 5, 5 to 3 and run. Then change that last value to 7. Select Run Python again. Compare Proposal hit fraction, Estimated MCSE and the distance from Importance estimate to Exact target tail. Does a higher hit fraction guarantee lower numerical error?
Scope. The normal-tail reference is exact for this model. Rare-event validity in an operational model still depends on its structure and input evidence.
Try a fresh case
Which number estimates the original rare-event probability?
Need a hint?
Hint 1
Write the target and proposal separately.
Hint 2
Apply the density correction before averaging the indicator.