Skip to simulator
DondeRinde Quant Lab
Home / Quant Lab / Monte Carlo Simulator

QUANT LAB · STOCHASTIC SIMULATION (DISCRETE MONTHLY GBM)

Monte Carlo Simulator

Explore how expected return, volatility, inflation, and periodic monthly contributions shape the distribution of terminal wealth. Runs locally inside a dedicated Web Worker with deterministic seeds.

Preparing simulation...

Terminal wealth distribution (P5–P95 percentiles)

Terminal VaR & CVaR (full horizon)

Methodological distinction: these metrics measure cumulative horizon-end loss at year T relative to contributed capital (positive = loss; negative means the tail still stayed above contributed capital). They are distinct from single-period VaR/CVaR in the Financial Risk Calculator.

Interactive percentile fan chart

Move your pointer across the chart to inspect P5, P25, P50, P75, P95, and contributed capital for any year.

Terminal wealth histogram

Yearly percentile table

Year Contributed P5 P25 P50 (Median) P75 P95

TECHNICAL & EDUCATIONAL DOCUMENTATION

Formulas, methodology, limitations & interpretation

Model equations (discrete monthly GBM)

Single log-normal stochastic process with monthly step Δt = 1/12 and continuous drift μ_c = ln(1 + r_nom):

G_m = exp((μ_c − 0.5 · σ²) · Δt + σ · √Δt · Z_m),   Z_m ~ N(0, 1)
W_m = W_{m−1} · G_m + C   (end-of-month contribution)
W_m^real = W_m / (1 + π)^(m/12)
K_real = W_0 + Σ_{m=1..M} C / (1 + π)^(m/12)
VaR_α^terminal = −Q_{1−α}(R_T),   CVaR_α^terminal = −(1/k) Σ_{i=1..k} R_{T,(i)}

Where R_T = (W_M − K) / K is cumulative terminal return and k = ceil((1 − α) · P) matches the discrete empirical tail convention in quantlab/simulation.py.

Random generation & reproducibility

Uniform draws come from a deterministic 32-bit Mulberry32 PRNG transformed via Box-Muller (with lower guard u₁ ≥ 10⁻¹⁵) inside a Web Worker.

When σ = 0, the engine recovers deterministic compounding exactly; when C = 0, the theoretical median W₀ · exp((μ_c − 0.5σ²)T) sits below the mean W₀ · (1 + r_nom)^T due to volatility drag.

Educational interpretation

  • Median (P50) vs. mean: compounded log-normal wealth is right-skewed; extreme upside paths pull the mean above the typical path (P50).
  • Dispersion bands (P25–P75 & P5–P95): show how sequence-of-returns uncertainty widens outcomes even with identical discipline.
  • Real vs. Nominal: deflating by inflation reveals today’s purchasing power equivalent.

Explicit model limitations

  • Not a forecast: outputs depend strictly on user-supplied assumptions.
  • No fat tails or jumps: GBM assumes i.i.d. normal log-returns; real markets exhibit crises, volatility clustering, and regime shifts.
  • Taxes & fees excluded: no capital-gains taxes, withholding, spreads, or brokerage fees are modeled.
  • Constant inflation: actual inflation fluctuates and can correlate with asset returns.

References

  • Glasserman, P. (2003). Monte Carlo Methods in Financial Engineering. Springer.
  • Hull, J. C. (2022). Options, Futures, and Other Derivatives. Pearson.
  • Acerbi, C., & Tasche, D. (2002). On the coherence of Expected Shortfall. Journal of Banking & Finance, 26(7), 1487–1503.
  • Jorion, P. (2007). Value at Risk: The New Benchmark for Managing Financial Risk. McGraw-Hill.