Mean Field Tools
A Python library for numerically solving McKean-Vlasov forward-backward stochastic differential equations (MV-FBSDEs) under common noise using elicitability, deep learning and Picard iterations.
It accompanies the paper Deep Learning and Elicitability for McKean-Vlasov FBSDEs With Common Noise — see How to cite this work.
Features
- Deep BSDE (Backward Stochastic Differential Equation) solvers
- Forward-Backward SDE implementations with Picard iteration
- Neural-network function approximators (including ResNet architectures)
- Mean field flow measure approximations (with common-noise support)
- Filtration tools for Brownian motion and stochastic state tracking
Installation
# Clone the repository
git clone https://github.com/fjpAntunes/mean-field-tools.git
cd mean-field-tools
# Install with Poetry
poetry install
Usage
See mean_field_tools/deep_bsde/README.md for a detailed overview of the components, and mean_field_tools/deep_bsde/script/experiments/ for runnable examples (systemic risk, portfolio hedging, economic growth, and more).
Testing
The project uses pytest for testing. Tests are organized into unit and integration tests within the mean_field_tools/deep_bsde/test/ directory.
# Run all tests
pytest
# Run specific test categories
pytest mean_field_tools/deep_bsde/test/unit/
pytest mean_field_tools/deep_bsde/test/integration/
# Run a specific test file
pytest mean_field_tools/deep_bsde/test/unit/test_function_approximator.py
Structure
mean_field_tools/deep_bsde/: Core library — the Deep BSDE solver and its componentsfiltration.py: Brownian motion generation and stochastic state trackingforward_backward_sde.py: Forward/Backward SDE classes and Picard iterationfunction_approximator.py: Neural-network approximatorsmeasure_flow.py: Mean field flow measure approximationsartist.py: Plotting and diagnosticsscript/experiments/: Example applicationstest/: Unit and integration tests
How to cite this work
If you use this library in your research, please cite:
Felipe J. P. Antunes, Yuri F. Saporito, and Sebastian Jaimungal. Deep Learning and Elicitability for McKean-Vlasov FBSDEs With Common Noise, 2026. arXiv:2512.14967.
@misc{antunes2026deeplearningelicitabilitymckeanvlasov,
title={Deep Learning and Elicitability for McKean-Vlasov FBSDEs With Common Noise},
author={Felipe J. P. Antunes and Yuri F. Saporito and Sebastian Jaimungal},
year={2026},
eprint={2512.14967},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2512.14967},
}
License
MIT
Release files for mean-field-tools 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 | |
|---|---|---|---|
| mean_field_tools-0.1.0.tar.gz | 20.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mean_field_tools-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:43.2 kB
Release files / mean_field_tools-0.1.0.tar.gz
| Download URL | mean_field_tools-0.1.0.tar.gz |
|---|---|
| Size | 20.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bb004c5abfe4035d4c2141c6c8afa1e0b0bbc8f1e2d4c024c6a9d127af721443
|
|
BLAKE2b-256 checksum How to use checksums |
71c1d0dfef6d551dba39bcdac09ca1bab2e577670eefbcb3a12634a34d40b793
|
| 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 Sep 16, 2026.
Transparency logRelease files / mean_field_tools-0.1.0-py3-none-any.whl
| Download URL | mean_field_tools-0.1.0-py3-none-any.whl |
|---|---|
| Size | 22.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f44c0fe6c0d5a2f5c85b4a02426bb2d5f9794ed41ce33184705feca5190b91ec
|
|
BLAKE2b-256 checksum How to use checksums |
512eada69f85e132bb90c80d473eb451efad629f7b3f9c5a7dd892f81e142f64
|
| 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 Sep 16, 2026.
Transparency log