--- id: spreg version: "1.9.1" license: BSD 3-Clause license_treatment: permissive maintenance: active --- # spreg — PySAL Spatial Econometric Regression in Python License: permissive · Maintenance: active · Downloads: 137.3K/mo ## What it is and what it does spreg is a Python package for estimating simultaneous autoregressive spatial regression models, part of the PySAL ecosystem. It addresses the statistical modeling of spatial processes where observations are not independent but interact with neighboring observations—a common scenario in geography, economics, and environmental science. The package builds on established scientific Python libraries (numpy, pandas, scikit-learn, scipy) and integrates with libpysal for spatial data structures. The package is designed for researchers and practitioners who need to move beyond standard regression when spatial autocorrelation is present in their data. It handles the computational complexity of fitting models where the outcome at one location depends on outcomes at nearby locations, which violates the independence assumption of ordinary regression and requires specialized estimation techniques. Use it for: - Model house prices or property values where neighboring properties influence each other through spatial spillover effects - Estimate regional economic growth where neighboring regions' economies interact and influence each other - Analyze disease or pollution incidence across geographic areas accounting for spatial clustering and diffusion - Study crime rates in neighborhoods where crime in adjacent areas affects local crime patterns - Model agricultural yields or environmental variables across spatial fields with spatial correlation ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. spreg estimates simultaneous autoregressive spatial regression models for processes where observations interact with one another. Yes, if you are modeling spatial data with autocorrelation. The package is actively maintained, has low install friction, carries a permissive BSD 3-Clause license, and integrates cleanly with numpy, pandas, scikit-learn, and scipy. No known vulnerabilities. Requires Python 3.12 or later, which may constrain legacy environments. Suitable for academic and applied spatial econometric work. ## Install pip install spreg uv add spreg poetry add spreg ## Installing spreg Before you install: Low friction installation with a pure-Python wheel. Active maintenance: last commit 2026-07-27, released 18 days ago. Requires Python 3.12 or later. License in practice: BSD 3-Clause permissive license allows commercial and private use with attribution and liability disclaimer. Quickstart: pip install spreg import spreg from libpysal import weights from spreg import OLS # model = OLS(y, X, w=weights_matrix) Requires Python 3.12 or later. Verify before relying: - Whether the package supports spatial lag and spatial error models specifically, or other SAR variants - Performance characteristics or scalability limits for large spatial datasets - Availability and completeness of documentation beyond the repository README ## Package facts - License: BSD 3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 137.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags spatial regression models, autoregressive spatial econometrics, spatial modeling python, simultaneous autoregressive estimation, spatial econometric regression, spatial interaction modeling, gis regression analysis, spatial-analysis, econometrics, gis [View on SkillFed](https://skillfed.io/packages/spreg) · [View on PyPI](https://pypi.org/project/spreg/)