Estimating General Equilibrium Trade Policy Eects: GE PPML

Similar documents
Estimating General Equilibrium Trade Policy Eects: GE PPML

Estimating the effect of exchange rate changes on total exports

Empirical trade analysis

Migration Gravity Revisited

Workshop for empirical trade analysis. December 2015 Bangkok, Thailand

CEMMAP Masterclass: Empirical Models of Comparative Advantage and the Gains from Trade 1 Lecture 3: Gravity Models

Measuring the Gains from Trade: They are Large!

Welfare in the Eaton-Kortum Model of International Trade

International Trade and Unemployment: A Quantitative Framework

MIT PhD International Trade Lecture 15: Gravity Models (Theory)

International Trade Lecture 16: Gravity Models (Theory)

SAFTA and AFTA: a comparative welfare analysis of two regional trade agreements

Gravity Models: Theoretical Foundations and related estimation issues

Internation1al Trade

Gravity Models and the Armington Assumption

Addendum to: New Trade Models, Same Old Gains?

Session 4-5: The benchmark of theoretical gravity models

The Poisson Quasi-Maximum Likelihood Estimator: A Solution to the Adding Up Problem in Gravity Models

International Trade 31E00500

Gravity Models, PPML Estimation and the Bias of the Robust Standard Errors

Quantifying the effects of NTMs. Xinyi Li Trade Policies Review Division, WTO Secretariat 12 th ARTNeT Capacity Building Workshop December 2016

New Trade Models, Same Old Gains?

Universal Gravity * Costas Arkolakis Yale and NBER. First Version: August 2014 This Version: April Abstract

NBER WORKING PAPER SERIES AGGREGATION AND THE GRAVITY EQUATION. Stephen J. Redding David E. Weinstein

Economic Integration Agreements, Border Effects, and Distance Elasticities in the Gravity Equation

Daily Welfare Gains from Trade

ARTNeT Interactive Gravity Modeling Tool

Gold Standard Gravity

Heterogeneous Economic Integration Agreement Eects

The gravity models for trade research

International Trade Lecture 3: Ricardian Theory (II)

Session 3-4: Estimating the gravity models

The Border E ect Through the Rearview Mirror: Would the puzzle have existed if today s tools had been used?

Intra-national Trade Costs: Assaying Regional Frictions

NBER WORKING PAPER SERIES NEW TRADE MODELS, SAME OLD GAINS? Costas Arkolakis Arnaud Costinot Andrés Rodríguez-Clare

Motivation Non-linear Rational Expectations The Permanent Income Hypothesis The Log of Gravity Non-linear IV Estimation Summary.

Constrained Poisson Pseudo Maximum Likelihood Estimation of Structural Gravity Models

On the Geography of Global Value Chains

Gravity, Productivity and the Pattern of Production and Trade

Estimating the Effects of Nondiscriminatory. within Structural Gravity Models

Bonus Vetus OLS: A Simple Approach for Addressing the Border Puzzle and other Gravity-Equation Issues*

Eaton Kortum Model (2002)

BORDER EFFECTS AND THE GRAVITY EQUATION: CONSISTENT METHODS FOR ESTIMATION 1

poisson: Some convergence issues

Dynare Class on Heathcote-Perri JME 2002

Comparative Advantage and Biased Gravity

Gravity, Productivity and the Pattern of Production and Trade

Intra-national Trade Costs: Assaying Regional Frictions

New Trade Models, Same Old Optimal Policies?

International Trade. Course Description and Requirements

The Dynamics of the U.S. Trade Balance and the Real Exchange Rate: The J Curve and Trade Costs? by George Alessandria (Rochester) Horag Choi (Monash)

Gravity, Productivity and the Pattern of Production and Trade

Gravity or Dummies? The Limits of Identication in Gravity Estimations

Discussion Papers In Economics And Business

Welfare Evaluation in a Heterogeneous Agents Model: How Representative is the CES Representative Consumer?

Bonus Vetus OLS: A Simple Method for Approximating International Trade-Cost Effects using the Gravity Equation

Multi-way clustering estimation of standard errors in gravity models

Integrating Gravity WPS6347. Policy Research Working Paper The Role of Scale Invariance in Gravity Models of Spatial Interactions and Trade

The Role of the Most Favored Nation Principle of the GATT/WTO in the New Trade Model

Spatial Aspects of Trade Liberalization in Colombia: A General Equilibrium Approach. Eduardo Haddad Jaime Bonet Geoffrey Hewings Fernando Perobelli

Competing-Destinations Gravity Model Applied to Trade in Intermediate Goods

Assignment #5. 1 Keynesian Cross. Econ 302: Intermediate Macroeconomics. December 2, 2009

Essays in Economic Geography and Development. Dominick Gabriel Bartelme. A dissertation submitted in partial satisfaction of the

THE EFFECTS OF ECONOMIC SANCTIONS ON TRADE: NEW EVIDENCE FROM A PANEL PPML GRAVITY APPROACH

The Ramsey Model. (Lecture Note, Advanced Macroeconomics, Thomas Steger, SS 2013)

AI Gravity, Latent Trade, and Zero Flows

International Prices and Exchange Rates Econ 2530b, Gita Gopinath

Policy Measurement and Multilateral Resistance in Gravity Models

Estimating Gravity Equation Models in the Presence of. Sample Selection and Heteroskedasticity

Global Value Chain Participation and Current Account Imbalances

Eco-Labeling and the Gains from Agricultural and Food Trade: A Ricardian Approach

Dynamics of Firms and Trade in General Equilibrium. Robert Dekle, Hyeok Jeong and Nobuhiro Kiyotaki USC, Seoul National University and Princeton

NBER WORKING PAPER SERIES SHORT RUN GRAVITY. James E. Anderson Yoto V. Yotov. Working Paper

Addendum to: International Trade, Technology, and the Skill Premium

Short Run Gravity. November 14, 2018

Online Appendix: Entry into Export Markets

Trade costs in bilateral trade flows: Heterogeneity and zeroes in structural gravity models

14.461: Technological Change, Lecture 4 Technology and the Labor Market

Macroeconomic Theory and Analysis V Suggested Solutions for the First Midterm. max

1.3 Anderson and van Wincoop(2003) 1.4 ë z

1. Constant-elasticity-of-substitution (CES) or Dixit-Stiglitz aggregators. Consider the following function J: J(x) = a(j)x(j) ρ dj

CROSS-COUNTRY DIFFERENCES IN PRODUCTIVITY: THE ROLE OF ALLOCATION AND SELECTION

Modelling Methods for Trade Policy II: Introduction to OLS Regression Analysis

Melitz, M. J. & G. I. P. Ottaviano. Peter Eppinger. July 22, 2011

Trade Costs and Economic Geography: Evidence from the U.S.

The Origins of Firm Heterogeneity: A Production Network Approach

Trade, Inequality and Costly Redistribution

The shaded areas of the map are ESCAP Members and Associate members.

Trade Disruptions from Natural Disasters: Evidence from Monthly Data

Melitz, M. J. & G. I. P. Ottaviano. Peter Eppinger. July 22, 2011

GLM estimation of trade gravity models with fixed effects

Quality Heterogeneity and Misallocation: The Welfare Benefits of Raising your Standards Other VES Preferences

The TransPacific agreement A good thing for VietNam?

G6910 Topics in Economic Geography Fall 2003 David E. Weinstein

Part A: Answer question A1 (required), plus either question A2 or A3.

The Elusive Pro-Competitive Effects of Trade

Importing Skill-Biased Technology

THE GRAVITY MODEL OF INTERREGIONAL TRADE: CASE OF EASTERN SIBERIA

Commuting, Migration and Local Employment Elasticities

Self-Enforcing Trade Agreements and Private Information

Transcription:

Estimating General Equilibrium Trade Policy Eects: GE PPML James E. Anderson Boston College and NBER Mario Larch University of Bayreuth Yoto V. Yotov Drexel University September 1, 2015 Abstract We develop a simple estimation procedure for general equilibrium (GE) counterfactual comparative static analysis of gravity models. Non-linear solvers of shocks to estimated models are replaced by (constrained) regressions readily implemented in packages such as Stata, increasing access to applied economists and to policymakers, and improving intuition about results. The standard Poisson Pseudo-Maximum-Likelihood (PPML) estimator for gravity models is iterated to deliver partial and general equilibrium comparative static responses to changes in trade policies or other changes in trade costs. The method works by fully exploiting the combined properties of structural gravity and PPML. Our procedures can readily be extended to accommodate a wide class of general equilibrium production models at the aggregate level. JEL Classication Codes: F10, F14, F16 Keywords: Structural Gravity, General Equilibrium Eects, Counterfactuals, Estimation We thank seminar participants at the Economic Research and Statistics Division of the WTO and at the ifo Institute for comments and suggestions. Yotov is grateful to the members of the CESifo group for their hospitality during his stay at the ifo Institute in 2015. Contact information: AndersonDepartment of Economics, Boston College, james.anderson@bc.edu; LarchDepartment of Law and Economics, University of Bayreuth, mario.larch@uni-bayreuth.de; Yotov School of Economics, LeBow College of Business, Drexel University, yotov@drexel.edu.

1 Introduction The structural gravity model implies that the predicted bilateral trade ow diers from the benchmark frictionless ow by a power transform of the ratio of bilateral trade cost to the product of inward and outward multilateral resistances. The latter are not directly observable but can be inferred from origin and destination xed eects in a standard gravity regression. The multilateral resistances also are theoretically the solution to a non-linear pair of equation systems derived from global market clearance for each country's sales and meeting each country's budget constraint. Fally (2015) shows that when gravity is estimated with PPML, the estimated xed eects are exactly equal to the multilateral resistances that satisfy the equation system. Building on this result, we derive estimated comparative statics that infer the changes in multilateral resistances when counterfactual changes in trade costs are assumed (Head and Mayer (2014)'s Modular Trade Impact). We extend our method to also estimate the general equilibrium impact when endowments are xed but prices change (Head and Mayer (2014)'s General Equilibrium Trade Impact). Our reliance on estimated xed eects as containers of useful information relies heavily on the structural assumptions of gravity. Given the structure, it makes sense to fully utilize the estimates rather than suppressing them in the usual focus on the gravity coecients. Our method provides a more readily accessible way to generate the general equilibrium comparative statics of gravity models than with nonlinear solvers. 1 Another benet is the combination of statistical with economic theoretic intuition in interpreting results. The estimated xed eects (and their changes) provide traditionally strong t to the data (under the PPML structure) along with satisfying equilibrium market clearance and budget constraints. 2 Structural Gravity with Fixed Eects Anderson (1979) derives the rst structural gravity model of trade under the assumptions of identical Constant Elasticity of Substitution (CES) preferences across countries for national varieties dierentiated by place of origin (Armington, 1969): 2 X ij = ( tij Π i P j ) 1 σ Y i E j, (1) P 1 σ j = i Π 1 σ i = j ( tij Π i ( tij P j ) 1 σ Y i, (2) ) 1 σ E j, (3) p j = Y 1 1 σ j. (4) γ j Π j 1 The structural gravity system can be solved in levels or in changes using the `exact hat algebra' methods of Dekle, Eaton and Kortum (2008). Costinot and Rodríguez-Clare (2014) review the related literature. As we demonstrate below, our simple estimation procedure delivers identical results. 2 Anderson (2011) and Costinot and Rodríguez-Clare (2014) oer discussions of alternative microfoundations for structural gravity. 1

Here, X ij denotes the value of shipments at destination prices from region of origin i to region of destination j. The order of double subscripts denotes origin to destination. E j is the expenditure at destination j from all origins and Y i denotes the sales at destination prices from i to all destinations. t ij 1 denotes the variable trade cost factor on shipments of goods or services from i to j, and σ is the elasticity of substitution across varieties. P j is the inward multilateral resistance (IMR), which aggregates the incidence of trade costs on consumers in each country, and also the CES price index of the demand system. Π i is the outward multilateral resistance (OMR), which from (3) aggregates i's outward trade costs relative to destination price indexes. Multilateral resistance is a general distributional equilibrium concept, since {Π i, P j } solve equations (2)-(3) for given {Y i, E j }. Note also that (2)-(3) solves for {Π i, P j } only up to a scalar. If {Π 0 i, Pj 0 } is a solution then so is {λπ 0 i, Pj 0 /λ}. 3 Equation (4) is derived from the market clearance Y i = j X ij = j (γ ip i t ij /P j ) 1 σ E j = (γ i p i ) 1 σ j (t ij/p j ) 1 σ E j for all j, where p i is the exporter's supply price of country i and γ j is a positive distribution parameter of the CES utility function. Dividing both sides by Y and using Equation (3) leads to Equation (4). Gravity equations are recommended to be estimated with importer and exporter xed eects by Feenstra (2004), a recommendation followed by most of the subsequent literature. In addition, many recent papers follow the recommendation of Santos Silva and Tenreyro (2006) who argue in favor of the PPML estimator for gravity regressions in order to account for heteroskedasticity and to take advantage of the information contained in the zero trade ows. Taking these considerations into account, many recent studies employ a version of the following empirical gravity model: X ij = exp (T ij β + π i + χ j ) + ɛ ij. (5) Here, T ij is the vector of trade cost variables, β is a vector of coecients, ɛ ij is a remainder error term, π i is an exporter xed eect that accounts for the outward multilateral resistances and for outputs, and χ j is an importer xed eect that accounts for expenditures and for the inward multilateral resistances. 4 Due to perfect collinearity, one of the directional xed eects needs to be dropped. In addition, as discussed earlier, a normalization of the set of P 's and Π's is required to solve the structural gravity system in any case. We chose to normalize the inward multilateral resistance for a representative country, P 0 = 1, and to drop the corresponding importer xed eect, χ 0. Fally (2015) demonstrates that the PPML estimates of the xed eects from gravity estimations are perfectly consistent with the structural gravity terms. (See his Proposition 1.) Taking into account the normalization that we just discussed, this implies that the OMRs and IMRs can be recovered from the xed eects as follows: Π 1 σ i = E 0 Y i exp ( π i ), (6) and P 1 σ j = E j E 0 exp ( χ j ), (7) 3 See Anderson and van Wincoop (2003) and Anderson and Yotov (2010) for detailed discussions of the multilateral resistances. 4 If the procedure is performed with panel data, then the directional xed eects should also be timevarying. 2

where π i and χ j are the estimated xed eects from Equation (5), and Y i, E j and E 0 are data. We capitalize on this property of PPML in the next section where we also exploit the full structure of system (1)-(4) in order to develop our general equilibrium estimation method. 3 GE PPML: Estimating the GE Eects of Trade Policy This section describes our simple 3-step estimation procedure to obtain estimates of the general equilibrium eects of trade policy with the PPML estimator. Step 1: `Baseline' Scenario. This step delivers the `Baseline' estimates and `Baseline' GE indexes and consists of two sub-steps: Step 1.a: Estimate `Baseline' Gravity. Use the PPML estimator to estimate gravity with exporter and importer xed eects: X ij = exp (T ij β + π i + χ j ) + ɛ ij. (8) We chose PPML as our preferred estimator in this step for consistency with the rest of our procedure and due to its appealing properties for gravity estimations (see Santos Silva and Tenreyro, 2006, 2011). However, we note that any estimator can be employed to obtain the estimates of the trade cost elasticities β in a preliminary step. 5 In fact, the β's can even be borrowed from other studies as is routinely done in the literature. In case the estimates of the trade cost elasticities are obtained externally or with another estimator than PPML, Step 1.a should be repeated with the external elasticity parameters or the obtained parameters from the estimator of your choice imposed as constraints in the PPML estimation (8). 6 The reason is that PPML is the only estimator where the sum of tted values of GDPs and expenditures is equal to the sum of observed values of GDPs and expenditures (see Proposition 2 of Fally, 2015), a property needed in order to guaranty that the xed eects from gravity estimations are perfectly consistent with the structural gravity terms. In Steps 2 and 3 below, we capitalize on this PPML property and we extend Fally's analysis to estimate general equilibrium eects of changes in trade costs with the structural gravity model. Step 1.b: Construct `Baseline' GE Indexes. Use the estimates of the xed eects from (8) together with data on outputs and expenditures to construct the multilateral resistances according to (6)-(7), where, by construction, Y i = j X ij 5 We refer the reader to Head and Mayer (2014) for informative discussions of the relative merits and caveats of PPML versus other nonlinear estimators in the gravity context. 6 We also note that Step 1.a can be used to generate a whole distribution of bootstrapped trade cost elasticity parameters that can be fed into the next steps in order to generate condence intervals for the GE indexes of interest, as is for example done by Anderson and Yotov (2011). Furthermore, in principle, our approach can be used to deliver standard errors for the indexes of interest directly from the estimates of the gravity xed eects. However, as only recently the consistency of the model parameter estimates in nonlinear panel models with two types of xed eects has been shown by Fernández-Valz and Weidner (2015), we leave this for future research. 3

and E j = i X ij. Construct any other baseline GE indexes of interest (e.g. predicted exports, j i X ij, i). Step 2: `Conditional' Scenario. This step delivers the `Conditional' gravity estimates and `Conditional' GE indexes, which allow for changes in the IMRs and OMRs, but do not take output and expenditure changes into account. Again, this step consists of two sub-steps: Step 2.a: Estimate `Conditional' Gravity. Re-dene the policy variable(s) of interest to reect any desired trade policy changes and use PPML to estimate: ( X ij = exp T β ) ij + π i + χ j + ɛ ij. (9) Here T ij is the vector of counterfactual trade policy covariates. For example, an indicator for Regional Trade Agreements (RTAs) can be amended to eliminate an existing agreement or to introduce a new one; 7 the hat on β indicates the fact that the trade cost coecients are constrained to the estimated values from the baseline specication (8); and the symbol denotes counterfactual variables. Notice that the data remains the same in this counterfactual exercise: X ij remains the same and thus so do Y i and E j. The experiment infers the xed eects (multilateral resistances) that are consistent with the original data with the counterfactual trade costs T ij. Step 2.b: Construct `Conditional' GE Indexes. Repeat Step 1.b with the new xed eects estimates from (9) and the original data on outputs and expenditures to construct the `Conditional' GE (the Modular Trade Impact of Head and Mayer, 2014) estimates of the multilateral resistances and construct any other GE indexes of interest. The dierences, in percentage, between the baseline indexes from Step 1.b and the counterfactual indexes from this step measure the `Conditional' GE eects of the simulated trade policy. Specically, the percentage change in welfare in the `Conditional' GE scenario can be calculated by the change in real GDP, i.e., 8 Ŵi = Y i / ˆP i = ˆP i, i, (10) Y i / ˆP i where moving from the middle to the rightmost equality recognizes that output is kept exogenous in the `Conditional' scenario, i.e. Y i = Y i. 9 Step 3: `Full Endowment' Scenario. This step delivers the `Full Endowment' gravity estimates and `Full Endowment' GE indexes, which in addition to changes in 7 Our methods will also hold if we adjust estimates in the vector of the trade cost elasticities, β. 8 Note that due to our normalization of P 0 = 1, welfare changes in the `Conditional' scenario are relative to reference country 0. 9 We also note that the PPML data generating process delivers power transforms of the inward multilateral resistances, according to Equation (7). Therefore, to construct real GDP, we use a standard value for the elasticity of substitution σ = 7. In principle, σ can also be estimated directly from an empirical gravity model that includes as a covariate any direct price shifter, e.g. tari. This is beyond the scope of our paper. ˆP i 4

the IMRs and OMRs capture changes in output and expenditure. Also Step 3 consists of two sub-steps: Step 3.a: Estimate `Full Endowment' Gravity. Allow for endogenous response in the value of outputs/incomes and expenditures, which are given by Y i = (p i/p i ) Y i and E i = (p i/p i ) E i in an endowment economy where trade imbalance ratios φ i = E i /Y i are assumed to stay constant in the counterfactual for each country i (allowing for balanced trade as a special case). The endogenous changes in output/income and expenditure will trigger additional changes in the multilateral resistance (MR) terms and so forth. As the PPML estimator with the appropriate xed eects ensures that the sum of tted values of GDPs and expenditures is equal to the sum of observed values of GDPs and expenditures, changes in output/income and expenditure cannot be directly estimated in one step with PPML. Therefore, we use the structural gravity Equation (1) to translate the changes in output and expenditure, triggered by the changes in factory-gate prices, into changes in trade ows: X ij = ( ) t 1 σ ij Y i E j t 1 σ ij Y i E j and t 1 σ ij = exp (T ij β). The new values for out- where ( ) ( t 1 σ ij = exp T β ) ij puts, expenditures and world output, Y Π 1 σ i P 1 σ j ( Π 1 σ i ) ( P 1 σ j ) X ij, (11) ) 1 1 σ 1 γ i Π i i, E j, are obtained by using the market clearing conditions p i = ( Y i to translate the `Conditional' GE eects Y on the MR terms into `rst-order' changes in factory-gate prices, i.e. p i/p i = [ ) exp ( π i / exp ( πi ) ] 1 1 σ. 10 As imposed in Step 1, the vector of prices {p i} is normalized by P 0 = ( ) 1 σ i γi p i t i0 = 1. Repeat Step 2.a with the new values for trade. The idea is that, using the new values of trade, the PPML estimator will translate the initial response of factorygate prices into changes in the gravity xed eects, which (in combination with the new values for income Y i = j X ij and expenditures E j = i X ij) can be used to obtain additional `second-order' responses in the MR terms. Repeat Step 3.a to obtain a new set of factory-gate prices and new values of trade, income and expenditures. Iterate until convergence, e.g. until the change in each of the factory-gate prices is zero. Step 3.b: Construct `Full Endowment' GE Indexes. Construct `Full Endowment' GE indexes of interest following the procedures from Step 1.b. The dierences, in percentage, between the baseline indexes from Step 1.b and the 10 Note that specication (11) reminds of the `exact hat algebra' procedures from Dekle, Eaton and Kortum (2008). Note also, however, that the changes in trade implied by Equation (11) are not the `Full Endowment' GE changes. The reason is that they only reect the `Conditional' OMR changes and do not allow for immediate changes in the value of outputs. This is why we label these initial changes in the factory-gate prices and in trade `rst-order'. Thus, in eect, the methods that we represent here are an interactive estimation equivalent to the `exact hat' procedures from Dekle, Eaton and Kortum (2008). 5

counterfactual indexes from this step measure the `Full Endowment' GE eects of the simulated trade policy. The percentage change in welfare in the `Full Endowment' GE scenario can again be calculated by the change in real GDP, i.e., 11 Ŵ i = Y i / ˆP i Y i / ˆP, i. (12) i These three steps can be performed with any statistic/econometrics software that is able to estimate a Poisson model and is capable of handling loops. Specically, no non-linear equation solver is necessary. Hence, it can be easily applied by anyone working empirically. We demonstrate the implementation of Steps 1 through 3 in Stata (StataCorp LP, 2013) in the Appendix. 4 Trade Without Borders: An Application of GE PPML This section demonstrates the empirical equivalence between the results from the estimating procedure that we propose here (and implement in Stata, StataCorp LP, 2013) and those from a standard, but computationally intensive, procedure (implemented in Matlab, Mathworks, 2013) that requires setting and solving the structural gravity system explicitly. 12 In order to perform our analysis, we focus on a hypothetical scenario that removes all international borders to trade in manufactures for 40 countries and a rest-of-world aggregate over the period 1990-2002. 13 While our goal in this section is to demonstrate the success of the estimation methods that we propose, we note that our experiment of removing international borders can be interpreted as a quantication of the eects of an eective multilateral trade facilitation exercise, thus, complementing the widely used counterfactual analysis of reversal to autarky, cf. Costinot and Rodríguez-Clare (2014). We specify a simple empirical gravity specication: 14 X ij = exp (β 1 ln DIST ij + β 2 CNT G ij + β 2 BRDR ij + π i + χ j ) + ɛ ij, (13) where all bilateral trade costs are approximated by the logarithm of bilateral distance, ln DIST ij, an indicator variable that takes a value of one when trading partners i and j 11 Note that with balanced trade or constant shares of trade imbalances, the change in output and expenditure are identical for each country. Hence, real GDP changes correspond to changes in real expenditures. Further, Arkolakis, Costinot and Rodríguez-Clare (2012) demonstrate that the welfare/real consumption gains from trade liberalization obtained from a wide class of trade models with alternative microfoundations can all be expressed as a combination of two sucient statistics including intra-national trade as share of total expenditures X ii /E i and the trade elasticity of substitution 1 σ. This holds for our framework. 12 The Stata and Matlab codes are available upon request. 13 The data set that we employ here is a subsample of the data from Anderson and Yotov (2011), which covers total manufacturing trade, including intra-national trade for 40 countries and a rest of the world aggregate over the period 1990-2002. Given the methodological purposes of this study, we focus on the year 2002 and we refer the reader to Anderson and Yotov (2011) for further details on the dataset. 14 In analysis that is available by request we experiment with various alternative scenarios and specications (e.g. decreasing distance, removing and introducing FTAs, contiguous borders, changing the values for the trade cost elasticities, etc.). All these experiments conrm the robustness of our methods. 6

share a common border, CNT G ij, and an indicator variable, BRDR ij, which takes a value of one for international trade and it is equal to zero otherwise. Specication (13) is consistent with structural gravity due to the presence of the exporter and importer xed eects, which account for the multilateral resistances as well as for outputs and expenditures. Step 1.a delivers estimates of the eects of distance, contiguity and international borders: X ij = exp(-0.948 (0.052) ln DIST ij + 0.478 (0.102) CNT G ij 1.554BRDR ij + π i + χ j ) + ɛ ij. (14) (0.122) The estimates of the standard gravity variables are in accordance with prior expectations. A negative and highly statistically signicant estimate of the eect of distance β 1 = 0.948 (std.err. 0.052) does not dier signicantly from the conventional estimate of 1. There is a positive and highly signicant eect of contiguity β 2 = 0.478 (std.err. 0.102). 15 In addition, our estimates suggest that, all else equal, international borders decrease trade by an average of 79 percent (std.err. 2.575). 16 The estimates from Equation (14) can be used to construct all baseline indexes of interest, as specied in Step 1.b of our procedure. Their values are suppressed for expositional ease. Next, we follow Step 2.a to obtain `Conditional' GE estimates that correspond to the removal of international borders: X ij = exp ( 0.948 ln DIST ij + 0.478CNT G ij + π i + χ j) + ɛ ij, (15) Here, we have constrained the estimates on the trade cost covariates to their baseline values and we have removed the border covariate completely, which is equivalent to keeping it with all values of the border dummy set to zero. We use the estimates of the xed eects and of the coecients on the trade cost variables to construct multilateral resistances, total exports, and real consumption for each of the countries in our sample as described in Step 2.b. In addition, we obtain the same indexes by solving the non-linear gravity system in Matlab. Figure 1 shows that the percentage changes of the `Conditional' GE equilibrium for the IMRs, OMRs, total exports and real GDP from the estimation in Stata and from the solution of the non-linear gravity system (in Matlab) are identical. As depicted in the bottom right panel of Figure 1, the `Conditional' general equilibrium estimates suggest that abolishing international borders leads to welfare changes between about -7 and 14 percent relative to our reference country Germany, where real GDP changes in the `Conditional' GE equilibrium are zero by construction. Note that the exact magnitudes depend on the size of the trade elasticity, which we set to 1 σ = 1 7 = 6. Finally, we follow Step 3 to obtain estimates and GE indexes of the `Full Endowment' GE eects of the removal of international borders. Once again, we compare our Stata estimates with those obtained in Matlab. Figure 2 conrms the equivalence between the two methods concerning the the percentage changes of the variables in the `Full Endowment' GE scenario. The results imply that abolishing international borders leads to welfare gains between about 5 and 40 percent, captured in the bottom right panel of Figure 2. 15 Both estimates are readily comparable with existing indexes from the literature. See Head and Mayer (2014). This establishes ( the] representativeness ) of our sample 16 Calculated as exp [ β3 1 100 with standard errors obtained with the Delta method. 7

5 Beyond the Endowment Environment Thus far, we demonstrated how to estimate GE eects in an endowment setting, where the value of income/production is endogenous put only due to changes in factory-gate prices. In this section, we demonstrate that our procedures are more powerful and that they can accommodate any general equilibrium superstructure as long as this structure can be characterized analytically. To do this, we capitalize on the fact that the Armington gravity model can be integrated within a wider class of GE models with endogenous production: Y i = p i Q i (p i, P i ). (16) Here, Q i (.) is the production function, which no longer describes an endowment economy, but rather allows for endogenous response of the quantity produced with respect to changes in trade costs that are channeled via the factory-gate prices and/or the inward multilateral resistances. One possible channel to endogenize production is via asset accumulation. For example, Anderson, Larch and Yotov (2015) combine the Armington-CES gravity model with a dynamic model of capital accumulation. Another possible channel is through labor-leisure choice. These two possibilities retain the one-good national economy. As long as the functional form for Q i (.) delivers an analytical solution for the relationship between production and consumer and producer prices, our estimating procedure from Section 3 can be extended with two simple steps to accommodate any GE superstructure: Step 4: `Endogenous Production' Scenario. This step delivers the `Endogenous Production' gravity estimates and `Endogenous Production' GE indexes, which allow besides changes in IMRs and OMRs and factory-gate prices for quantity adjustments of outputs and expenditures. Also Step 4 consists of two sub-steps: Step 4.a: Estimate `Endogenous Production' Gravity. Translate the `Full Endowment' GE eects of trade policy on the factory-gate prices and on the IMR terms to initial changes in production: 17 Q i (p F i E, Pi F E ), (17) where: the superscript `F E' stands for `Full Endowment'. Translate the changes in production into changes in trade ows: i ) X ij = Q i(p i, P Q i (p F E i, P F E i ) XF E ij, (18) where Xij F E is trade at the `Full Endowment' equilibrium, where the quantity of production and expenditures are still exogenous. 17 Note that we recommend the `Full Endowment' consumer and producer prices as starting values for this step. This is convenient for tractability and in order to decompose the eects of trade policy similar to the decomposition between `Conditional' GE and `Full Endowment' GE eects from Section 3. Alternatively, Step 4 can be combined with Step 3 for simultaneous response of income with respect to changes in factorygate prices and changes in the quantity produced. 8

Repeat Step 2.a with the new values for trade. Repeat Step 3.a to obtain a new set of factory-gate prices and IMRs. Repeat Step 4.a to obtain new trade (and income) values. Iterate until convergence, i.e. until the change in each of the factory-gate prices and the IMRs is zero. Step 4.b: Construct `Endogenous Production' GE Indexes. Construct `Endogenous Production' GE indexes of interest following the procedures from Step 1.a. The dierences, in percentage, between the baseline indexes from Step 1.a and the counterfactual indexes from this step measure the `Endogenous Production' GE eects of the simulated trade policy. Comparison between the `Full Endowment' GE indexes from Step 3.b and the `Endogenous Production' GE indexes from this step will measure the net eects of endogenizing production. References Anderson, James E. 1979. A Theoretical Foundation for the Gravity Equation. American Economic Review, 69(1): 106116. Anderson, James E. 2011. The Gravity Model. Annual Review of Economics, 3: 133160. Anderson, James E., and Eric van Wincoop. 2003. Gravity with Gravitas: A Solution to the Border Puzzle. American Economic Review, 93(1): 170192. Anderson, James E., Mario Larch, and Yoto V. Yotov. 2015. Growth and Trade with Frictions: A Structural Estimation Framework. NBER Working Paper No. 21377. Anderson, J.E., and Yoto V. Yotov. 2010. The Changing Incidence of Geography. American Economic Review, 100(5): 21572186. Anderson, J.E., and Yoto V. Yotov. 2011. Terms of Trade and Global Eciency Eects of Free Trade Agreements, 1990-2002. NBER Working Paper No. 17003. Arkolakis, Costas, Arnaud Costinot, and Andrés Rodríguez-Clare. 2012. New Trade Models, Same Old Gains? American Economic Review, 102(1): 94130. Armington, P.S. 1969. A Theory of Demand for Products Distinguished by Place of Production. IMF Sta Papers, 16: 159176. Costinot, Arnaud, and Andrés Rodríguez-Clare. 2014. Trade Theory with Numbers: Quantifying the Consequences of Globalization. Chapter 4 in the Handbook of International Economics Vol. 4, eds. Gita Gopinath, Elhanan Helpman, and Kenneth S. Rogo, Elsevier Ltd., Oxford. Dekle, Robert, Jonathan Eaton, and Samuel Kortum. 2008. Global Rebalancing with Gravity: Measuring the Burden of Adjustment. IMF Sta Papers, 55(3): 511540. 9

Fally, Thibault. 2015. Structural Gravity and Fixed Eects. Journal of International Economics, forthcoming, doi:10.1016/j.jinteco.2015.05.005. Feenstra, R.C. 2004. Advanced International Trade: Theory and Evidence. Princeton, New Jersey:Princeton University Press. Fernández-Valz, Iván, and Martin Weidner. 2015. Individual and Time Eects in Nonlinear Panel Models with Large N, T. unpublished manuscript available for download at http://arxiv.org/pdf/1311.7065v3.pdf. Head, Keith, and Thierry Mayer. 2014. Gravity Equations: Workhorse, Toolkit, and Cookbook. Chapter 3 in the Handbook of International Economics Vol. 4, eds. Gita Gopinath, Elhanan Helpman, and Kenneth S. Rogo, Elsevier Ltd., Oxford. Mathworks. 2013. Matlab: Release 2013b. 3 Apple Hill Drive, Natick, MA 01760-2098, United States, http://www.mathworks.com/. Santos Silva, João M.C., and Silvana Tenreyro. 2006. The Log of Gravity. Review of Economics and Statistics, 88(4): 641658. Santos Silva, João M.C., and Silvana Tenreyro. 2011. Further Simulation Evidence on the Performance of the Poisson Pseudo-Maximum Likelihood Estimator. Economics Letters, 112(2): 220222. StataCorp LP. 2013. Stata Statistical Software: Release 13.1. College Station, Texas 77845 USA, http://www.stata.com/. 10

Cnd'tl IMRs Stata -50 0 50 100 Cnd'tl IMRs -50 0 50 100 150 Cnd'tl IMRs Matlab Cnd'tl OMRs Stata 0 100 200 300 Cnd'tl OMRs 50 100 150 200 250 300 Cnd'tl OMRs Matlab Cnd'tl Exports Stata 0 50 100 150 Cnd'tl Exports 0 50 100 150 Cnd'tl Exports Matlab Cnd'tl Real GDP Stata -5 0 5 10 15 Cnd'tl Real GDP -5 0 5 10 15 Cnd'tl Real GDP Matlab Note: These gures compare the results from Matlab and Stata for (clockwise, starting from the upper left) the changes (in percent) of the IMR, the changes (in percent) of the OMR, welfare eects in percent (calculated as changes in real GDP), and the changes (in percent) of total exports of each country for the `Conditional' GE eects when abandoning international borders. Figure 1: `Conditional' GE Indexes: Matlab versus Stata Full GE IMRs Stata -50 0 50 100 Full GE IMRs -50 0 50 100 150 Full GE IMRs Matlab Full GE OMRs Stata 0 200 400 Full GE OMRs 0 100 200 300 400 Full GE OMRs Matlab Full GE Exports Stata 50 100150200 Full GE Exports 0 50 100 150 200 Full GE Exports Matlab Full GE Real GDP Stata 0 10 20 30 40 Full GE Real GDP 0 10 20 30 40 Full GE Real GDP Matlab Note: These gures compare the results from Matlab and Stata for (clockwise, starting from the upper left) the changes (in percent) of the IMR, the changes (in percent) of the OMR, welfare eects in percent (calculated as changes in real GDP), and the changes (in percent) of total exports of each country for the `Full Endowment' GE eects when abandoning international borders. Figure 2: `Full Endowment' GE Indexes: Matlab versus Stata 11

Appendix: Implementation in Stata This Appendix provides the Sata code that corresponds to the three main steps from our procedure. The actual Stata `data' and `do' les used to obtain the GE indexes from the main text are available by request. Stata Commands *Comment/Description **************************************** * Step 1.a: Estimate `Baseline' Gravity* **************************************** glm X_ij LN_DIST CNTG BRDR exp_fe_* imp_fe_*, family(poisson) noconst *Obtain trade cost elasticities using Eq. (8). predict trade_ij_0, mu *Save predicted trade. scalar DIST_est=_b[LN_DIST] *Save estimates of trade cost elasticities. scalar CNTG_est=_b[CNTG] scalar BRDR_est=_b[BRDR] ******************************************** * Step 1.b: Construct `Baseline' GE Indexes* ******************************************** scalar N=sqrt(_N) *Save number of countries. forvalues i=1(1)`=n'{ *Combine estimates of fixed effects. qui replace exp_fe_`i'=exp_fe_`i'*exp(_b[exp_fe_`i']) qui replace imp_fe_`i'=imp_fe_`i'*exp(_b[imp_fe_`i']) } egen all_exp_fes_0=rowtotal(exp_fe_1-exp_fe_`=n') egen all_imp_fes_0=rowtotal(imp_fe_1-imp_fe_`=n') gen omr_bsln=y_i*e_deu/(all_exp_fes_0*y) *Construct OMRs from Eq. (6). gen imr_bsln=e_j/(all_imp_fes_0*e_deu) *Construct IMRs from Eq. (7). gen real_gdp_bsln=y_i/(imr_bsln^(1/(1-sigma))) *Construct Real GDP. ******************************************* * Step 2.a: Estimate `Conditional' Gravity* ******************************************* drop exp_fe_* imp_fe_* *Drop estimated FEs as they will be updated. qui tab exporter, gen(exp_fe_) *Create new FEs. qui tab importer, gen(imp_fe_) constraint 1 LN_DIST=DIST_est *Impose Constraints. constraint 2 CNTG=CNTG_est glm X_ij LN_DIST CNTG exp_fe_* imp_fe_*, family(poisson) noconst constraints(1 2) *Obtain `Conditional' FEs from Eq. (9). predict trade_ij_1, mu *Save predicted trade for Step 3. **************************************************************************************************************************************** * Step 2.b: Repeat Step 1.b with the new fixed effects and original trade data to obtain the `Conditional' GE indexes of interest. * **************************************************************************************************************************************** ********************************************** * Step 3.a: Estimate `Full Endowment' Gravity* ********************************************** scalar sigma=7 *Define sigma. local i=3 *Define loop and stopping criteria values. local diff_all_exp_fes_sd=1 local diff_all_exp_fes_max=1 while (`diff_all_exp_fes_sd'>0.01) (`diff_all_exp_fes_max'>0.01) { gen trade_`=`i'-1'=trade_`=`i'-2'_pred* /// *Update trade according to Eq. (11). p_full_exp_`=`i'-2'*p_full_imp_`=`i'-2'/(omr_full_ch_`=`i'-2'*imr_full_ch_`=`i'-2') drop exp_fe_* imp_fe_* *Drop estimated FEs as they will be updated. qui tab exporter, gen(exp_fe_) qui tab importer, gen(imp_fe_) glm trade`=`i'-1' LN_DIST CNTG exp_fe_* imp_fe_*, family(poisson) noconst constraints(1 2) *Estimate Eq. (9) with new trade values. predict trade_`=`i'-1'_pred, mu forvalues j=1(1)`=n'{ *Combine updated estimates of fixed effects. qui replace exp_fe_`j'=exp_fe_`j'*exp(_b[exp_fe_`j']) } egen double all_exp_fes_`=`i'-1'=rowtotal(exp_fe_1-exp_fe_`=n') egen double all_imp_fes_`=`i'-1'=rowtotal(imp_fe_1-imp_fe_`=n') bysort exporter: egen double output_`=`i'-1'=total(trade_`=`i'-1'_pred) *From here on: Updating gravity variables bysort importer: egen double expndr_check_`=`i'-1'=total(trade_`=`i'-1'_pred) for Eq. (11). gen double expndr_deu0_`=`i'-1'=expndr_check_`=`i'-1' if importer=="zzz" egen double expndr_deu_`=`i'-1'=mean(expndr_deu0_`=`i'-1') gen double temp=all_exp_fes_`=`i'-1' if exporter==importer bysort importer: egen double all_exp_fes_`=`i'-1'_imp=mean(temp) drop temp* gen double p_full_exp_`=`i'-1'=((all_exp_fes_`=`i'-1'/all_exp_fes_`=`i'-2')/(expndr_deu_`=`i'-1'/expndr_deu_`=`i'-2'))^(1/(1-sigma)) gen double p_full_imp_`=`i'-1'=((all_exp_fes_`=`i'-1'_imp/all_exp_fes_`=`i'-2'_imp)/(expndr_deu_`=`i'-1'/expndr_deu_`=`i'-2'))^(1/(1-sigma)) gen double expndr_temp_`=`i'-1'=phi*output_`=`i'-1' if exporter==importer bysort importer: egen double expndr_`=`i'-1'=mean(expndr_temp_`=`i'-1') gen double imr_full_`=`i'-1'=expndr_`=`i'-1'/(all_imp_fes_`=`i'-1'*expndr_deu_`=`i'-1') gen double imr_full_ch_`=`i'-1'=imr_full_`=`i'-1'/imr_full_`=`i'-2' gen double omr_full_`=`i'-1'=output_`=`i'-1'/all_exp_fes_`=`i'-1' gen double omr_full_ch_`=`i'-1'=omr_full_`=`i'-1'/omr_full_`=`i'-2' gen double diff_p_full_exp_`=`i'-1'=p_full_exp_`=`i'-2'-p_full_exp_`=`i'-3' sum diff_p_full_exp_`=`i'-1' local diff_all_exp_fes_sd=r(sd) local diff_all_exp_fes_max=abs(r(max)) local i=`i'+1 } **************************************************************************************************************************************** * Step 3.b: Repeat Step 1.b with the new fixed effects and the new trade values to obtain the `Full Endowment' GE indexes of interest. * **************************************************************************************************************************************** 12