levymmd
Expected signature kernels and maximum mean discrepancies for inhomogeneous Lévy processes.
Companion code for P. K. Friz and P. P. Hager, Expected Signature Kernels for Lévy Rough Paths, arXiv:2509.07893.
The expected signature of an inhomogeneous Lévy process is the development of an absolutely continuous path in the extended tensor algebra, driven by the characteristic velocities of the process. The kernel between two such laws therefore solves a PDE system — a Goursat problem in the Gaussian martingale case — and can be evaluated directly, without simulating either process. This package implements that evaluation and the MMD statistics built on it.
Installation
pip install -e . # add [test] for the test dependencies
Tensor arithmetic comes from tensordev,
installed from PyPI.
The package
levymmd.levy builds a process from its characteristic triplet.
LevyProcess composes a drift, a diffusion and a jump part — each available in
homogeneous, separable and general time dependence — and each part reports its
characteristic velocities as well as simulating. MixtureProcess and
SwitchingProcess compose whole processes. The worked examples of the paper,
such as sin_cos_gaussian_martingale and covariance_loop_martingale, are
constructors in levymmd.levy.examples.
levymmd.mmd turns laws and observed paths into kernels. Three families
cover the combinations of the two argument types:
| against a path sample | against a Lévy law | |
|---|---|---|
| path sample | path_path_kernel |
path_levy_kernel |
| Lévy law | — | levy_levy_kernel |
each with a _gram form for many pairs at once and an _mmd form for the
squared discrepancy. Paths enter as Sample, laws as Law, and
inner_products evaluates any requested blocks of the resulting Gram matrix in
a single pass, so several statistics on the same data cost one computation
rather than one each. finite_grid_statistics contracts those blocks into the
signature and quadratic-variation statistics the paper compares.
Reproducing the paper
Each experiment is a notebook that runs top to bottom. Open it, run all cells, and that part of the paper reappears.
| Notebook | Produces |
|---|---|
notebooks/gof/gof.ipynb |
Figure fig:gof_power, Table tab:gof_size_variance |
notebooks/validation/mc_validation.ipynb |
Figures fig:numerics_gaussian_irregular, fig:numerics_gaussian_paths |
notebooks/truncation/truncation_analysis.ipynb |
Figure fig:trunc_circle |
The Monte Carlo sample pools are not distributed, so a first run computes them
— hours for the goodness-of-fit study, less for the other two. They are then
kept locally and git-ignored, and each notebook reuses what it finds: an
interrupted study resumes where it stopped, and redrawing a figure never reruns
a simulation. Each experiment's REPORT.md records its results and how they
were obtained.
Tests
pytest tests
Metadata
Release files for levymmd 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| levymmd-0.1.0.tar.gz | 88.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| levymmd-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 146.0 kB
Release files / levymmd-0.1.0.tar.gz
| Download URL | levymmd-0.1.0.tar.gz |
|---|---|
| Size | 88.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dbc44dd63f2e7959c326284183e48f4f3db8ad6c47cd3710b3b320b7b9d21881
|
|
BLAKE2b-256 checksum How to use checksums |
8ebeb2cb4d774ad72fb8ccf853001b2d4706c2ac028112a9456d833af42ec906
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 19, 2026.
Transparency logRelease files / levymmd-0.1.0-py3-none-any.whl
| Download URL | levymmd-0.1.0-py3-none-any.whl |
|---|---|
| Size | 57.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
200ab164c7f4be65973914e815026f2819cb3c5d10ad97bcc9ff0eb2c4f9f704
|
|
BLAKE2b-256 checksum How to use checksums |
289d0a4d37107150efd37f969b12338a2635cda78c8f7a47e860a4b4882eb28c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 19, 2026.
Transparency log