stochastic-rs
A high-performance Rust library for simulating stochastic processes, with first-class bindings. Built for quantitative finance, statistical modeling and synthetic data generation.
Features
- 85+ stochastic models — diffusions, jump processes, stochastic volatility, interest rate models, autoregressive models, noise generators, and probability distributions
- Copulas — bivariate, multivariate, and empirical copulas with correlation utilities
- Quant toolbox — option pricing, bond analytics, calibration, loss models, order book, and trading strategies
- Statistics — MLE, kernel density estimation, fractional OU estimation, and CIR parameter fitting
- SIMD-optimized — fractional Gaussian noise, fractional Brownian motion, and all probability distributions use wide SIMD for fast sample generation
- Parallel sampling —
sample_par(m)generatesmindependent paths in parallel via rayon - Generic precision — most models support both
f32andf64 - Bindings — full stochastic model coverage with numpy integration; all models return numpy arrays
Installation
Rust
[]
= "1.0.0"
Bindings
Requires maturin:
Usage
Rust
use FBM;
use Heston;
use ProcessExt;
Bindings
All models return numpy arrays. Use dtype="f32" or dtype="f64" (default) to control precision.
# Basic processes
=
= # shape (1000,)
= # shape (500, 1000)
# Stochastic volatility
=
, =
# Models with callable parameters
=
=
# Jump processes with custom jump distributions
=
=
Contributing
Contributions are welcome — bug reports, feature suggestions, or PRs. Open an issue or start a discussion on GitHub.
License
MIT — see LICENSE.