Gravity Models of Trade and Migration

Distance decay and inverse power laws in human geography

2026-02-26

Before You Start

You should know
How ratios and exponents work, and the common-sense idea that places usually interact less as distance increases.

You will learn
How gravity-style models estimate trade, migration, or travel, and why size and distance often compete to shape interaction.

Why this matters
Not every spatial model is about rivers or weather. This chapter shows how the same modelling mindset helps us understand human systems too.

If this gets hard, focus on…
The core sentence: big places pull more strongly, far-apart places interact less. The formula is just a disciplined way to say that.

In 1862, the Prussian economist Wilhelm Roscher noticed something striking about German trade statistics: the volume of commerce between two cities seemed to vary with their populations and decline with the distance between them — in almost exactly the same mathematical form as Newton’s law of gravitation. A century later, Jan Tinbergen’s early trade work and the broader migration literature gave the gravity model its modern empirical footing [@tinbergen1962; @ravenstein1885]. It has since been estimated thousands of times on trade, migration, commuting, phone calls, airline passenger flows, and internet traffic. It is one of the most empirically robust relationships in all of social science [@anderson-vanwincoop2003; @haynes-fotheringham1984].

What makes the gravity model remarkable is not the physics analogy but the fact that it works across such wildly different phenomena. People move between cities in proportion to the product of their populations and inversely to the distance between them. Goods flow similarly. So do phone calls, university applications, and remittance transfers. The deeper reason is economic: transport and transaction costs rise with distance, reducing the profitability of interaction. But the mathematical form — mass times mass divided by distance to some power — emerges from that economics naturally, without forcing it [@anderson-vanwincoop2003; @huff1964]. This model derives the gravity equation from first principles, explores how the distance exponent controls the steepness of spatial decay, and introduces the challenge of calibrating the model against real data.

1. The Question

Why do cities trade more with nearby cities than distant ones?

A person in Denver is more likely to: - Shop in Boulder (40 km away) than in Phoenix (900 km) - Migrate to Fort Collins (100 km) than to Seattle (2000 km) - Commute to Aurora (20 km) than to Colorado Springs (110 km)

Distance matters. But how exactly?

The mathematical question: Can we write down a formula that predicts the strength of interaction between two places based on their sizes and the distance separating them?


2. The Conceptual Model

The Gravity Analogy

In physics, Newton’s law of gravitation states:

F = G \frac{m_1 m_2}{r^2}

Gravitational force is: - Proportional to the masses of the two objects - Inversely proportional to the square of the distance between them

Human geography insight: Maybe social and economic interactions follow a similar pattern?

Gravity model of spatial interaction:

I_{ij} = k \frac{P_i^\alpha P_j^\beta}{d_{ij}^\gamma}

Where: - I_{ij} is the interaction between place i and place j (migration flow, trade volume, phone calls, etc.) - P_i, P_j are the populations (or economic sizes) of the two places - d_{ij} is the distance between them - k is a constant (scaling factor) - \alpha, \beta, \gamma are exponents (often \alpha = \beta = 1, \gamma \approx 1–$2$)

Distance Decay

The term d_{ij}^{-\gamma} is called distance decay.

As distance increases, interaction decreases rapidly: - If \gamma = 1: doubling distance halves interaction - If \gamma = 2: doubling distance quarters interaction (like gravity) - If \gamma = 3: doubling distance reduces interaction to 1/8

Key insight: The exponent \gamma determines how sensitive interaction is to distance.


3. Building the Mathematical Model

Simplest Form

Assume populations enter symmetrically (\alpha = \beta = 1) and distance decay follows an inverse square law (\gamma = 2):

I_{ij} = k \frac{P_i P_j}{d_{ij}^2}

Interpretation: - Numerator: Larger populations → more interaction (more potential traders, migrants, commuters) - Denominator: Greater distance → less interaction (higher travel cost, time, uncertainty)

Calibrating the Exponent

Real data rarely fit \gamma = 2 exactly. The exponent depends on: - Type of interaction: Commuting (\gamma \approx 1.5), migration (\gamma \approx 1–$2), trade (–$2.5) - Transportation technology: Better roads, cheaper flights → lower \gamma (distance matters less) - Cultural/linguistic barriers: Higher \gamma across language boundaries

Estimating \gamma: Fit the model to observed data using regression.

Take logarithms:

\ln I_{ij} = \ln k + \ln P_i + \ln P_j - \gamma \ln d_{ij}

This is linear in the logs. Regress \ln I_{ij} on \ln P_i, \ln P_j, and \ln d_{ij} to estimate \gamma.

Competing Destinations

If person in city i is choosing where to migrate among multiple destinations, the probability of choosing destination j is:

\text{Prob}(j | i) = \frac{P_j / d_{ij}^\gamma}{\sum_{k} P_k / d_{ik}^\gamma}

This is a discrete choice model — the denominator normalizes so probabilities sum to 1.

Interpretation: Larger, closer cities are more attractive destinations.


4. Worked Example by Hand

Problem: Three cities with populations and distances:

City Population Distance from A
A 100,000 0
B 50,000 100 km
C 200,000 200 km

Using the gravity model I_{ij} = k \frac{P_i P_j}{d_{ij}^2} with k = 1:

  1. What is the interaction I_{AB} (A ↔︎ B)?
  2. What is the interaction I_{AC} (A ↔︎ C)?
  3. Which city does A interact more with?

Solution

(a) Interaction A ↔︎ B

I_{AB} = \frac{100000 \times 50000}{100^2} = \frac{5 \times 10^9}{10000} = 500000

(b) Interaction A ↔︎ C

I_{AC} = \frac{100000 \times 200000}{200^2} = \frac{2 \times 10^{10}}{40000} = 500000

(c) Comparison

I_{AB} = I_{AC} = 500000

A interacts equally with B and C.

Why? City C is twice as far (200 km vs. 100 km) but has four times the population (200,000 vs. 50,000). With \gamma = 2, these effects exactly cancel:

\frac{200000}{200^2} = \frac{50000}{100^2}

If \gamma were larger (stronger distance decay), A would interact more with B. If \gamma were smaller (weaker distance decay), A would interact more with C.


5. Computational Implementation

Below is an interactive gravity model with adjustable parameters.

<label>
  Distance decay exponent (γ):
  <input type="range" id="gamma-slider" min="0.5" max="3.0" step="0.1" value="2.0">
  <span id="gamma-value">2.0</span>
</label>
<label>
  Number of cities:
  <input type="range" id="ncities-slider" min="3" max="10" step="1" value="5">
  <span id="ncities-value">5</span>
</label>
<label>
  Origin city:
  <select id="origin-select"></select>
</label>
<p id="gravity-info"></p>

Try this: - Set \gamma = 0.5 (weak distance decay): Large distant cities dominate - Set \gamma = 3.0 (strong distance decay): Only nearby cities matter - Change origin city: See how interaction patterns shift - Increase number of cities: More competing destinations

Key insight: The exponent \gamma is a behavioral parameter — it controls how much people care about distance vs. destination size.


6. Interpretation

Why Distance Decay Exists

Costs increase with distance: - Time: Longer travel takes more hours (lost productivity, fatigue) - Money: Fuel, tickets, shipping fees scale with distance - Uncertainty: Information about distant places is less reliable - Social ties: Harder to maintain relationships across long distances

Result: The friction of distance reduces interaction.

Cultural and Technological Shifts

Historical change: - 1800s: \gamma \approx 3–$4$ (horse-drawn transport, poor roads) - 1950s: \gamma \approx 2 (cars, highways, telephones) - 2020s: \gamma \approx 1–$1.5$ (air travel, internet, remote work)

Interpretation: Globalization = declining \gamma.

Borders and Barriers

The gravity model often underpredicts cross-border flows because: - Language differences - Currency and trade regulations - Cultural distance (not just spatial distance)

Modified model: Add a border effect term:

I_{ij} = k \frac{P_i P_j}{d_{ij}^\gamma} \times e^{-\delta B_{ij}}

Where B_{ij} = 1 if i and j are in different countries, 0 otherwise.


7. What Could Go Wrong?

Assuming Symmetry

The model assumes I_{ij} = I_{ji} (symmetric flows). In reality: - Migration: More people move from rural to urban areas than the reverse - Trade: Exports from A to B ≠ imports from B to A

Solution: Use origin-constrained or destination-constrained models that fix row or column totals.

Measuring Distance

Euclidean distance (straight-line) is simple but unrealistic.

Alternatives: - Road network distance (actual travel routes) - Travel time (accounts for speed limits, congestion) - Economic distance (cost of transport)

For air travel, straight-line distance is reasonable. For road freight, network distance matters.

Omitting Intervening Opportunities

If city C lies between A and B, people from A may stop in C rather than continuing to B — even if B is larger.

The gravity model doesn’t capture this spatial competition effect.

Solution: Intervening opportunities model — interaction decreases with the number of opportunities passed en route.

Aggregation Bias

The model uses city-level populations. In reality, individuals vary: - Some people are highly mobile (frequent travelers) - Others are tied to place (elderly, families, low income)

Aggregate models obscure individual heterogeneity.


8. Extension: Retail Gravity Models

A shopper choosing between two stores follows the same logic:

\text{Prob}(\text{Store } j) = \frac{S_j / d_j^\gamma}{\sum_k S_k / d_k^\gamma}

Where S_j is the size (floor area, product variety) of store j.

Application: Retailers use this to predict market share and choose store locations.

Reilly’s Law of Retail Gravitation (1931): The breaking point between two competing cities A and B is:

d_A = \frac{d_{AB}}{1 + \sqrt{P_B / P_A}}

Where d_{AB} is the distance between A and B. Customers closer than d_A to city A will shop in A; those farther will shop in B.


9. Math Refresher: Power Laws vs. Exponentials

Power Law

y = ax^{-\gamma}

Examples: Gravity model, city size distributions (Zipf’s law), earthquake magnitudes

Exponential Decay

y = ae^{-\lambda x}

Examples: Radioactive decay, light attenuation, population density with distance from city center

Which Fits Better?

Empirical finding: Many spatial interactions fit power laws better than exponentials over most distance ranges.

Why? Power laws lack a characteristic scale — interaction decays gradually at all distances, rather than dropping sharply beyond a threshold.


Summary