Structural modeling of economic choices of heterogeneous agents

GanongNoelUI


Analysis of Models for “Consumer Spending During Unemployment: Positive and Normative Implications”

By Peter Ganong and Pascal Noel

We thank Xian Ng for outstanding research assistance. Please send feedback and questions to ganong@uchicago.edu.

Directory Structure

  1. code/ - all estimation and analysis code
  2. input/ - model estimation targets from JP Morgan Chase Institute (JPMCI) data
  3. out/ - code output including figures, logfiles, and raw tables
  4. Parameters/ - environment parameters for estimation and analysis; stored model estimation results
  5. tables/ - formatted tables

Files in the code/ directory

Master Scripts: do_min.py, do_mid.py, do_all.py

The master scripts in the code directory re-run the code. To call the script from the command line, go to the code/ directory and enter ‘python '. Note that this project is built on python 2.7

  1. do_min.py: Solves the consumption and job search models using estimated parameters in Parameters/model_params_main.json to replicate the plots in the paper.
  2. do_mid.py: do_min.py + computes the standard errors on the parameter estimates, and performs the welfare simulations in the paper.
  3. do_all.py: do_mid.py + estimates the model parameters again using model targets from JPMCI data.
    To simply replicate the results, it is sufficient to run one of the scripts above.

Setup scripts

  1. setup_estimation_parameters.py reads in Parameters/params_ui_reemp.json to build the estimation environment
  2. build_JPMC_targets.py builds the model estimation targets from files in input/ and writes to Parameters/JPMC_inputs.py. It only needs to be run once.

Model Solving, Estimation, and Simulation scripts

  1. solve_cons.py - contains a function that takes environment and preference parameters and computes optimal consumption in each period as a function of cash-on-hand. It solves this problem using backwards induction for a finite horizon.
  2. job_search.py extends solve_cons.py. Takes environment and preference parameters and computes optimal consumption and job search in each period as a function of cash-on-hand.
  1. sparsity.py solves the sparse model from Gabaix (2016) in the UI context.
  2. estimate_models.py takes environmental parameters and consumption and job search moments and solves for the preference parameters that generate consumption and job search behavior similar to the moments. Relies on the class in job_search.py. By default, solves for the models in the paper one at a time. Can also be used to solve multiple models at once on a cluster.
  3. agent_history.py With a given set of environmental and preference parameters, simulates employment histories, consumption behavior, and job search behavior for N agents.

Plotting and Replication scripts

  1. model_plotting.py contains plotting functions. make_plots.py uses the rpy2 package to create some wrappers for making PDF plots in R.
  2. model_plots.py produces plots using the estimated preference parameters contained in Parameters/model_params_main.json and Parameters/model_params_sec.json.
  3. model_welfare.py performs the simulations for lifecycle welfare analysis.
  4. comp_SEs.py calculates standard errors for estimated models. Note: all output is in the /out/ directory.

Other files


published
name
GanongNoelUI
summary
Analysis of Models for "Consumer Spending During Unemployment: Positive and Normative Implications"
type
replication
authors
Christopher Carroll
tags
Replication
location_url
https://github.com/econ-ark/REMARK/tree/master/REMARKs/GanongNoelUI
github_user
econ-ark
github_repository
REMARK
github_branch
master
github_path
GanongNoelUI
date