Skip to main content

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for locsvol 1.0.0
File Size Uploaded Provenance Actions
locsvol-1.0.0.tar.gz 113.7 kB With provenance Details for locsvol-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for locsvol 1.0.0
File Interpreter ABI Platform Actions
locsvol-1.0.0-py3-none-any.whl Python 3 none any Details for locsvol-1.0.0-py3-none-any.whl

Total release size: 230.4 kB

Release files / locsvol-1.0.0.tar.gz

Download URL locsvol-1.0.0.tar.gz
Size 113.7 kB
Tags Source
SHA-256 checksum
How to use checksums
38964cce3c22aa7c27c799a49379c784313d563aff5ba9b36f474de5cc7d132f
BLAKE2b-256 checksum
How to use checksums
1fbab703929c800b883720c9b327aedd2f3eb00fb74224642fca9224ae01729f
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 13, 2026.

Transparency log

Release files / locsvol-1.0.0-py3-none-any.whl

Download URL locsvol-1.0.0-py3-none-any.whl
Size 116.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5fff0c68d98df00ac2149144eead136dc04c3e50d38d660effc6f576651e8120
BLAKE2b-256 checksum
How to use checksums
5fcb034c4eebc4b53b9d5f8bd9e8b0721957ca71deecbcea1aa6c02890691feb
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 13, 2026.

Transparency log

Security for locsvol 1.0.0

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.

Select from 2 files

Attestation for locsvol-1.0.0.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 13, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page