Skip to content

Releases: rust-dd/stochastic-rs

v2.5.1

Choose a tag to compare

@dancixx dancixx released this 19 Jul 01:10
v2.5.1
279a640

This patch release corrects the Fourier–Malliavin volatility estimators and Malliavin–Thalmaier integration and Greeks, with stronger input validation and regression coverage.

Fixes

  • Fourier–Malliavin volatility — corrected coefficient scaling and spot/integrated bias handling for arbitrary observation horizons, including irregular-grid optimal cutting.
  • Malliavin–Thalmaier estimators — corrected Skorohod product terms, log-Euler dynamics, localization and payoff handling, and common-random-number Greeks.
  • Heston2D and kernels — corrected correlation, Feller and input validation, plus Poisson/digital-kernel normalization and support.
  • Validation — added targeted regression, finite-difference comparison, paper-reference, and MATLAB-parity tests across FMVol, MT, kernels, and Heston2D.

Full Changelog: v2.5.0...v2.5.1

v2.5.0

Choose a tag to compare

@dancixx dancixx released this 15 Jun 11:21
b1af079

stochastic-rs v2.5.0

Process sampling now runs through a reusable per-thread sampler.

APIProcessExt exposes sample(), sample_par(m) (returns all m paths), and sample_map(m, f) (maps each path through f and returns the results, reusing one buffer per worker — for Monte-Carlo reductions where you don't keep the paths). Call sites are unchanged; the sampler is internal.

Seeding — the auto-seed counter is block-allocated per thread, removing the global-atomic contention that serialised parallel workers. Deterministic seeding is unchanged and bit-identical.

Performance — parallel short-path Monte-Carlo is ~1.4–1.9× faster (n=64), tapering to a few percent for longer paths where the path computation dominates. Serial and single-path sampling are roughly unchanged.

Other — removed the ndarray-stats and ndarray-rand dependencies; faster distribution sampling (fewer allocations).

Full changelog: v2.4.0...v2.5.0

v2.4.0

Choose a tag to compare

@dancixx dancixx released this 06 Jun 12:47
v2.4.0
950ddd3

stochastic-rs v2.4.0

Highlights

Compile-time GPU / accelerator backends. The fractional / fGN family (Fgn, Fbm, Fou, Fcir, Fgbm, FJacobi, Cfou, Cfgns, JumpFou,JumpFOUCustom, Sde) now selects its sampling backend at compile time with .on::<B>()Cpu (default), CudaNative (cudarc + cuFFT), CubeCl (cubecl: CUDA / wgpu), MetalNative, and Accelerate (Apple vDSP). Dispatch is monomorphised with no runtime branch; an unavailable backend is a compile error.

Heston Andersen QE scheme. Heston gains a compile-time variance discretisation selector. Switch from the default Euler scheme to the Andersen (2008) Quadratic-Exponential scheme with .qe() for markedly lower discretisation bias at large kappa, high |rho|, or long maturities.

Also

  • CUDA-native generation improvements and device-to-host bandwidth benchmarks.
  • Metal / cubecl kernel caching and Accelerate backend fixes.
  • Docs: new "Sampling backends" concept page, refreshed Heston / FGN examples, corrected feature-flag matrix.

Full Changelog: v2.3.0...v2.4.0

v2.3.0

Choose a tag to compare

@dancixx dancixx released this 01 Jun 14:02
12ee6f9

Highlights

Copulas

  • Multivariate copulas — Student-t copula (Demarta–McNeil χ²-mixer, profile-MLE for ν via Brent), Nested Archimedean Copulas (Hofert 2008: Kanter positive-stable sampling + sufficient-nesting-condition validator), and vine pair-copula constructions — D-vine / C-vine / R-vine built on Aas–Czado (2009) h-functions and inverse-h-functions. [adf1c14, 20a7b66]
  • 7 new bivariate copulas — Joe, FGM, Plackett [db186e9]; AMH, Marshall–Olkin, Galambos, Hüsler–Reiss [cb48062].

Distributions

  • 6 new distributions + 7 SIMD ops — Truncated (Robert 1995 rejection), Skellam (two-Poisson + modified-Bessel), Dirichlet (gamma-trick simplex), GED (Subbotin), Wishart (Bartlett decomposition), GEV (Jenkinson); plus 7 new SIMD ops (A&S 7.1.26 erf, Lanczos g=7 lgamma, …) via the wide crate with a const-N buffered SimdNormal. [1f67b13]

Stochastic processes

  • 3 stochastic-volatility processes — multifactor Heston (Christoffersen–Heston–Jacobs 2009, const-generic K factors), Barndorff-Nielsen–Shephard (non-Gaussian OU with a compound-Poisson + Gamma subordinator), and dynamic / multifactor SABR (piecewise-constant β/ρ/ν term structure, Fernández et al 2024). [13a5849]

Calibration & estimators

  • FRFT Carr–Madan pricer — fractional FFT (Bailey–Swarztrauber chirp convolution) with Lord–Kahl (2010) grid centring; matches the analytic BSM price to 1e-4. [6467ea5]
  • GMM-CIR variance calibration — exact CIR conditional moments (Cox–Ingersoll–Ross 1985), two-step efficient weighting, Hansen J-test. [b6d642f]
  • QMLE for OU / CIR — Kessler (1997) Gaussian quasi-likelihood; the OU fit matches the closed-form Vasicek MLE to 1e-3. [5cb33fd]
  • Bayesian MCMC diffusion calibration — random-walk Metropolis with log-normal priors and 95% credible intervals. [7b1f5d6]
  • Particle-filter MLE for stochastic volatility — Kitagawa (1996) bootstrap filter with common random numbers (Pitt 2002), allocation-free 1-D hot loop. [0c150dd]

Market data

  • Market-data provider abstraction — a synchronous MarketDataProvider trait with a MockProvider and a feature-gated YahooProvider, plus ImpliedVolSurface::from_provider to build a surface straight from a quote source. [e34d77b]

Statistics

  • New stationarity / specification tests — CUSUM / CUSUMQ, RESET, Andrews–Ploberger [65c4ab4]; Lo–MacKinlay variance-ratio [0100007].

Fixed income & calendars

  • Holiday calendars — HKEX, ASX, SGX, B3 [f0106b5]; Joint (intersection) calendar mode, Act/365L, IMM dates [936af1b]; Nearest business-day convention, ACT/ACT ICMA, day helpers [4c2b2ee].
  • Day-count-aware instrumentsTimeExt::dcc(), a BSMPricer day-count field, and calendar-aware bootstrapping that honours non-uniform δᵢ in the par equation. [8c665a2]
  • Curves — full Hagan–West monotone-convex four-region interpolation [c69f63d]; unified calendar date math into date_math.rs [f90252f]; survival-curve fix [9f49272].

Python

  • PyO3 calendar layer — DayCount / Calendar / ScheduleBuilder exposed to Python. [9876791]
  • pytest suite + CI gate — tests across all five API surfaces, run in CI alongside the smoke test. [e52beca]

Infrastructure

  • Repository-wide modularization — large source files split into responsibility-based submodules across every sub-crate (pricing, calibration, copulas, stats, viz, python), with no public-API change.
  • CI on cargo-nextest — a fast workspace test job with a running (N/total) progress counter, a separate doctest gate, and the coverage job moved to push-to-main. The coverage run dropped from ~2h52m to ~53min. [c672cb5, 12ee6f9]

Full Changelog: v2.2.0...v2.3.0

v2.2.0

Choose a tag to compare

@dancixx dancixx released this 18 May 08:14
1fe6bdf

Highlights

  • SIMD RNG / Ziggurat speedups — single-sample dist.sample(rng) loops are ~2–4× faster vs the v2.1 wide 1.3 baseline. next_f64_array / next_f32_array go from 8 scalar shift+cast+mul loops to SIMD shift + magic-number bit-cast + subtract (52-bit / 23-bit precision). New fill_uniform_f64 / fill_uniform_f32 direct-write APIs skip the [T; 8] return-by-value round-trip. Fused 1/λ scaling into SimdExp::fill_exp_scaled. [819b1c0]
  • Opt-in dual-stream-rng featureSimdRngDual carries two independent Xoshiro state pairs (engine_a, engine_b) so the OoO core can interleave the Ziggurat scalar table-load chains across batches. Apple Silicon: −5% to −11% on SimdNormal::fill_slice Ziggurat sweet-spot (n = 4096). Uniform fills are not engine-bound, so no speedup there. Stream-bit-exactness changes (KS-validated). [207cb42]
  • Generic R: SimdRngExt across all 18 distributions — every SimdXxx<T, ..., R> struct is parameterised on the backing RNG (default SimdRng), letting SimdNormalDual / SimdExpDual / SimdExpZigDual reuse the exact same code paths via type alias. [f886c7b, 207cb42]
  • Unified seed-handling API (breaking)with_seed(u64) and from_seed_source(&src) are removed; every distribution and process now exposes a single canonical new(args, &seed) constructor accepting any SeedExt strategy (Unseeded, Deterministic::new(u64), or a custom source). SeedExt::reseed(u64) swaps a Deterministic source in place for calibration sweeps. [f886c7b, d74f824]
  • Seed propagation fixesnon_central_chi_squared::sample is now generic over SeedExt (was hardcoding &Unseeded), restoring reproducibility in the Svcgmy v-path. All four FGN GPU/Accelerate backends (fgn/accelerate.rs, fgn/gpu.rs, fgn/metal.rs, fgn/cuda_native.rs) now thread &self.seed instead of pulling from the global RNG. [88f7e0d, cf3c557]
  • Documentation — new seeding concept page covers the unified constructor, SeedExt strategies, SimdRngExt generic backing RNG, and the dual-stream feature. [d74f824, f67c6ac]

Full Changelog: v2.1.0...v2.2.0

v2.1.0

Choose a tag to compare

@dancixx dancixx released this 16 May 17:03
v2.1.0
ea15f78

Highlights

  • Unified seeded sampling API (breaking) — the dedicated *_seeded family is removed across 144 files. All processes now use the unified ProcessExt::sample / sample_with_rng surface. Downstream call sites using `sample_seeded(seed)` should migrate to `sample_with_rng(&mut StdRng::seed_from_u64(seed))`. [2b95400]
  • Heston 2D volatility model — two-factor stochastic-volatility process (stochastic_rs::stochastic::volatility::heston2d::Heston2D). [ac37761]
  • Fourier-Malliavin engine polish — extended pricing engine in stochastic-rs-quant/src/fourier_malliavin/engine.rs. [ac37761]
  • MLE estimator coverage — additional process implementations and shared estimator scaffolding in stochastic-rs-stats/src/mle/. [6e352a0]
  • Workspace-level versioning — all 9 sub-crates inherit `version.workspace = true`; future bumps only touch the root `Cargo.toml`. [714188f]

Full Changelog: v2.0.0...v2.1.0

v2.0.0

Choose a tag to compare

@dancixx dancixx released this 11 May 16:10

stochastic-rs v2.0.0

First stable 2.0 release. Six prereleases (beta.1beta.2beta.3rc.0rc.1rc.2) consolidated; the surface and numerics are identical to v2.0.0-rc.2. Changes since v2.0.0-rc.2 are docs-site and CI polish only (commits cd4f874405f094).

What v2 brings

Workspace. Single stochastic-rs crate split into a 9-crate Cargo workspace at edition 2024 (stochastic-rs-core, -distributions, -stochastic, -copulas, -stats, -quant, -ai, -viz, -py). The umbrella stochastic-rs re-exports everything — every existing import path still works. Sub-crate-only consumers can now skip the quant/stats/ai compilation cost.

New trait surface.

  • prelude with 20 items in 5 groups (trait core / pricing / calibration / instrument-engine / option types).
  • Calibrator / CalibrationResult are now Result-based with type Params and type Error = anyhow::Error. 9 Calibrator + 12 CalibrationResult impls.
  • GreeksExt covers first- and second-order Greeks (vanna / charm / volga / veta), aggregated into a named-field Greeks struct; MC pricers override greeks() for single-pass consistency.
  • Instrument / PricingEngine (AnalyticBSEngine, AnalyticHestonEngine) — QuantLib-style decoupling between payoff and valuation.
  • DistributionExt defaults flipped from silent 0.0 to unimplemented!(). 18/19 distributions provide closed-form pdf / cdf / cf / moments.
  • PricerExt::implied_volatility default 0.0f64::NAN.

New primitives.

  • Reactive market cache (Cached<T> / MarketObserver).
  • FX module (delta conventions, ATM conventions, Vanna-Volga smile).
  • Variance swap (Carr-Madan replication + Brockhaus-Long Heston closed form + Bernard-Cui discrete correction).
  • Total Return Swap (proper TR forward F_TR(t) = S · exp(r t)).
  • interest::lmm::Lmm — drift-coupled LIBOR Market Model (spot-LIBOR measure, log-Euler positivity-preserving).
  • numerics namespace (HaltonSeq, SobolSeq, RlKernel, MarkovLift, Mlmc).
  • HypothesisTest trait + 8 implementations (ADF, KPSS, ERS, PhillipsPerron, LeybourneMcCabe, JarqueBera, AndersonDarling, ShapiroFrancia).

Python (stochastic-rs-py). 210-entry PyO3 surface (was 102 in rc.0): 198 classes + 12 pyfunctions across distributions, stochastic, quant pricers, Fourier engines, calibrators, vol surface, risk, microstructure, curves, factors, copulas, stats. All wrappers seed-aware via Deterministic::new(seed). AI bindings deferred to 2.x.

Silent-correctness fixes

If you held cached results from 1.x or any 2.0.0-beta.*, please re-compute:

  • tau * 365-vs-years bug in BSMPricer / HestonPricer / SabrPricer / HestonStochCorrPricer / AsianPricer / Vasicek-bond implied vols (v1 IVs were understated by √365).
  • variance_swap::fair_strike_replication sign error on rT and ln(K0/S0) correction.
  • bonds/cir.rs closed form: A·exp(+B·r)A·exp(-B·r) (ZCB was increasing with the short rate).
  • bonds/hull_white.rs rewritten against Brigo-Mercurio §3.3.2 / Hull-White (1990) extended-Vasicek using a DiscountCurve (v1 used Utc::now().year() in the price — non-deterministic).
  • calibration/heston_stoch_corr.rslet _ = slsqp::minimize(...) discarded the calibrated params; HscmCalibrationResult returned the initial guess. Now carries real converged + final_objective.
  • calibration/levy.rs NIG calibration wrapped NIG params in CGMYFourier with hardcoded y = 0.5. New NigFourier (Barndorff-Nielsen 1997 ChF) and rewired NIG path.
  • pricing/heston_stoch_corr.rs characteristic function used iu·r in the drift instead of iu·(r−q). Threaded q through the ODE drift + ModelPricer impl.
  • pricing/rbergomi.rs discarded the dividend yield. Drift now uses (r-q-0.5·v)·dt; RBergomiCalibrator::with_dividend_yield(q) builder added.
  • microstructure/kyle.rs multi-period Kyle 1985 backward recursion was non-canonical (disagreed with single_period_kyle at n_periods = 1). Re-derived against Cetin-Larsen 2023 (arXiv:2307.09392).
  • vol_surface/ssvi.rs::is_calendar_spread_free only checked the ATM term structure; missed off-ATM violations. Now verifies the full Gatheral & Jacquier 2014 Theorem 4.2 over a strike grid.
  • pricing/fourier.rs::CarrMadanPricer::price_call silently returned 0.0 for out-of-grid log-strikes — now returns f64::NAN so calibration objectives are poisoned and detection is forced; new strike_in_grid() helper.
  • portfolio/optimizers.rs::empirical_cvar alpha is the tail proportion (0.05 = worst 5%). assert!(alpha < 0.5) so users passing confidence-style 0.95 crash loudly.
  • traits/time.rs::tau_or_from_dates / tau_with_dcc return f64::NAN (was panic) when neither tau nor dates are set.
  • Heston switched to "Little Heston Trap" form (Albrecher-Mayer-Schoutens-Tistaert 2007) for long-maturity high-|ρ| principal-branch logarithm continuity.

Build & packaging

  • Edition 2024 across the workspace.
  • Feature flags propagate correctly: gpu, cuda-native, metal, accelerate, openblas, python. If you previously built with --features gpu on v1 expecting GPU samplers, re-build on v2 — you'll now actually get them.
  • docs.rs config pinned to ["openblas", "ai", "yahoo"] (all-features = true was pulling native GPU SDKs and breaking the docs build).
  • statrs is gone from production dependencies (closed-form rewrites in stochastic-rs-distributions); kept as [dev-dependencies] for cross-validation tests only.
  • PyPI workflow now builds macos-13 + x86_64 alongside aarch64 — Intel Mac users can pip install stochastic-rs again.

SKILLs

16 maintenance SKILLs shipped in .claude/skills/ to keep extensions consistent:

  • Tier 1 (release-level): release-checklist, feature-flag-management, calibration-pattern, greeks-pattern.
  • Tier 2 (domain): add-diffusion-process, add-fractional-process, add-jump-process, adding-distribution, adding-python-binding, stats-estimator.
  • Tier 3 (niche): copula-bivariate, add-gpu-sampler, add-mc-variance-reduction, vol-surrogate-nn, integration-test-writing, bench-writing.

Migration checklist

  • Bump stochastic-rs = "2.0" in Cargo.toml.
  • Add ? after every calibrator.calibrate(None) (now Result).
  • Replace pricer.derivatives()[i] reads with pricer.greeks().delta / .gamma / .vega / etc.
  • Replace iv == 0.0 checks with iv.is_nan().
  • If you implement CalibrationResult: add type Params and fn params(&self).
  • If you implement DistributionExt: override every method you call (defaults now unimplemented!()).
  • If you stored implied vols from BSMPricer / HestonPricer / SabrPricer: recompute (v1 IVs were understated by √365).

Install

[dependencies]
stochastic-rs = "2.0"
pip install stochastic-rs==2.0.0

Per-rc rollup: rc.0 · rc.1 · rc.2

Full Changelog: v1.5.0...v2.0.0

v2.0.0-rc.2

Choose a tag to compare

@dancixx dancixx released this 10 May 14:40

stochastic-rs v2.0.0-rc.2

  • cargo clippy --workspace --all-targets -- -D warnings is now clean (was 3 errors: deprecated FromPyObject on PyNigFourier, lazy unwrap_or_else in order_book::add_order, negated-comparison in PyNigFourier::new).
  • stats::fukasawa_hurst test suite (estimate_h_from_simulated_rv, rough_vs_smooth_distinguished, table1_m72_accuracy) now uses Fou::seeded(...) for the volatility path so the entire RNG chain is pinned.
  • Python coverage gaps from §1.5 filled: PyHscmModel, PyHscmCalibrator (+ PyHscmMarketOption), PyHullWhiteBond (with HullWhiteBond.from_curve(...) taking a DiscountCurve), and empirical_cvar exposed as a top-level #[pyfunction] with the documented alpha < 0.5 precondition translated to PyValueError.
  • portfolio::optimizers::empirical_cvar is now pub (was a private helper) so external callers can reach it directly.

Pricing. unreachable!() cleanups, NaN-tolerant partial_cmp, regime-switching matrix ops via ndarray operators (was hand-written triple loops), document hardcoded paper maturities, fourier_malliavin canonical-window comments, heston_stoch_corr FFT-vs-quadrature doc fix.

Vol / risk. SVI butterfly arb-freeness check + Durrleman g(k); Rockafellar-Uryasev tail-share correction in historical_es; max_peak_to_recovery_duration companion to existing duration; fourier_model_surface_fft_with(...) exposes Carr-Madan grid params; try_from_quotes Result variant on ImpliedVolSurface; Sortino / momentum ScoreWeighted convention doc; mat_inversenalgebra::try_inverse; new strategies module: Strategy trait + Backtest driver + MarketBar / StrategyAction types; bucket_dv01 sign doc.

Rates. curves::InstrumentBootstrapInstrument (with backward-compat alias); five new day-count conventions (BUS/252, ACT/364, ACT/ACT AFB, NL/365, 30E/360 ISDA); ScheduleBuilder long-first / long-last StubConvention; observable Mutex poisoning is now logged + recovered (was panic); fx Display fallback to NaN; short-rate round-isize defensive default.

Microstructure / factors. Stray no-ops removed (shrinkage, bootstrap, migration); loss.rs metrics return NaN on zero-divisor; pca.rs to_f64 defensive; CalibrationLossScore::get → NaN + try_get; scipy.linalg.expm regression test for migration matrix expm.

SKILLs (16 written, .claude/skills/)

  • Tier 1 (release-level): release-checklist, feature-flag-management, calibration-pattern, greeks-pattern.
  • Tier 2 (domain): add-diffusion-process, add-fractional-process, add-jump-process, adding-distribution, adding-python-binding, stats-estimator.
  • Tier 3 (niche): copula-bivariate, add-gpu-sampler, add-mc-variance-reduction, vol-surrogate-nn, integration-test-writing, bench-writing.

Full Changelog: v2.0.0-rc.1...v2.0.0-rc.2

v2.0.0-rc.1

Choose a tag to compare

@dancixx dancixx released this 10 May 09:28
21446df

Second release candidate of stochastic-rs v2.

Quant module fixes

  • Heston stoch-corrslsqp::minimize return value was discarded; calibrator returned the initial guess as if calibrated. Now captures the slsqp tuple; HscmCalibrationResult gains converged + final_objective.
  • Lévy / NIGLevyModel::Nig wrapped NIG params in CGMYFourier with hardcoded y=0.5. New NigFourier (Barndorff-Nielsen 1997 char fn) wired through the calibrator; round-trip test added.
  • HSCM / rBergomi — both pricers silently dropped q; HSCM also used iu·r instead of iu·(r-q) in the ODE drift. q now threaded through; new RBergomiCalibrator::with_dividend_yield(q) builder + parity-with-q tests.
  • Carr-Madanprice_call returned 0.0 silently for log-strikes outside the FFT grid; now returns NaN so calibration objectives detect the failure rather than zero-residualing the wings.
  • CIR ZCB — closed-form bond formula sign error (A·exp(+B·r)A·exp(-B·r)). Field doc-comments swapped theta/mu to match Vasicek's workspace convention.
  • Hull-White ZCB — used Utc::now().year() (non-determinism) and a hardcoded flat zero curve. Rewritten against Brigo & Mercurio §3.3.2 with a DiscountCurve-projected representation; HullWhite::from_curve builder + no-arbitrage + determinism regression tests added.
  • Multi-period Kyle 1985 — backward recursion was non-canonical (β·λ = 0.25 vs canonical 0.5 at n_periods=1). Re-derived against Cetin-Larsen 2023 (cubic γ-recursion + forward Σ-recursion).
  • SSVI calendar-spread free — only checked the ATM term structure; full Gatheral-Jacquier 2014 Theorem 4.2 condition now enforced over the smile grid. ATM-only check retained as is_atm_calendar_spread_free.
  • CVaR alpha-axisempirical_cvar now asserts alpha < 0.5 so users who pass confidence-style 0.95 crash loudly instead of averaging nearly the full distribution.
  • SABR ↔ DVector round-trip — silently forced β=1.0; From impls now use a 4-vec [α, β, ν, ρ] (lossless). Internal LM solver uses a private as_lm_vec() 3-vec helper.
  • TimeExt panic-on-missingtau_or_from_dates / tau_with_dcc now return f64::NAN (matching Greeks::default) instead of panicking.
  • Heston Cui (2017) Jacobian test — tolerance tightened from 2e-1 (20%) to 5e-3. Cui math is correct line-for-line; loose tolerance would have masked 5–10% regressions.
  • CgmysvCalibrator / HKDECalibrator / HscmCalibrator now implement the unified Calibrator trait with Result<Output, Error> so they compose with generic pipelines.

P0 release-blocker fixes

  • fbm.rs duplicate Array2 import (E0252) on the python+gpu combo. cargo check --workspace --all-features clean. CI matrix expanded with the combo.
  • interest::bgm honestly scoped as parallel forward-Euler multiplicative martingales (not BGM/LMM, paths can go negative). A proper drift-coupled LIBOR Market Model is now interest::lmm::Lmm (spot-LIBOR measure, log-Euler positivity-preserving stepping, optional Cholesky correlation).
  • theta / mu doc-swap on OU / CIR / Vasicek: theta is mean-reversion speed, mu is the long-run mean.
  • copulas::multivariate::{Tree, Vine} scope-doc — these are Gaussian-collapsed implied-correlation copulas, not real R-vine pair-copula constructions.
  • stats::fou_estimator::FilterType::Classical removed (was panic-only).
  • tests/debug_fukasawa.rs #[ignore]-d (was a no-assertion diagnostic polluting workspace test output).

P1 fixes

  • 17 production panic!s in stochastic-rs-stochastic moved to constructor-side validation (validate_drift_args, validate_n_or_tmax).
  • stats::fd::FractalDim returns Result<FdResult, FdError> (6-variant error enum) instead of panicking on degenerate input.
  • stats::fou_estimator V1/V2/V4 refactored from struct API to free fns over ArrayView1<f64> (zero-copy boundary). 786 → 562 LoC, 2 → 11 tests, 3 bit-exact regression guards.
  • 12 bench-style tests #[ignore]-d in distributions: cargo test -p stochastic-rs-distributions 119s → 0.03s.
  • 4 rand::random::<f64>() call-sites in copulas::multivariate::{Tree, Vine} replaced with SimdNormal::fill_slice_fast so seeded usage is deterministic.
  • PyPI macOS x86_64 (Intel) wheels back: macos-13 builder added alongside aarch64.
  • CI: 8-element feature matrix ("", ai, openblas, yahoo, python, gpu, python,gpu, openblas,ai,yahoo) + new lint job (cargo fmt --check + clippy --workspace -D warnings). actions-rs/toolchain@v1dtolnay/rust-toolchain@stable.
  • publish.sh pre-publish gate (fmt + clippy + workspace test); optional --skip-gate bypass.
  • bergomi.rs / rbergomi.rs honest scope-doc (variance-matched scaled-Brownian-motion approximations, not true Volterra integrals). Pointers to crate::rough::MarkovLift / rl_heston::RlHeston / rl_bs::RlBs / process::volterra::Volterra.
  • Gbm::sample x0 default 0.01.0 (0 is an absorbing fixed point).
  • stochastic-rs-core/src/python.rs now #[cfg(feature = "python")]-gated.

Added

  • interest::lmm::Lmm — drift-coupled LIBOR Market Model.
  • examples/calibration_demo.rs — end-to-end multi-maturity calibration (BSM + Heston).
  • Vasicek::from_fou_estimate — stats↔quant adapter from FouEstimateResult.
  • StochVolNn::predict_implied_vol_surface + thin wrappers for HestonNn / OneFactorNn / RBergomiNn (gated on the quant feature of stochastic-rs-ai).
  • HypothesisTest trait + 8 implementations (ADF, KPSS, ERS, PhillipsPerron, LeybourneMcCabe, JarqueBera, AndersonDarling, ShapiroFrancia).
  • VariableDimensional<T> + ComplexPathOutput<T> marker traits for processes returning Vec<Array1<T>> and complex-valued paths.
  • Frank copula compute_theta — Brent root-finding + chunked Gauss-Legendre quadrature (prior custom Newton solver had a math bug in the Frank tau formula).
  • stochastic-rs-viz split into plottable.rs + grid_plotter.rs + convenience.rs; new Plottable<T> trait + GridPlotter builder + plot_process / plot_distribution / plot_vol_surface convenience fns.

Python bindings — 102 → 210 entries

96 new PyO3 classes + 12 pyfunctions. Every wrapper accepts seed=None routed through Deterministic::new(seed). AI bindings intentionally deferred to 2.x.

  • Quant pricers (~20): BSM, Heston, Sabr, Merton1976, Asian, Barrier, Compound, Chooser, Cliquet, Gap, SuperShare, CashOrNothing, AssetOrNothing, Floating-/Fixed-Lookback, BjerksundStensland2002, DoubleBarrier, MCBarrier, VarianceSwap, KirkSpread.
  • Quant Fourier (8 + Carr-Madan engine): BSM, Heston, DoubleHeston, HKDE, Bates, Kou, MertonJD, CGMY, VG.
  • Bonds: Vasicek, CIR.
  • Calibrators (10): BSM, Heston, Sabr, SVJ, DoubleHeston, HKDE, RBergomi, Levy, SabrCaplet, Cgmysv.
  • Vol surface (5): SviRawParams, SsviParams, SviCalibrator, SsviCalibrator, ImpliedVolSurface (FFT).
  • Risk (3): VaR, ExpectedShortfall, DrawdownStats.
  • Microstructure (3 class + 5 fn): AlmgrenChrissPlan, KyleEquilibrium, OrderBook + multi_period_kyle, roll/effective/corwin_schultz spread, propagator price impact.
  • Curves (3): DiscountCurve, NelsonSiegel, ZeroCouponInflationCurve.
  • Factors (2 fn + 3 openblas-gated): ledoit_wolf_shrinkage, sample_covariance, PCA, FamaMacBeth, PairsStrategy.
  • Copulas (5 class + 4 fn): Clayton, Gumbel, Frank, Independence, EmpiricalCopula2D + kendall_tau_matrix, tau_matrix_to_corr_matrix, tau_to_corr, corr_to_tau.
  • Stats — Normality (3), Stationarity (5, openblas-gated), Hurst (2), Heston (2), Realised (6), Spectral/Changepoint (3), Density (3), Econometrics (4, openblas-gated), MCMC (1 fn).

Breaking from rc.0

  • stats::fou_estimator::FilterType::Classical removed (was panic-only). Enum is now enum FilterType { Daubechies }.
  • stats::fou_estimator::FOUParameterEstimationV{1,2,4} structs → free fns estimate_fou_v{1,2,4}(path: ArrayView1<f64>, ...). V3 retained as a sim+est round-trip helper.
  • stats::fd::FractalDim::estimate returns Result<FdResult, FdError> instead of panicking.
  • Gbm::sample x0 default 0.01.0.

Full Changelog: v2.0.0-rc.0...v2.0.0-rc.1

v2.0.0-rc.0

Choose a tag to compare

@dancixx dancixx released this 05 May 17:14
ca13730

First release candidate of stochastic-rs v2. Builds on v2.0.0-beta.3 with bug fixes and tighter umbrella feature-flag propagation across the workspace. 4 commits since beta.3.

What changed since beta.3

  • rc.0 blocker fixes (c577d89) — pricing, calibration, AI volatility surrogates, distribution special functions, and several sub-crate lib.rs modules.
  • Feature flag propagation fixed (791a0ab) — umbrella crate now forwards gpu, cuda-native, metal, and accelerate to sub-crates in addition to the previously propagated openblas and python.
  • Workspace bumped to 2.0.0-rc.0 (24571c5) across all 9 crates.
  • README install snippets updated to 2.0.0-rc.0 (ca13730).

Compatibility

Release candidate: public API surface is frozen. Only fixes are expected before 2.0.0. Please report regressions on the issue tracker.

Full Changelog: v2.0.0-beta.3...v2.0.0-rc.0