Coder Social home page Coder Social logo

fues_egm's Introduction

FUES_EGM

The Endogenous grid method (EGM) using fast upper-envelope scan (FUES).

Initial beta replication material for `Fast upper-envelope scan for discrete-continuous dynamic programming' by Dobrescu and Shanker (2023).

See slides....pdf for overview of upper envelope scan.

Example use of FUES

Suppose we have the following arrays: an unrefined endogenous grid x_hat, the value correspondence on the unrefined grid v_hat and two policy functions, c_hat and a_prime_hat.

from FUES.FUES import FUES

x_clean, vf_clean, c_clean, a_prime_clean, dela \
        = FUES(x_hat, v_hat, c_hat, a_prime_hat, M_bar = 2, LB = 10)

The outputs are the refined grids, M_bar is the jump detection threshold and LB is the number of steps to take in the forward and backward scans.

Application 1

Plots

Consumption policy function generated using Ishkakov et al (2017) params and no smoothing:

ret_cons_all

Upper envelope generation using FUES and Ishkakov et al (2017) params (age 17):

ret_vf_aprime_all_17

Upper envelope and policy functions for Ishkakov et al (2017) params and smoothing param = 0.05:

ret_vf_aprime_all_17_sigma

ret_cons_all_sigma

Comparison with DC-EGM (age 17):

ret_vf_aprime_all_2000_cf_17

Comparison to DC-EGM

The following code block in retirement_plot.py compares DC-EGM with FUES across an array of parameter values:

https://github.com/akshayshanker/FUES_EGM/blob/fa725a6285fee9def7e8ad07606603a658cdccf6/retirement_plot.py#L381-L470

To perform the comparison, we first solve the full model using FUES, which gives the final solution computed using FUES and also the unrefined endogenous grids for each age. For a given age, we then compute the upper envelope using DC-EGM and FUES. The upper envelopes are compared on the optimal endogenous grid points as determined by DC-EGM.

(Compared on optimal points to avoid picking up errors arising from different interpolation steps used by DC-EGM and FUES. DC-EGM interpolates line segments on the unrefined grid while FUES first calculates the optimal points then interpolates over the unrefined grid.)

Test DC-EGM vs. FUES on uniform grid of 1000 parameters:
 beta: (0.85,0.98), y: (10,25), delta: (0.5,1.5)
Avg. error between DC-EGM and FUES: 0.000000
Timings:
 Avg. FUES time (secs): 0.001375
 Avg. worker iteration time (secs): 0.004314

fues_egm's People

Contributors

akshayshanker avatar

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.