Monte Carlo Simulation (Empirical Probabilities)

Context: FIT2086_MOC · W10 opens the simulation half of LO4 — replace mathematical ingenuity with computational power · convergence is the WLLN from Expectations and Covariance (FIT2086) · draws come from a PRNG via R Simulation and Random Sampling · applied to estimators in Monte Carlo Estimator Comparison, to the data itself in Bootstrap and Permutation Tests Parent Framework: Statistical Modelling and Inference

Quick Revision

  • 🎯 Objective: any ➔ simulate draws ➔ average the indicators ➔ WLLN guarantees convergence ➔ answers problems with no closed form.
  • 📦 Core Components: generate ➔ check ➔ average ➔ converge | resolution ➔ need .
  • ⚡ Key Constraint: an event rarer than is usually never observed ⟹ estimate ; size so the event is expected many times.

📝 How It Works

1. The General Problem

  • Target ➔ RVs and a set ➔ find .
  • Hard by hand ➔ : · , : ➔ answerable analytically but hard; trivial to pose ones that are impossible. Simulation always gives an answer.
  • Buffon’s needle (18th c.) ➔ needs integral geometry; simulation needs nothing: drop, record, repeat, estimate (e.g. ).

2. The Algorithm

  1. Generate ➔ from their joint distribution, .
  2. Check ➔ if the condition holds, otherwise.
  3. Average ➔ — the empirical probability.
  4. Converge ➔ larger ⟹ more accurate.

3. Resolution and Rare Events

  • Resolution ➔ = the smallest non-zero probability the estimate can take; the estimate moves in steps of .
  • Rare events ➔ cannot be estimated well ⟹ choose .
  • Break Q1 ➔ event seen times in ⟹ ; as .

4. Beyond Probabilities

  • Any distribution summary ➔ x draws from : mean(x) · var(x) · quantile(x, 0.2) · hist(x, probability = TRUE) ➔ all sharpen as grows.

🧮 Proof Blueprint

  • Theorem ➔ as .
  • Strategy ➔ each indicator is a Bernoulli RV ⟹ is a sample mean ⟹ WLLN.
  • Derivation Steps:
  • Q.E.D. ➔ the empirical probability is consistent for ; being a Bernoulli mean, its variance is (Studio 4 drill) — why small- runs wobble.

⚙️ Core Implementation

🔹 Monte Carlo in two lines of R

📊 Exam Execution Trace & Applied Exercises

Manual Execution Trace

, target :

Resolution Estimate
  • Reading ➔ convergence is not monotone ( is no closer than ) — each run is random; only the typical error shrinks.

Applied Exercise

Problem: derive the exact value the simulation chases: , , find — the slide’s CDF route, then the shortcut.

Final Extracted Output: . The slides print ; — a rounding slip on the slide, and the run () agrees with to within simulation error.

⚠️ Common Mistakes

  • 💡 too small for a rare event ➔ is not evidence that ; it means .
  • 💡 Sampling each from the wrong law ➔ draw from the joint distribution; independent marginals are only valid when the are independent.
  • 💡 No seed ➔ the estimate changes every run; set.seed() first when the number must be reproduced (Pseudo-Random Number Generators).

🧠 Active Recall