GithubHelp home page GithubHelp logo

fagan2888 / gravity-estimation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mwaugh0328/gravity-estimation

0.0 0.0 0.0 36 KB

Estimates parameters of EK(2002) or Waugh(2010) via STATA and computes bilateral trade flows via simmulation

Stata 25.00% MATLAB 75.00%

gravity-estimation's Introduction

Gravity-Estimation

Estimates gravity parameters as in...

[1] Eaton, Jonathan, and Samuel Kortum. "Technology, geography, and trade."
Econometrica 70.5 (2002): 1741-1779.

[2] Waugh, Michael. "International trade and income differences."
The American Economic Review 100.5 (2010): 2093-2124.

via STATA and computes bilateral trade flows.

Often I get asked how to perform the regressions in Waugh(2010) and inturn EK(2002). My initial code to perform the ``gravity'' regressions (as posted on the AER replication site) is very convoluted, hard to understand. The goal here is to simplify things and make it easy.

This code does several things...

(1) The main driver file is stata_to_tau_to_trade.m It calls a STATA .do file gravity_run.do. The innovation here is that this STATA file shows how to perform this estimation in STATA which is very easy to implement and understand.

(2) This code then ports in the estimates from STATA into MATLAB. Within MATLAB, there are two options on how to construct trade costs depending upon your view of the them (i.e. the asymmetric component is on the import side as in EK(2002) or the asymmetric componenet is on the export side as in Waugh (2010)).

(3) Given the trade costs and technology parameters (specifically the S's in EK's notation), I then compute trade flows and compare them to data. I do this via simmulation by calling the file sim_trade_pattern_ek.m. One could also use the formulas from EK or Waugh to construct these as well.

Note, now the respository Create Trade Share Matrix generates a gravity data set that is useable with this set of code.

gravity-estimation's People

Contributors

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