stochastic-rs

Comparison with QuantLib and RustQuant

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

Three open-source options price derivatives without you writing the numerics: QuantLib (C++, since 2000), RustQuant (Rust), and stochastic-rs. They overlap less than their descriptions suggest. This page compares feature coverage, including the cases where stochastic-rs is the wrong choice.

Short version

  • You are modelling volatility — rough volatility, stochastic volatility, calibration to a smile, path simulation, Greeks by Malliavin calculus. Pick stochastic-rs.
  • You are booking and settling real cash products across many jurisdictions — convertibles, commodities, exotic coupon structures. Pick QuantLib: its instrument and calendar coverage is far wider.
  • You want a small, dependency-light Rust crate with automatic differentiation and need only vanilla instruments. Look at RustQuant.

At a glance

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

Where stochastic-rs is ahead

Areas where the other two have little or nothing:

Rough and fractional volatility. 130 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.

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. Fifteen 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 the CPU, every process on a CUDA or Metal GPU, and Apple's vDSP FFT (Accelerate) for fractional Gaussian noise. Neither alternative attempts this. See GPU support and benchmarks.

Native Python. 307 PyO3 entries, NumPy in and NumPy out, no SWIG layer and no C++ toolchain needed to install. See Python bindings.

Where QuantLib is the better choice

Instrument coverage. QuantLib has convertible bonds, 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 nine (United States, United Kingdom, TARGET, Tokyo, HKEX, ASX, SGX, Brazil, B3). To settle a EUR trade against German, French or Italian holidays, 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 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 in a regulated setting.

Where RustQuant fits

RustQuant's distinguishing feature is RustQuant_autodiff, an adjoint automatic differentiation engine. stochastic-rs has no AAD — its Greeks come from closed forms, Malliavin weights or finite differences. If gradient-based work is central to your problem and vanilla instruments suffice, 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 have no general data-loading layer.

Feature coverage

Areastochastic-rsQuantLibRustQuant
Stochastic processes130~20~10
Rough / fractional volatilityExtensiveOne engineNone
Fourier pricingHeston, Bates, Merton, Kou, VG, CGMY, double HestonHeston familyNone
Model calibrationHeston, Heston SLV, SABR, SVJ, Lévy, rough Bergomi, double Heston, Hull-White, G2++, Black-KarasinskiBroadNone
Volatility surfacesSVI, SSVI, eSSVI, SABR smileSABR, ZABR, optionlet strippingNone
Yield curvesBootstrap, Nelson-Siegel, Svensson, multi-curveComprehensiveBasic
CreditMerton, hazard bootstrap, CDS, CDS index, CDO tranches, JLT migrationComprehensiveNone
XVA / counterparty exposureExposure profiles, CVA / DVA / FVAPartialNone
Automatic differentiationNoneVia XAD forkNative
SerialisationNoneBoostSerde
Market microstructureAlmgren-Chriss, Kyle, propagator, order bookNoneOrder book
Neural volatility surrogatesHeston, Bergomi, rough Bergomi (experimental)NoneNone

Known gaps in stochastic-rs

Beyond the instrument and calendar coverage above, the gaps we consider most significant:

  1. No automatic differentiation. All sensitivities are closed-form, Malliavin or bumped.
  2. No serialisation. Curves, calibration results and surfaces cannot be persisted; there are no serde derives in the workspace.
  3. No netting or collateral layer. Exposure profiles and CVA / DVA / FVA exist, but there is no netting-set or collateral modelling.
  4. QMC path construction stops at Brownian motion. BrownianBridgeQmc (stochastic::mc) builds Brownian levels and increments from a scrambled Sobol sequence, but the processes draw their own Gaussian stream: QMC reaches a model through an explicit Euler loop fed with those increments, not through ProcessExt::sample, and there is no PCA path construction.
  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

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, stochastic-rs uses concrete types and generics, so the engine choice is made at compile time.

Using them together

They 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, both imported side by side from Python.

Edit on GitHub

Last updated on

On this page