Coder Social home page Coder Social logo

julienpascal / bc-mc_operator Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 1.0 713.95 MB

This repository contains the code to generate results from the paper "Artificial Neural Networks to solve dynamic programming problems: a bias-corrected Monte Carlo operator".

License: MIT License

Jupyter Notebook 100.00% Shell 0.01%

bc-mc_operator's Introduction

The bias-corrected Monte Carlo operator

Artificial Neural Networks to Solve Dynamic Programming Problems: A Bias-Corrected Monte Carlo Operator

This repository contains the code for the paper "Artificial Neural Networks to Solve Dynamic Programming Problems: A Bias-Corrected Monte Carlo Operator", available here in the Journal of Economic Dynamics and Control:

and here is a pre-print version:

Folders and Files

Folder 6.Brock_Mirman_Colab

Folder to solve the simple textbook Brock and Mirman (1972) model with full depreciation.

Notebooks (BM_1.ipynb, ..., BM_8.ipynb) were executed on Google Colab. Notebooks and output files (initially saved on Google Drive) were then downloaded locally in this folder. Notebooks are for different optimizers (ADAM or SGD) and different values of the learning rate.

To create Figures 1 and 2 (saved in the folder output), use the notebook plot_BM.ipynb. Functions are stored in the notebook functions_BM.ipynb.

The notebook plot_BM.ipynb also creates Figures 8 - 21 in the online Appendix.

Folder 7.model_with_bc_2

Folder to solve the consumption-savings problem with a borrowing constraint.

The notebook bc-MC-consumption-savings_bc_0.ipynb solves the model with $b=0$. It creates panel A of Figure 3. The notebook bc-MC-consumption-savings_bc_1.ipynb solves the model with $b=1$. It creates panel B of Figure 3.

Folder 8.model_with_bc_2_Colab

Folder to solve the consumption-savings problem with a borrowing constraint.

Notebooks (bc-MC-consumption-savings_bc_hyperparams_1.ipynb, ..., bc-MC-consumption-savings_bc_hyperparams_4.ipynb) were executed on Google Colab. Notebooks and output files (initially saved on Google Drive) were then downloaded locally in the folder. Notebooks are for different optimizers (ADAM or SGD) and different values of the learning rate.

To create Figures 4 and 5 (saved in the folder output), use the notebook plot_bc.ipynb. Functions are stored in the notebook functions-bc-MC-consumption-savings.ipynb.

The notebook plot_bc.ipynb also creates Figures 22 - 35 in the online Appendix.

Folder 9.large_scale_model_2

Folder to solve variants of the consumption-savings problem, varying the dimension for the state vector and the shock vector. Compare the bc-MC operator to the Time Iteration (TI) algorithm with a dense grid, a sparse grid, as well as an adaptive sparse grid.

The notebook bc-MC-consumption-savings_large_scale_1.ipynb creates Figures 6 and 7.

Folder 10.OLG_model

NOT in the paper. The notebook OLG.ipynb shows how the bc-MC operator can be used to approximate global solutions of economic models with overlapping generations (OLG).

References

To cite this work:

@article{PASCAL2024104853,
title = {Artificial neural networks to solve dynamic programming problems: A bias-corrected Monte Carlo operator},
journal = {Journal of Economic Dynamics and Control},
volume = {162},
pages = {104853},
year = {2024},
issn = {0165-1889},
doi = {https://doi.org/10.1016/j.jedc.2024.104853},
url = {https://www.sciencedirect.com/science/article/pii/S0165188924000459},
author = {Julien Pascal}
}

Computational details

Folders 6.Brock_Mirman_Colab and 8.model_with_bc_2_Colab

Calculations performed with Google Colab. See the results of "cpuinfo" in the notebooks for details on the machines.

Folders 7.model_with_bc_2, 9.large_scale_model_2 and 10.OLG_model

All calculations performed on the same laptop: Intel® Core™ i7-8850H CPU @ 2.60GHz × 12, Ubuntu 20.04.6 LTS. Python 3.8.10.

bc-mc_operator's People

Contributors

julienpascal avatar

Stargazers

王贤康 avatar Christophe Gouel avatar Xuanli Zhu avatar Thore Kockerols avatar Gabriel Appau Abeyie avatar EconMaett avatar  avatar Giuseppe Pulina avatar Dawie van Lill avatar

Watchers

 avatar Kostas Georgiou avatar EconMaett avatar

Forkers

sadyk703

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.