Software Overview
We have created tools to facilitate gravity analysis.
FastHDFE package
(First released in August 2026)
Click here to learn more about this package.
This Python package is for fast estimation of linear and multiplicative models with high-dimensional fixed effects. FastHDFE commands run up to forty-four times faster than Stata and work especially fast with big data such as ITPD-E, which has about 83 million observations and over 4 million fixed effects. The package has many useful input and output options and reproduces output of similar Stata packages. FastHDFE contains two commands: reghdfe to estimate linear models and ppmlhdfe to estimate multiplicative Poisson Pseudo-Maximum Likelihood (PPML) models. The commands use the method of alternating projections and, for PPML, iteratively reweighted least squares. The commands provide homoskedastic, heteroskedasticity-robust, and multi-way cluster-robust standard errors. They also provide detection and removal of separated observations via the iterative rectifier, and singleton handling.
GME package
(First released in October 2018)
Click here to see the documentation for the GME package, including the installation instructions.
The package consists of tools to aid in the fast, flexible, and robust estimation of gravity models using modern, best practices. It offers several distinct advantages over alternative software choices for conducting gravity analysis. First, the package is written in Python, a flexible, powerful, and free programming language that can be readily used on a wide variety of computers with no cost. Second, unlike more general statistical software, which must cater to a broad number of needs, the GME package has been specifically designed to perform gravity analysis well. Third, because the tools are implemented in Python, users have access to an enormous and growing collection of third-party tools to incorporate into and expand their work.
In the current release, the GME package performs Poisson Pseudo-Maximum Likelihood (PPML) estimation at the industry level, including all the necessary diagnostics. The package also includes a set of tools for producing summary statistics and other types of commonly sought descriptive information. The package can save and load estimation results in full or using a space-saving slim results option. Note that this package does not incorporate methods for dealing with high-dimensional fixed effects.
As of January 2023, the GME package has been downloaded over 8,000 times.
The GME package is an open-source project. We invite everyone to contribute to it via the project's GitHub account.