Giter Site home page Giter Site logo

willmaticona / olglinkedbequest Goto Github PK

View Code? Open in Web Editor NEW

This project forked from frederik-tim-econ/olglinkedbequest

0.0 0.0 0.0 1.2 MB

A code library and a detailed toolkit on how to solve, simulate, and estimate an overlapping generations model with family-linked accidental and voluntary bequest, intergenerational transmission of skills, persistent idiosyncratic income risk, permanent income heterogeneity, and retirement.

License: MIT License

Python 99.51% TeX 0.49%

olglinkedbequest's Introduction

Solving, simulating and estimating OLG models with linked bequest and intergenerational skill transmission

REQUIREMENTS

This module requires the following:

  • Python (3.7)
  • Quantecon package for Python
    • If you do not use Anaconda follow this: https://quantecon.org/quantecon-py/

    • If you are using Anaconda:

      1. Type into cmd:
       pip install quantecon
      
      1. Type into your Python compiler prompt:
       !conda install -y quantecon
      

OVERVIEW OF FILES (scripts)

  • Main.py:

    • Runs the whole code.
    • Defines the exogenous and estimated parameter values in "par".
    • From Model.py, Main.py calls solve(), sim(), and estimates parameters by optimizing objective().
  • Model.py:

    • solveT(): Solves the final period of the model as a starting point for backward induction (BI).
    • solve(): Solves every period by backward induction and EGM. Calls solveT() for starting point.
    • sim(): Simuates a set of families for # iterations, using output of solve(). Calls simMortality().
    • objecive(): Defines a 2D objective function for estimation of parameters. Calls moments().
    • moments(): Computes moments to be caompared to targets in objective().
    • gini(): Computes the Gini coefficient of any vector, at a given level of stratification.
    • simMortality(): Simulates the mortality pattern of a single generation. Is called by sim() and moments().
    • plots(): Creates relevant plots for simulation results, including convergence plots.
    • Table(): Creates a table that compares model moments to empirical moments.
  • tools.py: (By Jeppe Druedahl https://sites.google.com/view/jeppe-druedahl/home)

    • Contains helper functions that support the funcions of Model.py.

GUIDE TO RUN

  1. Make sure that requirements are met.
  2. Set exogenous parameters (or if desired estimated parameters).
    • Note that T, r, and ch cannot be changed freely. Any configuration of these must be consistent with assumptions (1)-(3) in Section 2.1.
  3. Run solve() to produce policy functions.
  4. Run sim() to simulate an economy given policy functions.
  5. If desired, estimate the model by setting target moments and starting values, and running "solution = optimize.minimize(...)". The solution can

Model features

  1. Overlapping generations
  2. Family-linked voluntary luxury bequest
  3. Family-linked accidental bequest
  4. Family-linked transmission of skill
  5. Permanent income inequality
  6. Persistent idiosyncratic income risk

Results

Consumption path (means by skill type)

Wealth path (means by skill type)

Wealth distribution at retirement

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.