Skip to main content
Economics· 17-page report· 1 figure

Gravity Model Trade Estimation OLS vs PPML

Estimate gravity trade models comparing OLS and PPML estimators on bilateral trade flows.

What this research found

The gravity model — trade rises with partner size and falls with distance — is the workhorse of empirical international economics, but the standard practice of taking logarithms and running least squares deletes every country pair that trades nothing. K-Dense fit the identical specification to the 2019 cross-section of the CEPII Gravity Database both ways: least squares on log trade, and Poisson pseudo-maximum-likelihood on trade levels, which keeps the zeros. The distance elasticity came out at -1.528 under least squares versus -0.648 under Poisson, a factor of roughly 2.4, with the Poisson figure landing inside the published consensus range and the least-squares figure at its extreme.

  • The two estimators disagree far beyond sampling noise, with non-overlapping confidence intervals. Least squares gave a distance elasticity of -1.528 on 28,113 positive flows; Poisson gave -0.648 on 39,800 observations. Only the Poisson value falls inside the roughly -0.6 to -1.1 range synthesized in the literature.
  • Regional trade agreement membership is associated with 57.2% more bilateral trade under least squares but 42.0% under Poisson, an overstatement of about a third.
  • Keeping the zeros matters because they are not missing at random. Poisson retained 11,687 zero-trade pairs, about 29% of the covariate-complete sample, which tend to be smaller, more distant, and less integrated — exactly the dimensions the model is trying to measure.
  • Sample construction changed the answer as much as the estimator. An early Poisson run that retained 267 self-trade rows produced an implausible distance elasticity of -0.316, because unobserved internal trade was being filled with zeros at very short distances; excluding those rows restored -0.648.
  • The apparent effect of a shared official language does not survive the change of estimator: 0.887 and highly significant under least squares, but -0.002 with a p-value of 0.98 under Poisson, suggesting the log-linear language effect largely runs through whether a pair trades at all.
  • Country-level gross domestic product cannot be estimated alongside exporter and importer fixed effects in a single cross-section. Within-country variance of log GDP was verified to be exactly zero, confirming the size terms are perfectly absorbed — a property of structural gravity rather than a data problem.

How it was done

The 2022 release of the CEPII Gravity Database, whose trade flows come from the BACI reconciliation of UN Comtrade mirror data, was streamed and filtered to 2019, yielding 63,504 country-pair rows. Cleaning removed 503 duplicate rows and 267 self-trade rows, then required both partners' GDP and bilateral distance to be present and strictly positive while requiring only non-missingness of the contiguity, common-language, and trade-agreement dummies, leaving 39,800 usable observations. The same specification — log distance, contiguity, common official language, and trade-agreement membership, with exporter and importer fixed effects capturing multilateral resistance — was estimated by least squares on log trade over positive flows only and by Poisson pseudo-maximum-likelihood on trade levels with unobserved flows treated as structural zeros. Both used heteroskedasticity-robust standard errors, and the absorption of country-level GDP by the fixed effects was verified numerically.

Data sources

  • CEPII Gravity Database, release V202211, year 2019 — 63,504 country-pair rows drawn from a 4,699,296-row full release
  • CEPII BACI — bilateral merchandise trade flows reconciled from UN Comtrade mirror data
  • Santos Silva & Tenreyro, The Log of Gravity, Review of Economics and Statistics 88:641 (2006)
  • Head & Mayer, Handbook of International Economics vol. 4, pp. 131-195 (2014)
  • Disdier & Head, Review of Economics and Statistics 90:37 (2008) — meta-analysis of distance elasticities
  • Anderson & van Wincoop, American Economic Review 93:170 (2003)
  • Fally, Journal of International Economics 97:76 (2015) — structural gravity and fixed effects

Limitations

This is a single 2019 cross-section, so it cannot exploit the within-pair variation over time that panel gravity uses to separate trade-agreement effects from endogeneity; the agreement coefficients are best read as associations rather than causal effects. Standard errors are robust but not clustered by country, and because internal trade is unobserved the estimates cover international flows only.

How this research was produced

K-Dense Web planned and ran this economics investigation end to end — gathering the sources, carrying out the analysis, producing the figures, and drafting the report. The full session transcript, including every intermediate step, is available to view.

Share:
Economics

Macroeconomic Recession Prediction

Predict US recessions at 3, 6, and 12-month horizons using FRED macroeconomic indicators with XGBoost and Bayesian models.

Economics

Easterlin Paradox Life-Ladder and GDP Analysis

Test the Easterlin paradox by relating life-ladder scores to GDP across countries and over time.

Economics

Vietnam Trade Exposure & External Vulnerability Assessment

Assess Vietnam trade exposure and external vulnerability from 2010–2022 using macro trajectory indicators.

Run this kind of analysis on your own question

Try K-Dense Web free and see how an AI co-scientist accelerates your research.