Expand description
Monte Carlo pricing engine.
- Terminal-value simulation (exact GBM step, 1-D Sobol) for European payoffs; path-wise simulation with Exact / Euler / Milstein stepping.
- Parallel, streamed path generation: every path derives its own deterministic RNG stream from (seed, path index), so paths are generated in parallel with rayon, results are independent of thread scheduling, and no draw matrix is materialized.
- Multi-dimensional quasi-Monte Carlo: with the (default)
Sobolsampler, path-wise routes use a low-discrepancy sequence through a Brownian bridge, so the best coordinates carry each path’s coarse structure. - Dupire local vol dynamics, Brownian-bridge barrier correction, geometric control variate for arithmetic Asians.
- American exercise via two-pass Longstaff-Schwartz (regression on one set of paths, valuation on an independent set — removes foresight bias) with a cubic polynomial basis.
npv_with_statsreports the standard error alongside the price.- Greeks by central-difference bump-and-reprice with common random numbers (deterministic draws make every reprice use identical paths).
Multi-factor models (stochastic vol) plug in by widening the per-step draw dimension and adding a second bridge; the per-path stream and stepping structure is factor-agnostic.
Structs§
- McStats
- Price with sampling diagnostics.
- Monte
Carlo Config
Enums§
- Discretization
Scheme - Time-stepping scheme for path-wise simulation.
Exactsamples the closed-form GBM transition (no discretization bias); Euler and Milstein are the standard approximate schemes (the basis for models without closed-form transitions, e.g. local vol / Heston). - McModel
- Dynamics used for path generation.
Gbmdiffuses at the option’s own (constant) implied vol;LocalVoldiffuses at the Dupire local volatility calibrated from the option’s vol surface. - Sampler
- Draw sampler.
Sobolselects the low-discrepancy family: true Sobol (van der Corput) in one dimension, a scrambled multi-dimensional sequence through a Brownian bridge for path-wise simulation.PseudoRandomuses seeded per-path PCG64 streams with antithetic pairing. Longstaff-Schwarz always uses pseudo-random streams.
Constants§
- HESTON_
MIN_ STEPS - LOCAL_
VOL_ MIN_ STEPS - PATH_
DEPENDENT_ MIN_ STEPS - Minimum monitoring steps for path-dependent payoffs.
Functions§
- delta
- gamma
- npv
- npv_
with_ stats - Price with standard error and simulation diagnostics.
- option_
pricing - rho
- theta
- vega