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; under Heston the paths and the
regression basis carry the
(spot, variance)state, stepping the Andersen QE scheme. 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).
Path dynamics come from the stochastic-process layer
(core::montecarlo::process +
equity::processes): the SDE’s
drift/diffusion live in the process object (GBM / local vol as a
BlackScholesProcess, Heston as the two-factor HestonProcess),
and Euler / Milstein / exact stepping are generic over it. A new model
plugs in by implementing the process trait; the per-path stream and
stepping structure is factor-agnostic.
Re-exports§
pub use crate::core::montecarlo::process::DiscretizationScheme;pub use crate::core::montecarlo::paths::Sampler;
Structs§
- McStats
- Price with sampling diagnostics.
- Monte
Carlo Config - 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.
Constants§
- HESTON_
MIN_ STEPS - Step floor for full-truncation Euler, whose O(dt) variance-truncation bias needs a fine grid.
- HESTON_
QE_ MIN_ STEPS - Step floor under Andersen QE, which is near bias-free on coarse grids (that is its point) — the floor only keeps enough resolution for the vol path itself.
- LOCAL_
VOL_ MIN_ STEPS - PATH_
DEPENDENT_ MIN_ STEPS - Minimum monitoring steps for path-dependent payoffs.
Functions§
- npv
- npv_
with_ stats - Price with standard error and simulation diagnostics.