Advanced International Economics
2025-02-25
We learn on the theoretical model of gravity equation: from theory to empirics.
some development of problems and how to tackle ’em
Preparation on practicing with gravity model.
main text is Yotov et al. (2016) chapter I
Gravity model is very intuitive.
It has a strong theoretical foundation.
Structure is pretty flexible. Can be applied to labor market, investment, environment, etc.
Remarkable predictive power (with some caveats).
fit for your empirical thesis.
Now let Qi be the supply of a good from country i which is fixed with factory gate i.
The value of a domestic production in a country i thus
Yi=piQi
Yi is also the nominal income of the country i.
Meanwhile, let Ei=ϕiYi be the total expenditure of the country i. 0<ϕi<1 would represent a fraction of Yi that is spent to be consumed. Therefore, a (1−ϕi)Yi is a net export.
Consequently, ϕ>1 would suggest a net-import economy (i.e., trade deficit).
We can add a time index t if needed. Maybe later.
Suppose consumers in a country j have a representative CES-utility function
{∑iα1−σσicσ−1σij}σσ−1
Where σ>1 is the elasticity of substitution among varieties of goods from country i. αi>0 is a CES preference parameter for good from country i.
Consumer maximize its utility with a budget constraint
∑ipijcij=Ej
Where Ej is a total expenditure of a country j.
Meanwhile, pij=pitij reflects a price in country i times its trade cost tij≥1.
Think of the trade cost as an “iceberg” cost: to deliver 1 unit of its variety to country j, country i must ship tij≥1 units, i.e. 1/tij of the initial shipment melts “en route”.
Optimization on cij would result in
Xij=(αipitijPj)1−σEj
where Xij is the export from origin i to destination j. Pj can be interpreted as a CES consumer price index:
Pj=(∑j(αipitij)1−σ)11−σ
expenditure in country j on goods from source i, Xij, is:
Proportional to Ej. i.e., countries with large expenditure buys more from many countries.
inversely related to the (delivered) prices of varieties from origin i to destination j. Its not just pi but also tij.
Directly related to price index Pj, which is a substitution effect.
A high σ will magnify the substition effect.
We then clears the market with:
Yi=∑j(αipitijPj)1−σEj WHich means all trade conducted by a country i (including with itself) must be equal to its total production. (i.e., Yi≡∑jXij∀i)
If we define Y=∑iYi which is the global market, divide both equations with it, then:
(αipi)1−σ=YiY∑j(tijPj)1−σEjY
We substitute a Π1−σj≡∑j(tij/Pj)1−σEj/Y, then we get
(αipi)1−σ=Yi/YΠ1−σi
We now plug this into our Xij to get:
Xij=YiEjY(tijΠiPj)1−σΠ1−σi=∑j(tijPj)1−σEjYPij=∑i(tijΠi)1−σYiY
We can decompose Xij into two term: the size term (YiEj/Y) and the trade cost term ((tij/(ΠiPj))1−σ)
The size term can be interpreted as a hypothetical trade flow if there is no trade cost (ie frictionless trade).
That is, customers face same factory-gate price no matter where they are.
The size effect provides us with the intuition that:
large producers will export more to all destinations
big/rich markets will import more from all sources
trade flows between simiarly-sized countries will be larger.
Bilateral trade cost between partners i and j, tij , is typically approximated in the literature by various geographic and trade policy variables, such as bilateral distance, tariffs and the presence of regional trade agreements (RTAs) between partners i and j.
The structural term Pj , coined by Anderson and van Wincoop (2003) as inward multilateral resistance represents importer j’s ease of market access.
The structural term Πi , defined as outward multilateral resistances by Anderson and van Wincoop (2003), measures exporter i’s ease of market access.
We log-linearized Xij to get the following:
lnXij,t=lnEj,t+lnYi,t−lnYt+(1−σ)lntij,t−(1−σ)lnPj,t−(1−σ)lnΠi,t+εij,t
This equation is so popular. Despite that, most students often conduct a consequential mistakes that can be easily remedied with Stata (or R) command. We learn it today so your thesis is safe.
Fij=GMiMjD2ij
where F=force, G=constant, M=mass, D=distance
Xij=˜GYiEjTθij
where ˜G≡1/Y inverse of the world production, Yi is the exporter’s production capacity, EJ is the importer’s expenditure.
Tij is the total trade cost (tij/(ΠiPj))σ−1
obviously the main challenge comes from dissecting the multilateral resistance Pj,t and Πi,t which are inherently observable.
Anderson and Wincoop (2003) conducted a nonlinear OLS by estimating a predicted trade without MR, then construct MR to account for difference with the real world trade.
These days, Olivero and Yotov (2016) shows that we can use exporter-time and importer-time fixed effect to account for the MR.
Note that these FE will absorb many all unobservables that varies by country-time, including GDP, distance, XR and policies.
The nice thing about linearizing the gravity equation is that we can use OLS.
Unfortunately, this will lead us to forefully drop zero trade.
Typical easy solution is to assign an arbitrary number to the zero trade flow (typically log 1), but this leads to a inconsistent estimate.
The best solution for now is the PPML approach.
Trade data is heteroscedastic: variance of larger countries are structurally differ than that of the smaller countries.
An OLS would bias the estimated trade policy and MR. It also inconsistent with the theory.
You can remedy this by weighting the trade data, but the better way is to do PPML.
This is crucial to properly model a partial and general equilibrium effect of trade.
The standard practice to proxy the bilateral trade cost tij is to use the following:
(1−σ)lntij=β1lnDij+β2lnCNTGij+β3lnLANGij+β4lnCLNYij+β5RTAij,t+β6˜τij,t
RTA is a dummy noting whether both countries are a member of a trade agreement.
˜τ is a bilateral tariff ln(1+tariffij,t)
Since tariff is a price shifter, which can be expressed as a terms of the trade elasticity of substitution. (i.e., β6=−σ)
This is the part where we can also add more trade policy that represents trade costs. However, the next problem is prolly the most important for trade policy enthusiasts.
Trade policies (like any policies really) are typically non-random/endogeneous.
Potential reverse causality problem:
a country would propose a trade agreements with its closest neighbor and its largest trading partner first.
Industry with large trade deficit would lobby for protectionist policies.
It is hard to propose an instrumental variable since we can hardly find good instruments for trade policies.
An approach like first difference (or GMM in general) can also be used, but we still have the problem of zero trade.
The most practical way is to have a country-pair fixed effects to count for unobserved variables that affect trade policies.
This is a policy that does not discriminate trade partners (e.g., unilateral MFN tariffs or subsidies).
Meaning, it will be absorbed by exporter-time or importer-time fixed effects.
If your variable of interest is a non-discriminatory trade policies by other countries, then an approach like building “remoteness index” to absorb MR instead of country-time FE can be the solution.
See Anderson and Yotov (2016) & Head and Mayer (2014)
Sometimes trade patterns take time to adjust to a policy change.
Therefore, it’s not ideal to use annual data since we would assume the change in trade policy happens in the same year (or even month)
Trefler (2004) uses 3-year inter vals, Anderson and Yotov (2016) use 4-year intervals, and Baier and Bergstrand (2007) use 5-year intervals.
Olivero and Yotov (2012) provide empirical evidence that gravity estimates obtained with 3-year and 5-year interval trade data are very similar.
Students (and myself) often estimate gravity at sectoral level because we care about specific sectoral policies.
Gravity estimation is separable: if we separate a sector from the general economy, it retains a gravity-like structure. i.e.:
Xkij,t=Yki,tEkj,tYkt(tkij,tPkj,tΠki,t)1−σk
the nice feature of the this is that bilateral trade cost (which includes policy) is sector specific.
It can also be estimated across sectors with importer-product-time FE and exporter-product-time FE.
We can have a specific sector MR / policy or be pooled accross some sectors with a sleight of coding.
Always use panel data when available.
Experiment with lagged trade cost / policy variable.
Use intra-national trade if possible. It really helps with border trade cost.
Use fixed effects as discussed in previous slides.
Use PPML. (4+5=use PPMLHDFE)
for example:
Xij,t=exp[πi,t+χj,t+β1Dij,t+β2RTAij,t]×εij,t
Dij,t is a log distance. β1<0 can be interpreted as an increase in D by 1% would reduce trade flow by β1 percent, ceteris paribus
RTAij,t is a dummy variable=1 if an RTA exists. We interpret β2>0 as a country would trade [eβ2−1]×100 more if there is a trade agreement, ceteris paribus.
Please have a look at imedkrisna.github.io/misc. Choose whether you want to use R or Stata.
Complete the preparation of installing R & RStudio or Stata.
Download everything in here. Be mindful of the size of the dataset.
Bring your laptop. We will conduct an exercise of replicating Silva & Tenreyro (2006) but also a sectoral gravity regression.
Silva, Santos, and Silvana Tenreyro. 2006. “The Log of Gravity.” The Review of Economics and Statistics 88 (4): 19.
Yotov, Yoto. 2022. “Gravity at Sixty: The Workhorse Model of Trade.” CESifo Working Papers 9584.
Yotov, Yoto, Roberta Piermartini, Jose-Antonio Monteiro, and Mario Larch. 2016. “An Advanced Guide to Trade Policy Analysis: The Structural Gravity Model”. WTO and UNCTAD.
Correia, Sergio, Paulo Guimarães, and Tom Zylkin. 2020. “Fast Poisson Estimation with High-Dimensional Fixed Effects.” The Stata Journal 20 (1): 95–115.