Spatial Logistic Regression in Python 3?

335 views
Skip to first unread message

Kellen Byrnes

unread,
Dec 29, 2020, 7:47:27 AM12/29/20
to Openspace List
Hi Folks, I'm having difficulty finding a spatial logistic regression method in Python 3.  It appears the PySAL module features spatial linear regression but not GLM models such as logistic regression with the option to add a spatial weights matrix.  

If anyone has thoughts or suggestions on how to apply a spatial regression for binary classes such as logistic reg in Py 3 that would be very appreciated. 

Cheers, Kellen

Pedro Amaral

unread,
Dec 29, 2020, 8:26:13 AM12/29/20
to Openspace List
Hi Kellen,

Spreg in PySAL offers diagnostics for spatial dependence in Probit models and the estimation of spatial probit regressions of the SLX type

You can find an example of how to use the Probit module in PySAL here: https://github.com/pysal/spreg/blob/d464bbbc3c8601f1ca1989f4756967dca3a83179/spreg/probit.py#L704

Unfortunately, PySAL does not offer tools to estimate Spatial Lag and Error in Probit models. You can find these in R and MatLab.

Best,

Pedro.

---
Pedro V. Amaral
Department of Economics (Cedeplar/FACE), Universidade Federal de Minas Gerais - Brazil
Fellow - Center for Spatial Data Science, University of Chicago
Co-editor - Spatial Economic Analysis; Regional Studies, Regional Science; Journal of Spatial Econometrics

Kellen Byrnes

unread,
Dec 30, 2020, 5:08:32 AM12/30/20
to Openspace List
Brilliant, thanks Pedro!
Reply all
Reply to author
Forward
0 new messages