stochastic-rs

Comparison with QuantLib and RustQuant

An honest feature-coverage comparison of stochastic-rs, QuantLib and RustQuant, including where each library is the better choice.

Comparison with QuantLib and RustQuant

There are three serious open-source options if you want to price derivatives without writing the numerics yourself: QuantLib (C++, since 2000), RustQuant (Rust), and stochastic-rs. They overlap less than the descriptions suggest. This page is a feature-coverage comparison, including the cases where stochastic-rs is the wrong answer.

Short version

  • You are modelling volatility — rough volatility, stochastic volatility, calibration to a smile, path simulation, Greeks by Malliavin calculus. Pick stochastic-rs. Nothing else in open source covers this depth.
  • You are booking and settling real cash products across many jurisdictions — convertibles, callables, commodities, exotic coupon structures. Pick QuantLib. Its instrument and calendar coverage is two decades ahead.
  • You want a small, dependency-light Rust crate with automatic differentiation and you only need vanilla instruments. Look at RustQuant.

At a glance

stochastic-rsQuantLibRustQuant
LanguageRustC++Rust
LicenceMITBSD-styleApache-2.0
PythonNative PyO3, 234 entriesSWIG wrappersEarly-stage (rustquant 0.0.x)
Float precisionGeneric f32 / f64doublef64
SIMD / GPUCPU SIMD, CUDA, Metal, AccelerateNoneNone
First released202420002023

Where stochastic-rs is ahead

These are areas where the other two have little or nothing. Each is verified against the upstream source trees, not marketing copy.

Rough and fractional volatility. 120+ processes including rough Bergomi, rough Heston, fractional OU, fractional CIR, Volterra kernels and a Markovian lift. QuantLib ships one rough engine (analyticroughhestonengine); RustQuant has none. See processes.

Malliavin Greeks. Thalmaier and El Khatib weight schemes, plus a Fourier-Malliavin volatility estimator. Neither of the others implements Malliavin calculus at all.

Statistical estimation. Hurst exponent (Fukasawa, R/S, DFA, GPH, wavelet, Whittle), maximum likelihood for 1-D diffusions with six transition-density approximations, realised variance with BNHLS bandwidth, a full stationarity battery (ADF, KPSS, Phillips-Perron, ERS-DFGLS, Leybourne-McCabe), HMM, changepoint, particle filter, UKF. QuantLib has descriptive statistics but not econometric estimators. See statistics.

Copulas. Thirteen bivariate families plus C-vine, D-vine, R-vine and nested Archimedean constructions. QuantLib's ql/math/copulas covers the basic families only. See copulas.

Hardware acceleration. SIMD sampling on CPU, with CUDA, Metal and Accelerate backends for the fractional Gaussian noise family. Neither alternative attempts this. See benchmarks.

Python that is not a wrapper. 234 native PyO3 entries, numpy in and numpy out, no SWIG layer and no C++ toolchain needed to install. See Python bindings.

Where QuantLib is still the better choice

Being candid about this matters more than winning a table.

Instrument coverage. QuantLib has convertible bonds, callable and puttable bonds with call schedules, asset swaps, bond forwards, BMA swaps, range accruals, digital and capped/floored coupons, non-standard swaps, and swing and storage options for energy. stochastic-rs has none of these.

Calendars and conventions. Roughly forty holiday calendars against our eight (United States, United Kingdom, TARGET, Tokyo, HKEX, ASX, SGX, B3). If you need to settle a EUR trade against German, French or Italian holidays today, QuantLib is the only option.

Interpolation. Around twenty-four interpolators including Chebyshev, Lagrange, kernel, convex-monotone variants and 2-D bicubic. We ship four curve interpolators.

American options at machine precision. QuantLib implements Barone-Adesi-Whaley, Ju-Zhong and the modern QD+/QD-FP engines. We have Bjerksund-Stensland 2002, a CRR lattice, finite differences and Bermudan LSM, which is enough for most work but not for the last few basis points.

Market models. QuantLib's LMM framework includes products, pathwise Greeks, callability bounds and correlation parameterisations. Our LMM is a drift-coupled simulator without the product layer.

Institutional familiarity. Twenty-five years of production use and audit trails count for something in a regulated setting.

Where RustQuant fits

RustQuant's distinguishing feature is RustQuant_autodiff, an adjoint automatic differentiation engine. stochastic-rs has no AAD — our Greeks come from closed forms, Malliavin weights or finite differences. If gradient-based work is central to your problem and vanilla instruments are sufficient, that is a real advantage.

It also ships ISO-3166 country codes and ISO-10383 market identifier codes, a small machine-learning module, and CSV/JSON/Parquet data loading. We cover ISO-4217 currencies (162 of them) but not the other two standards, and we have no general data-loading layer.

Feature coverage

Areastochastic-rsQuantLibRustQuant
Stochastic processes120+~20~10
Rough / fractional volatilityExtensiveOne engineNone
Fourier pricingHeston, Bates, Merton, Kou, VG, CGMY, double HestonHeston familyNone
Model calibrationHeston, SABR, SVJ, Lévy, rough Bergomi, double Heston, Hull-WhiteBroadNone
Volatility surfacesSVI, SSVI, SABR smile, arbitrage repairSABR, ZABR, optionlet strippingNone
Yield curvesBootstrap, Nelson-Siegel, Svensson, multi-curveComprehensiveBasic
CreditMerton, hazard bootstrap, CDS, JLT migrationComprehensiveNone
XVA / counterparty exposureNonePartialNone
Automatic differentiationNoneVia XAD forkNative
SerialisationNoneBoostSerde
Market microstructureAlmgren-Chriss, Kyle, propagator, order bookNoneOrder book
Neural volatility surrogatesHeston, Bergomi, rough BergomiNoneNone

Known gaps in stochastic-rs

Beyond the instrument and calendar coverage above, these are the gaps we consider most significant, listed so you can judge whether they block you:

  1. No automatic differentiation. All sensitivities are closed-form, Malliavin or bumped.
  2. No serialisation. Curves, calibration results and surfaces cannot currently be persisted; there are no serde derives in the workspace.
  3. No XVA engine. The building blocks exist — Monte Carlo, short-rate models, survival curves, copulas — but there is no exposure simulation, netting or collateral layer.
  4. QMC path construction stops at Brownian motion. BrownianBridgeQmc (stochastic::mc) joins SobolSeq — the full 21201-dimension Joe-Kuo table with Owen-type scrambling — to the Brownian-bridge dimension allocation, so Brownian levels and increments come out of a low-discrepancy sequence with the coarse features in the leading coordinates. The processes themselves still draw their own Gaussian stream: QMC reaches a model by feeding those increments into an explicit Euler loop, not through ProcessExt::sample, and there is no PCA path construction (the pca module under quant::factors is portfolio factor extraction, unrelated to path generation).
  5. No commodities. No seasonal forward curves, no Schwartz-Smith, no storage or swing optionality.
  6. No discrete dividends. Equity pricing assumes a continuous dividend yield.

Notes for QuantLib users

The concept mapping is closer than the syntax suggests:

QuantLibstochastic-rs
StochasticProcessProcessExt<T>
PricingEngine + InstrumentModelPricer or .valuation(curve); a small PricingEngine + Instrument comparison harness also exists
Handle<Quote> / observersmarket::handle / market::observable
DayCounterDayCountConvention
CalendarCalendar + HolidayCalendar
YieldTermStructurecurves::DiscountCurve
Schedulecalendar::schedule

The main structural difference is that stochastic-rs avoids &dyn and Box<dyn> in hot paths. Where QuantLib hands you a polymorphic engine pointer, we use concrete types and generics, so the engine choice is a compile-time decision rather than a runtime one. See design philosophy.

Using them together

These are not mutually exclusive. A common arrangement is QuantLib for the fixed-income and settlement layer, and stochastic-rs for volatility modelling, calibration and simulation — reached from Python, where both are importable side by side.

On this page