Spatial: Networks, Interaction, & Econometrics for Migration

Author
Affiliation

University of California, Irvine

Published

July 25, 2025

NERSA/NARSC Program in Mobility, Migration & Regional Science

D.C. Commutes

D.C. Commutes

Open in GitHub Codespaces

1 Install and Run

To run locally:

  • install pixi
  • clone this repository, follow below

To run in codespaces:

  • click the ‘open in codespaces’ button above
    • the default config will include at least 8 cores (dont go below 32gb memory), but you can crank it up for better performance
  • pixi install
  • pixi run jupyter lab

if running in a codespace this starts a jupyter server on the VM’s ‘localhost’. Open an existing notebook (or start a new one). When selecting a kernel, choose ‘Existing jupyter server’ and copy/paste the URL with token from the terminal

edit the notebooks as you like

if you want to use the jupyterlab interface instead of VSCode:

  • in the bottom panel click the “ports” tab
  • click the “add port” button
    • type 8888
    • ports

      ports
  • click back in the vscode interface
    • click the “terminal” tab in the bottom panel
    • scroll up and copy the token string from the URL
    • token

      token
    • click back into jupyterlab and paste the token

2 Schedule

Flow Neighbor Example

Flow Neighbor Example

2.1 Overview

  • spatial data and analysis in python
  • encoding spatial relationships
  • model flows via spatial interaction
  • model flows via spatial econometric interaction

2.2 Introduction

open source and open science

  • pixi & conda
  • jupyter
  • python
  • python
  • pysal
  • geosnap

2.3 spatial data in python

  • pandas
  • numpy
  • shapely
  • geopandas
  • census and lodes

2.4 spatial graphs

encoding relationships between spatial objects

  • contiguity
  • k-nearest neighbors
  • distance
  • flows

2.5 spatial interaction models

modeling the flow between \(o\) and \(d\) as a function of push and pull factors

  • gravity model (unconstrained)
  • attraction constrained
  • production constrained
  • doubly constrained

2.6 spatial econometric models

multiple graphs: modeling spatial dependence in the flow between \(o\) and \(d\) via \(^oW\), \(^dW\), and \(^{od}W\)

  • spatial dependence
  • OD-Graphs
  • lag models
  • error models