Changelog
All notable changes to this project are documented here. The project follows Semantic Versioning.
[Unreleased]
Added
GARCH11andGJRGARCH11: variance-clustering and asymmetric leverage with tested discrete-time recursions.FractionalBrownianMotion: exact finite-grid fractional Gaussian noise, including irregular grids.core.sobol_normals: scrambled Sobol quasi-random factors with correlation and Brownian-bridge ordering.risk.normal_portfolio_risk: normal VaR/ES, marginal risk, Euler component allocations.- Plotly
viz.portfolio_risk_chart, standalone advanced-model example and independent statistical tests. DisplacedDiffusion: exact shifted-lognormal forwards including negative values; shifted Black-76displaced_diffusion_price, forward Greeks, deterministic limits, and independent Monte Carlo tests.CIRPlusPlus: CIR factor with analytic deterministic shift matching any input zero curve; discount-path construction and MC curve-fit validation (with documented time-grid bias).- Standalone Plotly example for displaced forwards and CIR++ rates.
ArithmeticBrownianMotion: exact normal paths with absolute drift/volatility and support for negative values.NormalInverseGaussian: exact exponential NIG paths with compensated drift, spot/log-return moments, and explicit exponential-moment domain checks.nig_price: European calls/puts using original and exponentially tilted NIG probabilities.bachelier_greeks: vectorised forward delta, gamma, vega and theta with a documented fixed-discount convention.- Normal/NIG example with a self-contained interactive Plotly chart, independent-reference tests and usage guidance.
[2.1.0] - 2026-10-14
Added
- Validation lab (
stochPathSim.validation): convergence_studyanddiscretisation_study, which estimates the weak order.compare_models.ValidationReport, which writes self-contained interactive HTML reports with pass/fail checks.- Interactive Plotly charts (
stochPathSim.viz): - Paths, fan charts, a path explorer, terminal distributions and density evolution (heatmap, surface or animation).
- Correlation heatmaps, exposure and backtest dashboards, VaR plots, and curve-fit checks.
- Light and dark themes.
- New models:
RoughBergomi,KouJumpDiffusion,RegimeSwitchingGBM,SchwartzOneFactorandSchwartzSmith.ConstantIntensityandCIRIntensity, with default-time sampling.- Analytics:
kou_priceandkou_char_func. - Results:
SimulationResult.fan()andSimulationResult.distribution(t).
Changed
- Charts use Plotly instead of matplotlib, and plotly is now a core dependency.
plot_paths,plot_fan,plot_exposure,SimulationResult.plotand the 1.xplot_simulationreturn Plotly figures. Theaxargument is accepted and ignored. - The
plotextra is kept empty for compatibility. A newexportextra installs kaleido for static image export.
[2.0.0] - 2026-10-14
A rewrite into a validated simulation, pricing and risk library. The 1.x interface keeps working.
Added
- Core:
TimeGridwith uniform, refined and arbitrary grids.SimulationResultwith quantiles, plotting and DataFrame export.StochasticProcessbase class with seeds, antithetic variates and common random numbers.ZeroCurve: monotone-cubic or linear interpolation, discount factors and forward rates.- Processes:
- Equity and generic:
GBM(exact),MultiAssetGBM,MertonJumpDiffusion,Heston(Andersen QE and full-truncation Euler),Bates,SABR,CEV,VarianceGamma,OrnsteinUhlenbeck. - Rates:
VasicekandCIR(exact schemes), curve-fittedHullWhite,HoLeeandG2pp,BlackKarasinski,BlackDermanToy. - Short-rate models return pathwise discount factors.
- Analytics:
- Black-Scholes prices, Greeks and implied vol; Black-76; Bachelier price and implied vol.
- Heston semi-analytic price; Merton series price; Hagan SABR (including shifted).
- Vasicek, CIR, Hull-White and G2++ bond prices; Vasicek and Hull-White bond options; Hull-White caplets.
- Pricing:
- Payoffs: European, digital, Asian, barrier, lookback, basket and spread.
price_mcwith standard errors, antithetic and control variates.- Longstaff-Schwartz American pricing and a CRR binomial tree.
- Risk:
- Exposure profiles (EE, PFE, EPE, Effective EE/EPE), collateralised exposure and CVA.
- VaR and ES, path statistics and exceedance counts.
- PIT, Anderson-Darling, Cramér-von Mises, Kupiec and Christoffersen backtests.
- Calibration:
fit_gbm,fit_ou(Vasicek) andfit_cirmaximum-likelihood estimators. - Project: test suite validated against closed forms and QuantLib, CI on Linux, macOS and Windows (Python 3.10–3.13), documentation site, examples and
CITATION.cff.
Fixed (1.x behaviour)
- GBM: paths now start at
s0. 1.x applied a Brownian increment att = 0. - Heston: 1.x had no drift and used the next step's variance for the current step.
- Hull-White: 1.x simulated an Ornstein-Uhlenbeck process reverting to zero.
HullWhiteModelis now a Hull-White model fitted to a flat curve atr0. - Black-Derman-Toy: 1.x simulated an arithmetic random walk. The rate is now lognormal.
- Plotting:
plot_simulationno longer asks for keyboard input and returns the Axes. - Statistics:
display_statisticsno longer modifies its argument. - Dependencies:
scipyis now declared, and the 1.x tests (which imported a package that no longer existed) are replaced.
Changed
- Python 3.10+ is required.
- 1.x classes accept an optional
seedand use NumPy'sGeneratorinstead of the global random state.
[1.1.1] - 2024-12-15
- Initial public release on PyPI.