Spatial regression in Python
Model relationships that change across space. The series fits spatial lag and error regression models, then lets coefficients vary by place with geographically weighted regression.
- Intermediate to Advanced
- 2, all published
- About 35 minutes
The parts, in order
-
Spatial regression in Python: OLS diagnostics, spatial lag and spatial error models with spreg
Fit spatial regression models in Python with PySAL's spreg on real West Yorkshire house prices: test the OLS residuals for spatial autocorrelation, read the Lagrange Multiplier diagnostics, fit spatial lag and spatial error models, compare them by AIC and log-likelihood, interpret direct, indirect and total impacts, and check how much the spatial weights matter.
-
Geographically weighted regression in Python: GWR and MGWR with mgwr
Fit geographically weighted regression (GWR) and multiscale GWR (MGWR) in Python with the mgwr package on real West Yorkshire house prices: choose the bandwidth by AICc, map local coefficients with a multiple-testing correction, read local R² and local collinearity, and compare against global OLS, spatial lag and spatial error models.