Gravity Modeling Software

To date, I've worked on two Python packages that perform gravity modeling in Python. The first of these was the gme package, which is a collection of econometric gravity tools that perform modern structural gravity estimations. The second is gegravity, which performs general equilibrium gravity simulations. Both are briefly described here with links to additional information.

gegravity: General Equilibrium Gravity Modeling in Python

gegravity is a Python package containing tools used to estimate general equilibrium (GE) structural gravity models and simulate counterfactual experiments. The package is based on the well established version of the gravity model described by Yotov, Piermartini, Monteiro, and Larch (2016) An Advanced Guide to Trade Policy Analysis: The Structural Gravity Model. It implements the structural GE gravity model in a general, robust, and easy to use manner in an effort to make GE gravity modeling more accessible for researchers and policy analysts.

For more information about the GE gravity model, its implementation, the various components of the package, and examples, see the companion paper "gegravity: General Equilibrium Gravity Modeling in Python" as well as the technical documentation.

The gegravity package can be installed via pip:

$ pip install gegravity

gme: Python Gravity Modeling Environment

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.

For more information, see the package documentation.

The gme package can be installed via pip:

$ pip install gme