# Tutorials

URL: https://stochastic.rust-dd.com/docs/tutorials

> End-to-end walkthroughs in Rust and Python — the Heston model, Hurst estimation, SVI and SSVI surfaces, and GPU paths on a free Colab GPU.

Long-form, end-to-end walkthroughs. Each tutorial builds one concrete
artefact (a calibrated model, a vol surface, a backtested signal) from
scratch, with full code in both Rust and Python.

## Tutorials

| Tutorial                                                                | What you build                                                                                                                          |
| ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [Heston: simulate, price and calibrate](/docs/tutorials/heston)         | Heston paths under Euler and QE, closed-form, Fourier and ADI prices, a calibration to option prices and an estimate from time series   |
| [Estimate the Hurst exponent](/docs/tutorials/hurst-exponent)           | A fractional Brownian path with a known $H$, four estimates of it, and a rule for choosing among the eight estimators                   |
| [Fit an SVI volatility surface](/docs/tutorials/svi-volatility-surface) | A raw SVI fit checked for butterfly arbitrage, and an SSVI surface calibrated across maturities                                         |
| [GPU paths on a free Colab GPU](/docs/tutorials/gpu-paths-on-colab)     | The Python module with the CUDA back-end, the same process sampled on the host and on the device, and a check that the two agree in law |

## Planned tutorials

| Tutorial                 | What you build                                          |
| ------------------------ | ------------------------------------------------------- |
| AI surrogate training    | Train a Heston NN surrogate from scratch                |
| Pairs trading            | Cointegration test → hedge ratio → z-score signal       |
| Risk pipeline            | VaR / CVaR / drawdown over a portfolio                  |
| Microstructure execution | Almgren-Chriss optimal execution on a synthetic LOB     |
| Python interop           | numpy → stochastic\_rs → numpy round-trip in a notebook |

The tutorials are filled in incrementally. While they land, use the
[Quickstart](/docs/getting-started/quickstart) plus the per-section
example blocks under [Processes](/docs/processes),
[Distributions](/docs/distributions), [Stats](/docs/stats), and
[Quant](/docs/quant).

## Format

Each tutorial follows a consistent structure:

1. **What you'll build** — a screenshot or a representative numerical
   output up front, so you know if the tutorial is for you.
2. **Prerequisites** — sub-crates, Cargo features, Python packages.
3. **Setup** — the boilerplate.
4. **Steps 1 … N** — each ≤ 30 lines of code, with prose explaining the
   why.
5. **Result** — numerical output, plot, or both.
6. **Where to go next** — three cross-links into the catalog.

