Giter VIP home page Giter VIP logo

ccf2012-replicationcodes's Introduction

CCF2012-ReplicationCodes

License

These codes reproduce the results in:

Chen, H., Cúrdia, V., and Ferrero, A. (2012)
The Macroeconomic Effects of Large-Scale Asset Purchase Programs
The Economic Journal, 122, pp. 289-315.

Technical Appendix

These replication codes are available online at:
https://github.com/vcurdia/CCF2012-ReplicationCodes

Requirements

Matlab (R)

The codes were tested using Matlab (R) R2012a with the following toolboxes

  • Symbolic Toolbox
  • Statistical Toolbox
  • Optimization Toolbox

LaTeX

LaTeX is used by some tools to compile certain documents.

epstopdf, included in most LaTeX releases, is used by some tools.

Additional codes and packages

Codes from Vasco Cúrdia:

Codes from Chris Sims:

All auxiliary codes included in this repository in subfolders.

Description of Replication Codes

Estimation

RPRatioSetDSGE.m
Sets up the model for estimation and runs all the steps for estimation generating appropriate logs, estimation reports and diagnostics in a fully automated mode.

Data_1975q1_2009q3_BLMVB.mat Contains the data, ready to be used in Matlab.

Note: it may take a long time to run with the current settings without using a parallel computing cluster because with default the following estimation stages are implemented:

  1. Run 20 posterior numerical mode searches starting at different guess vectors. For each of those it will restart the search up to 30 more times to confirm that it is not a local mode.

  2. Will run three stages of Markov-Chain-Monte-Carlo (MCMC) each for four separate chains:
    2.1. First stage uses the negative of the inverse hessian at the posterior peak to form the covariance matrix for MCMC draws, scaled to have a rejection rate between 70 and 80 percent (numerical search). It generates 100,000 draws using a Metropolis algorithm.
    2.2. After the previous stage, the code discards the first quarter of the draws for each chain, combines the remain from each chain and computes the covariance matrix, which is then used as the new covariance for the next stage of MCMC. It is again numerically rescaled to yield a rejection rate between 70 and 80 percent. It generates 200,000 draws.
    2.3. We repeat step 2.2. one more time.

In each of the MCMC stages a full report with diagnostics and some inference is generated. It also produces a reduced set of draws (1000 by default) needed to make the simulations for the paper. The one for the last stage is included with the codes: RPRatioMCMCDrawsUpdate2Redux.mat

Table 2 in the paper is a slight modification of the first table in the report for the last estimation stage.

Model simulations

BLMVBSimSetup.m
Sets up the model for simulations, with some additional variables that were not needed for estimation but are needed for the simulations.

ModelSimRun.m
Main script to generate all simulations with the model. Offers many options and switches to tweak simulations and plots.

ModelSimRun.m requires BLMVBSimSetup.m to be run first and calls the following files:

  • ModelSimRunFcn.m
    Subfunction to use inside a loop to generate simulations for each draw.
  • RPRatio.mat
    Contains the estimation results (but not the MCMC Draws).
  • RPRatioMCMCDrawsUpdate2Redux.mat
    Contains a reduced sample from the MCMC Draws.

To make replication of results simpler below are listed five scripts that are similar to ModelSimRun.m but with options and switches set to generate excatly the figures in the paper. They need to be run in this order to avoid any missing files:

  • MakeFig1.m
  • MakeFig2.m
  • MakeFig3.m
  • MakeFig4.m
  • MakeFig5.m

The corresponding figures in pdf format are saved in subfolders.

ccf2012-replicationcodes's People

Contributors

vcurdia 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.