locSvol
Calibration of local stochastic volatility models by fixed-point iteration, as proposed in
C. Bayer, D. Belomestny, P. P. Hager and J. Schoenmakers, Local stochastic volatility iterations, 2026.
A local stochastic volatility model
$$dS_t = L(t, S_t)\sqrt{Y_t},S_t,dW_t$$
combines a stochastic variance factor $Y$, for instance of a Bergomi or a Heston model, with a leverage factor $L$. It reproduces the implied volatility surface of the market when
$$L(t, s)^2,\mathbb E[Y_t \mid S_t = s] = \sigma_{\mathrm{Dup}}(t, s)^2,$$
where $\sigma_{\mathrm{Dup}}$ is Dupire's local volatility. locsvol finds $L$ by the fixed-point iteration $L_{i+1}^2 = \sigma_{\mathrm{Dup}}^2 / \mathbb E_i[Y \mid S]$: each iteration simulates the model with $L_i$ and approximates the conditional expectation by a single regression in time and spot. The resulting leverage factor is a smooth function with relatively few coefficients, which can be refined further against bid and ask quotes.
Example
examples/quickstart.py calibrates a two-factor Bergomi model to a smile made up from a known SSVI surface, so it runs without market data (about a minute on a laptop). Its core is
import jax.numpy as jnp
from locsvol.backbones import Bergomi
from locsvol.calibration import fixed_point
from locsvol.leverage import Chart, Clipped, Parametrized, quantile_bounds, quantile_envelope, tabulate
from locsvol.regression import ChebyshevTensor, GammaRegression
from locsvol.simulation import simulate
from locsvol.targets import Dupire, fit_ssvi, fit_svi
ssvi = fit_ssvi(maturities, log_strikes, quoted, weights) # SSVI fit to the quotes
surface = fit_svi(maturities, log_strikes, quoted, weights, ssvi) # refined slice by slice
times = jnp.linspace(0.0, 1.0, 401) # the Euler grid
reference = ssvi.extended(1.0) # theta continued to the horizon
chart = Chart(reference.theta_times, reference.theta_values, reference.eta, reference.gamma, (0.0, 1.0))
bounds = quantile_bounds(reference, times, 2e-4) # x_eps(t), x_{1-eps}(t)
local_volatility = tabulate(Clipped(Dupire(surface), *bounds), chart, times) # sigma_Dup(t, x)
chart = chart.with_envelope(*quantile_envelope(chart, reference, times, 2e-4))
backbone = Bergomi(nu=2.0, theta=0.2, rho1=-0.7, rho2=-0.3)
paths = simulate(backbone, times, dict(seed=1, role="calibration"), 16384)
basis = ChebyshevTensor((6, 8))
start = Parametrized(local_volatility, chart, basis, jnp.zeros(basis.size)) # L = sigma_Dup exp(b^T beta)
iterates = fixed_point(start, local_volatility, paths, GammaRegression(basis, ridge=1e-6), 5)
for quotes given as arrays maturities, log_strikes, quoted and weights of equal length. The
script uses a time grid graded towards zero and a finer table of the target, and prices the
calibrated model on independent paths: it reproduces the quotes within 12 basis points of implied
volatility.
Contents
| Targets | SSVI, eSSVI and SVI surfaces, Dupire local volatility, analytic test surfaces |
| Backbones | two-factor Bergomi, Heston, SABR, constant volatility, and models of your own |
| Regression | Gamma regression with log link, least squares, bins, kernel estimates, neural networks; Chebyshev and spline bases |
| Calibration | fixed-point iteration, particle method of Guyon and Henry-Labordère, correction against bid and ask quotes, fits of the backbone |
| Pricing | Black formula, implied volatility, Monte Carlo prices |
docs/method.md explains the method step by step, with the functions that
implement each step, and docs/models.md describes every model. Each module's
folder under src/locsvol/ has a README.md that explains its construction in the terms of the
paper.
The study of the paper
experiments/spx contains the calibration to S&P 500 options of the paper: its specification, the script that runs it with this package, and the results for every date pair and backbone. experiments/essvi repeats the study on a parametric target of the literature, the eSSVI surface of Farkas, Ferrari and Ulrych for SPX on 23 June 2020 with the reference models of Beiglböck, Hasenbichler and Pammer as backbones.
Installation
pip install locsvol
The fit of the Heston backbone needs the package roughprix, which the extra heston adds
(pip install "locsvol[heston]"). To rerun the study of the paper, clone the repository and
install it with the extra study, pip install -e ".[study]".
License
locsvol is licensed under the Apache License 2.0; see LICENSE.
Metadata
Release files for locsvol 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| locsvol-1.0.1.tar.gz | 113.9 kB | With provenance | Details for locsvol-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| locsvol-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for locsvol-1.0.1-py3-none-any.whl |
Total release size: 230.8 kB
Release files / locsvol-1.0.1.tar.gz
| Download URL | locsvol-1.0.1.tar.gz |
|---|---|
| Size | 113.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f0a09691ce98207242535d3ce4a4395c56b9c97f07aec023b4a416ed46ddc0d
|
|
BLAKE2b-256 checksum How to use checksums |
01eb35aa6902abfc7b3476335527fb5736e3c46f6fcd70424a890a255e826ae7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logRelease files / locsvol-1.0.1-py3-none-any.whl
| Download URL | locsvol-1.0.1-py3-none-any.whl |
|---|---|
| Size | 116.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca6a1e61a18b405719f2d066cb5769fdad9e3e9485fd2775d8bcb7d2f9baf227
|
|
BLAKE2b-256 checksum How to use checksums |
ace68f83d0eb0c560080ae0a0ce0c332ac0dbeb9eace59d0935ef6aeced25bcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logSecurity for locsvol 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for locsvol-1.0.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.