Coder Social home page Coder Social logo

vjimenezg / perlatonettiwaugh.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jlperla/perlatonettiwaugh.jl

0.0 0.0 0.0 19.49 MB

Code and algorithms for "Equilibrium Technology Diffusion, Trade, and Growth"

Home Page: http://christophertonetti.com/files/papers/PerlaTonettiWaugh_DiffusionTradeAndGrowth.pdf

License: Other

Julia 3.51% Jupyter Notebook 90.84% MATLAB 5.14% Stata 0.51%

perlatonettiwaugh.jl's Introduction

Build Status

Overview

This repository contains the complete code used to calibrate the model and to compute equilibrium steady-state and transition dynamics of the model in Equilibrium Technology Diffusion, Trade, and Growth by Perla, Tonetti, and Waugh (AER 2020); OpenICPSR project number openicpsr-119393.

The derivation document has the complete set of equations defining the model. All equation numbers in the code refer to this document. General code and derivations for upwind finite difference methods are in the SimpleDifferentialOperators.jl package with detailed derivations.

As in the derivation, the code has a "warmup" model without trade or monopolistic competition to help build an understanding of the transition dynamics in the full model in a related but simpler growth model. The warmup model is also helpful for experimenting with the DAE and finite-difference discretization methods.


Directory of Code

  • /src/full contains all of the code used to compute the numerical results presented in the paper, given parameter values.

  • /src/calibration contains all of the code used to create empirical moments and calibrate the model to match those moments. Parameter values are outputs. Readme file describes this part of the code.


Directory of Notebooks for Results in Paper

The following notebooks compute all of the quantitative results and figures presented in the paper. They are organized by Section in accordance with NBER working paper No. 20881 (April 2020 revision).


Installation and Use

  1. Follow the instructions to install Julia and Jupyter

    1a. Optional: A Python installation is required for most of the figures.

    1b. Optional: Re-running the calibration requires Matlab.

    1c. Optional: Computing the SynLBD-derived moments requires Stata.

  2. Open the Julia REPL (see the documentation above) and then install the package (by entering package mode with ]) with

    ] add https://github.com/jlperla/PerlaTonettiWaugh.jl.git

    2a. Optional, but strongly encouraged: To install the exact set of packages used here (as opposed to using existing compatible versions on your machine), first run the following in the REPL

    using PerlaTonettiWaugh # will be slow the first time, due to precompilation
    cd(pkgdir(PerlaTonettiWaugh))

    Then, enter the package manager in the REPL (note that ] cannot be copy-pasted on OSX; you need to type it to enter the REPL mode.)

    ] activate .; instantiate
  3. There are several ways you can run the notebooks after installation

    Using the built-in Jupyter is straightforward. In the Julia terminal

    using PerlaTonettiWaugh, IJulia
    jupyterlab(dir=pkgdir(PerlaTonettiWaugh))

    Note: If this is the first time running a jupyterlab() command inside Julia, it may prompt you to install Julia via conda. Hit yes. Also, this will hand over control of your Julia session to the notebook. To get it back, hit control+c in the Julia REPL.

    Alternatively, to use a separate Jupyter installation you may have installed with Anaconda,

    using PerlaTonettiWaugh
    cd(pkgdir(PerlaTonettiWaugh))
    ; jupyter lab

    where the last step runs your jupyter lab in the shell. The ; cannot be copy-and-pasted; to access shell mode, you must type it manually (and you will see your prompt go red).

    In either case, the first time running the using command will be very slow, as all dependencies need to be precompiled.

  4. In addition to the notebooks mentioned above, there is also the simple_transition_dynamics.ipynb notebook to solve the simple warm-up variation of the model (which does not appear in the paper) as described in the notes.

NOTE: When using the notebooks for the first time, it will be very slow as the package and its dependencies are all compiled.

perlatonettiwaugh.jl's People

Contributors

mwaugh0328 avatar arnavs avatar ctonetti avatar jlperla 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.