A quantitative finance research package studying Monte Carlo option pricing, variance reduction, convergence rates, Greeks estimation, and optimal stopping for early-exercise derivatives.
- European MC converges to Black–Scholes at empirical rate O(N^−1/2) ✓ verified across 1K–100K paths
- 100K paths: $6.0394 (MC) vs $6.0401 (BS) | error within 1 standard error
- Terminal sampling: Efficient direct sampling without storing full paths
| Method | SE @ 50K paths | Reduction Factor | Interpretation |
|---|---|---|---|
| Standard MC | $0.0562 | baseline | — |
| Antithetic Variates | $0.0439 | 1.28× | SE reduced by 22% |
| Control Variates | $0.0289 | 1.94× | SE reduced by 49% |
Reduction Factor: How many times smaller the standard error is relative to Standard MC.
Arithmetic Asian with geometric control: ~80× variance reduction (geometric exactly matches log-normal distribution under GBM)
- MC Greeks vs analytical: Delta ±0.002, Gamma ±0.0003, Vega ±0.001 | all with common random numbers
- Newton-Raphson IV solver: Converges in 3 iterations | recovers 20% vol from price to 0.0002 error
- LSM vs CRR binomial: 0.3–1.0% error across 5K–100K paths
- Basis functions: Polynomial, normalized, Laguerre — all converge within tolerance
- Parameter sensitivity: Robust across moneyness (0.8–1.2), volatility (10–40%), maturity (0.25–2.0y)
- Arithmetic Asian pricing: MC essential (no closed form)
- Geometric control variate: ~80× variance reduction without extra paths
Theoretical and empirical RMSE decline on log-log axes. All three variance-reduction methods follow the same convergence rate (parallel slopes), with variance reduction lowering the constant factor.
Antithetic Variates achieve ~1.2-1.5× reduction; Control Variates achieve ~1.8-2.3× reduction. The flat profiles show that reduction factors are stable across path counts.
pip install -e .Or install with development dependencies:
pip install -e ".[dev]"Then run tests:
pytestfrom mcoptions import price_european_option_mc_terminal, black_scholes_call
# Efficient terminal sampling
result = price_european_option_mc_terminal(
S0=100, K=110, T=1.0, r=0.05, sigma=0.20,
num_simulations=100_000, seed=42
)
print(f"MC Price: ${result['price']:.4f}")
print(f"95% CI: {result['confidence_interval']}")
# Validate against analytical
bs_price = black_scholes_call(100, 110, 1.0, 0.05, 0.20)
print(f"BS Price: ${bs_price:.4f}")from mcoptions import price_european_option_mc_control_variate
# Control variate reduces SE by ~45%
result = price_european_option_mc_control_variate(
S0=100, K=110, T=1.0, r=0.05, sigma=0.20,
num_simulations=50_000, seed=42
)
print(f"Price: ${result['price']:.4f}")
print(f"Variance reduction factor: {result['variance_reduction_factor']:.1f}×")from mcoptions import mc_delta, mc_gamma, delta_call, gamma
# Monte Carlo Greeks with common random numbers
S0, K, T, r, sigma = 100, 110, 1.0, 0.05, 0.20
delta_mc = mc_delta(S0, K, T, r, sigma, num_simulations=100_000)
print(f"MC Delta: {delta_mc['delta_mc']:.6f}")
print(f"BS Delta: {delta_mc['delta_bs']:.6f}")
print(f"Error: {delta_mc['error']:.6f}")from mcoptions import price_american_put_lsm, price_american_put_binomial
# Longstaff–Schwartz Monte Carlo
lsm_price, paths, cashflows = price_american_put_lsm(
S0=100, K=100, T=1.0, r=0.05, sigma=0.20,
steps=100, num_simulations=50_000, seed=42
)
# Independent binomial validation
crr_price = price_american_put_binomial(
S0=100, K=100, T=1.0, r=0.05, sigma=0.20, steps=1000
)
print(f"LSM: ${lsm_price:.4f}")
print(f"CRR: ${crr_price:.4f}")
print(f"Error: {abs(lsm_price - crr_price):.4f}")- European options: Direct terminal sampling (300× faster)
- American options: Longstaff–Schwartz least-squares regression
- Exotic options: Arithmetic Asian with geometric control variate
- Implied volatility: Newton-Raphson inversion
- Antithetic variates: ±0 correlation, O(N) cost
- Control variates: Optimal β calculation, 40–90% reduction
- Common random numbers: For Greeks, multi-leg strategies
- Convergence verification: O(N^−1/2) empirically confirmed
- RMSE analysis: 100 independent trials per configuration
- Parameter sensitivity: Across moneyness, volatility, maturity
- 5 analytical Greeks: Delta, Gamma, Vega, Theta, Rho
- MC Greeks: Finite-difference bump-and-revalue with CRN
- Independent validation: Black-Scholes benchmarks
mcoptions/
├── black_scholes.py # Analytical pricing & Greeks
├── monte_carlo.py # European option pricing
├── variance_reduction.py # Antithetic, control variates
├── mc_greeks.py # Monte Carlo Greeks (CRN)
├── american_option.py # Longstaff–Schwartz
├── binomial.py # CRR binomial tree (validation)
├── exotic_options.py # Asian, path-dependent
├── implied_volatility.py # IV inversion (NR, Brent)
├── gbm.py # GBM simulation
├── convergence_analysis.py # Empirical convergence
├── lsm_analysis.py # LSM validation suite
└── __init__.py # Public API
- Focus on variance reduction, convergence rates, and estimator efficiency rather than feature breadth
- Verify all claims empirically (O(N^−1/2), variance ratios, error bounds)
- Compare methods on variance, runtime, and implementation complexity
- Each pricing method has a ground-truth benchmark
- MC ↔ Black-Scholes (European)
- LSM ↔ CRR binomial (American)
- Arithmetic ↔ Geometric (Asian)
- Tests verify invariants, not just function execution
- Type hints on all public functions (Python 3.9+)
- Comprehensive test suite (29 tests, all passing)
- GitHub Actions CI (Python 3.10, 3.11, 3.12)
- Installable package via
pip install -e . - Configurable: seeds, observation dates, basis functions
Run the full suite:
pytest -vTest coverage includes:
- Pricing fundamentals: Payoff correctness, GBM paths, Black-Scholes put-call parity
- Convergence & variance reduction: MC convergence rate, antithetic/control-variate efficacy
- Greeks: Delta, gamma, vega, theta, rho (analytical vs. Monte Carlo)
- American options: LSM convergence, basis function comparison (polynomial/normalized/Laguerre), exercise boundary sanity
- Exotic derivatives: Geometric Asian analytical validation, Asian control variate effectiveness
- Risk management: Implied volatility recovery (Newton-Raphson & Brent), dividend-adjusted parity
Under the risk-neutral measure:
Monte Carlo estimate:
Standard error decreases at rate:
Verified empirically: 10× improvement when increasing paths 100×.
Control variate adjustment:
where
Analytical (Black–Scholes):
- Δ = ∂V/∂S (delta)
- Γ = ∂²V/∂S² (gamma)
- ν = ∂V/∂σ (vega)
- Θ = −∂V/∂t (theta)
- ρ = ∂V/∂r (rho)
Monte Carlo (finite-difference with CRN):
- Same pricing framework
- Shared random draws for bump-and-revalue
- ~1% error to analytical on 100K paths
Backward induction with continuation-value regression:
At each time step t ∈ {T − Δt, ..., Δt}:
- Estimate continuation value via least-squares regression
- Compare to intrinsic value (exercise payoff)
- Optimal exercise = max(intrinsic, continuation)
Basis functions: 1, S, S², optionally S³, ...
-
Black, F., Scholes, M. (1973). "The pricing of options and corporate liabilities." Journal of Political Economy, 81(3), 637–654.
-
Longstaff, F. A., Schwartz, E. S. (2001). "Valuing American options by simulation: A simple least-squares approach." Review of Financial Studies, 14(1), 113–147.
-
Glasserman, P. (2004). Monte Carlo Methods in Financial Engineering. Springer-Verlag.
-
Kemna, A. G., Vorst, A. C. (1990). "A pricing method for options based on average asset values." Journal of Banking & Finance, 14(1), 113–129.
Samarth Uday (samarthuday.202@gmail.com)
@software{monte_carlo_options,
author = {Uday, Samarth},
title = {Monte Carlo Derivatives Pricing \& Numerical Methods},
year = {2026},
url = {https://github.com/Samarthuday/monte-carlo-options}
}MIT License. See LICENSE for details.

