Skip to main content

Deep neural network for solving continuous time economic models

Project description

Deep-MacroFin

Build Status PyPI version PyPI Downloads PyPI - License

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 approximators
  • macro_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 repo
  • pymacrofin_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}, 
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deep_macrofin-0.5.0.tar.gz (31.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deep_macrofin-0.5.0-py3-none-any.whl (144.5 kB view details)

Uploaded Python 3

File details

Details for the file deep_macrofin-0.5.0.tar.gz.

File metadata

  • Download URL: deep_macrofin-0.5.0.tar.gz
  • Upload date:
  • Size: 31.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for deep_macrofin-0.5.0.tar.gz
Algorithm Hash digest
SHA256 774bf2aedc1ce86ed106b6a494f7617c7e91eca5d900b21d812c01973a681992
MD5 ffe5f16462ffe16aaaa6a49170c23453
BLAKE2b-256 251607971da19b4bdeb20d3dffa90c32ea5660400772eed534b1a3bf19918029

See more details on using hashes here.

Provenance

The following attestation bundles were made for deep_macrofin-0.5.0.tar.gz:

Publisher: ci-build.yaml on rotmanfinhub/deep-macrofin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file deep_macrofin-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: deep_macrofin-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 144.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for deep_macrofin-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c26b601a55c91ab0d9622cf41936743b6506be7b2ebe86a28c1c7b7f52c3f669
MD5 c7da4e13eddc25f599d0b698cfb25e2c
BLAKE2b-256 fa7296795bcdcf491b07e80ee8eaed0795f1db88553aafdc32e4cfd5dc878473

See more details on using hashes here.

Provenance

The following attestation bundles were made for deep_macrofin-0.5.0-py3-none-any.whl:

Publisher: ci-build.yaml on rotmanfinhub/deep-macrofin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page