Giter VIP home page Giter VIP logo

g2egm's Introduction

G2EGM

Code for A General Endogenous Grid Method for Multi-Dimensional Models with Non-Convexities and Constraints, Druedahl and Jørgensen, 2017, Journal of Economic Dynamics and Control, 74.

Python-version: See ConsumptionSavingNotebooks.

ReadMe

This version of the code differ from the one used in the paper due to changes in MATLABs MEX setup.

The code is written and tested for 64-bit Windows machines using MATLAB 2018b. It requires MATLAB and a C++ compiler.

Tested using Microsoft Visual Studio 2017 Community Edition (free): https://visualstudio.microsoft.com/downloads/.

  • For NLopt see cfuncs\ReadMe\NLopt.txt
  • For vectorclass see cfuncs\ReadMe_vectorclass.txt.

Folder structure

All MATLAB files are in the main folder.

  • The subfolder \cfuncs contains all the C-files.
  • The subfolder \data is used for storing solution data.
  • The subfolder \figures are used for storing printed figures.

Main

  • fun.m: contains various MATLAB functions.
  • egmfun.m contains MATLAB functions unique for EGM.
  • solve.m: contains MATLAB functions for solving.

2-dimensional model

  • SetupPar.m: function for setting the parameter struct.
  • accuracy.m: computes the speed and accuracy measures used in the paper for.
  • main.m: solves the model for selected specifications and prints figures.
  • funfig.m: containt MATLAB functions for printing.

3-dimensional model

  • SetupPar_3d.m: function for setting the parameter struct.
  • accuracy_3d.m: computes the speed and accuracy measures used in the paper for.
  • main_3d.m: solves the model for selected specifications and prints figures.
  • funfig_3d.m: containt MATLAB functions for printing.

Other

  • test_EGM.m: simple test file for running the algorithm.
  • illustrate_upperenvelope.m: create upper envelope illustrations.

C++-functions

  • mexVFI.cpp: solution algorithm with VFI.
  • mexVFI_NLopt.cpp: solution algorithm with VFI and NLopt.
  • mexUpperEnvelopeToCommon.cpp: G2EGM upper envelope and interpolation to common grid.
  • mex_acon_grid.cpp: construction of acon grid for 3-dimensional model.
  • mesh_E.cpp: construction of w, wa and wb.
  • mesh_E_vec.cpp: construction of w, wa and wb using some vector operations.
  • base_funcs.c: various C++-functions.
  • mesh_interp.cpp: interpolation function.
  • HighResTimer_class.hpp: timing function.

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.