There isn't a single "best" approach. In practice, institutional stress-testing platforms often combine multiple simulation methods because each captures different kinds of risk.
Here's how the main approaches compare:
| Method | Strengths | Weaknesses | Best for |
|---|
| Historical resampling (bootstrap/block bootstrap) | Preserves real market relationships and fat tails | Can't generate events worse than history unless modified | VaR, backtesting, portfolio stress |
| Monte Carlo (stochastic models) | Unlimited scenarios, controllable assumptions | Model risk; may miss complex dependencies | Pricing, derivatives, long-horizon forecasts |
| Agent-based simulation | Captures market microstructure, feedback loops, liquidity crises | Hard to calibrate and computationally expensive | Flash crashes, contagion, market structure research |
| Regime-switching models | Captures bull/bear transitions | Depends on estimating hidden states | Strategic asset allocation |
| GANs / Diffusion models | Can generate realistic synthetic market paths | Still an active research area; validation is challenging | Data augmentation, research |
Historical resampling
This is often the first recommendation if your goal is realistic portfolio stress testing.
Variants include:
- IID bootstrap
- Moving block bootstrap
- Stationary bootstrap
- Circular bootstrap
These preserve autocorrelation and cross-asset correlations much better than naïve Monte Carlo.
Good Python tools:
arch
tsbootstrap
statsmodels
Agent-based models
These become valuable when market dynamics themselves matter.
Typical agent types:
- Market makers
- High-frequency traders
- Fundamental investors
- Momentum traders
- Arbitrageurs
- Retail investors
Emergent behaviors include:
- Liquidity evaporation
- Volatility clustering
- Order-book imbalance
- Flash crashes
- Contagion
Popular frameworks:
Monte Carlo improvements
Rather than assuming geometric Brownian motion, many practitioners use richer models:
- Heston stochastic volatility
- SABR
- GARCH
- EGARCH
- Jump diffusion (Merton)
- Hawkes processes for order arrivals
- Regime-switching Hidden Markov Models
These produce much more realistic volatility clustering.
Hybrid approaches
Many quantitative teams combine methods, for example:
- Estimate market regimes from historical data.
- Resample within each regime.
- Inject extreme shocks beyond historical observations.
- Simulate agent reactions (liquidity withdrawal, deleveraging).
- Reprice portfolios and compute losses.
This captures both realistic statistical behavior and endogenous market dynamics.
Useful open-source frameworks
If you're working in Python:
- ABIDES — detailed market microstructure simulation.
- Mesa — flexible agent-based modeling.
- QuantLib — derivatives pricing and Monte Carlo engines.
- Backtrader — strategy backtesting (not a market simulator itself).
- vectorbt — fast portfolio simulations over many scenarios.
- arch — volatility models and bootstrap tools.
- PyPortfolioOpt — portfolio optimization that pairs well with stress-testing pipelines.
Recommendation by use case
- Portfolio risk management: historical resampling + GARCH volatility is often a strong balance of realism and simplicity.
- Exchange or market microstructure research: ABIDES is a leading open-source choice.
- Systemic risk or contagion analysis: agent-based models built with Mesa or ABIDES.
- Derivatives and structured products: Monte Carlo with stochastic volatility models using QuantLib or custom implementations.
- Research into rare events: combine historical resampling with synthetic tail-event generation and, if relevant, agent-based market dynamics.
For institutional-quality stress testing, a hybrid architecture—historical resampling for realistic dependence structures, enhanced with stochastic volatility models and an agent-based execution layer for liquidity effects—tends to provide broader coverage than relying on any single simulation paradigm.