Deep-MacroFin
Deep-MacroFin is a comprehensive deep-learning framework designed to solve equilibrium economic models in continuous time. The library leverages deep learning to alleviate curse of dimensionality.
Documentation: mkdocs
Start developing
Code
All the code are under deep_macrofin, and the tests are under tests
The project is now configured with uv for dependency management and packaging. To install the dependencies and run the code:
uv sync # this will automatically download suitable python versions, create virtual environment and install packages in pyproject.toml file
## You can now run the tests using the command:
pytest tests
To run the code and tests locally without poetry:
python -m venv venv
source venv/bin/activate # venv/Scripts/activate using Windows powershell
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -r requirements-doc.txt
For easier testing, you can create a file in the root folder of the project, and import functions from deep_macrofin.
To properly run all tests in the tests/ folder
pip install -e .
pytest tests/
Examples
Various examples using the library, with comparisons to DeepXDE and PyMacroFin are included in examples
basic_examples: Solutions to basic ODEs/PDEs, diffusion equation, function approximation and systems of ODEs, with some comparisons to DeepXDE.initial_examples: Initial scripts for testing deep neural networks for ODE/PDE solutions, and macromodels.kan_examples: Solutions to basic ODEs, using KAN as approximatorsmacro_problems: Macroeconomic models in different dimensions.paper_example: Examples in the paper, with PyMacroFin and deepXDE comparisons. Models and log files for reproducing paper results can be found in Google Drive. For a complete set of experiments, see this GitHub repopymacrofin_eg: Examples from PyMacroFin and proposition 2 from Brunnermeier and Sannikov (2014)
Note: PyMacroFin and DeepXDE are used as benchmarks in several examples, but the associated packages are not included in this repo's requirements.txt. To run the comparisons properly, please install their packages respectively.
Docs
The documentation site is based on mkdocs and mkdocs-mateiral.
Layouts
mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
To see the site locally, run the following command:
mkdocs serve
Cite Deep-MacroFin
If you use Deep-MacroFin for academic research, you are encouraged to cite the following paper:
@misc{wu2024deepmacrofin,
title={Deep-MacroFin: Informed Equilibrium Neural Network for Continuous Time Economic Models},
author={Yuntao Wu and Jiayuan Guo and Goutham Gopalakrishna and Zisis Poulos},
year={2024},
eprint={2408.10368},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2408.10368},
}
Release files for deep-macrofin 0.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| deep_macrofin-0.5.3.tar.gz | 32.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| deep_macrofin-0.5.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.2 MB
Release files / deep_macrofin-0.5.3.tar.gz
| Download URL | deep_macrofin-0.5.3.tar.gz |
|---|---|
| Size | 32.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
50c8eb86ec44ac66fde84d576aacfda07e74808bd516eebe6eb540b15ec0be3c
|
|
BLAKE2b-256 checksum How to use checksums |
ba531db96f115dab4be3ca6bb86c475fbfbc19e6bb3c4cf484888e7c6be26aee
|
| 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 4, 2026.
Transparency logRelease files / deep_macrofin-0.5.3-py3-none-any.whl
| Download URL | deep_macrofin-0.5.3-py3-none-any.whl |
|---|---|
| Size | 147.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c30285f8196f052b8abc0effa4e51e2b0a348559f0eba21e9b1f8da9dbd5342
|
|
BLAKE2b-256 checksum How to use checksums |
27fe74e68168f72f5d6b45e37814a6632cc8f916349f5d6772e82b8d6931ed5a
|
| 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 4, 2026.
Transparency log