Skip to main content

Generalized Linear Modeling

Continuous Integration Documentation Status PyPI version codecov

This module is an adaptation of a portion of GLM functionality from the Statsmodels package, this it has been simplified and customized for the purposes of serving as the base for several other PySAL modules, namely SpInt and GWR. Currently, it supports the estimation of Gaussian, Poisson, and Logistic regression using only iteratively weighted least squares estimation (IWLS). One of the large differences this module and the functions avaialble in the Statsmodels package is that the custom IWLS routine is fully sparse compatible, which was necesary for the very sparse design matrices that arise in constrained spatial interaction models. The somewhat limited functionality and computation of only a subset of GLM diagnostics also decreases the computational overhead. Another difference is that this module also supports the estimation of QuasiPoisson models. One caveat is that this custom IWLS routine currently generates estimates by directly solves the least squares normal equations rather than using a more robust method like the pseudo inverse. For more robust estimation of ill conditioned data and a fuller GLM framework we suggest using the original GLM functionality from Statsmodels.

Features

  • Gaussian GLM
  • Poisson GLM
  • QuasiPoisson GLM
  • Logistic GLM
  • Selection of most common GLM diagnostics
  • Supports sparse design matrices

Future Work

  • Add Negative Binomial GLM
  • Add Gamma GLM
  • Add Zero-inflated/Hurdle extensions of Poisson/Negative Binomial
  • Add support for gradient based optimization for maximum likelihood estimation

Release files for spglm 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spglm 1.1.0
File Size Uploaded
spglm-1.1.0.tar.gz 616.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spglm 1.1.0
File Interpreter ABI Platform
spglm-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 658.0 kB

Release files / spglm-1.1.0.tar.gz

Download URL spglm-1.1.0.tar.gz
Size 616.7 kB
Tags Source
SHA-256 checksum
How to use checksums
20519dc38be9d660a28109bb1b89d1068454e79f6413bab2e3987db5bf959327
BLAKE2b-256 checksum
How to use checksums
16875e8ba8b386cdf0289190ae4b1a8aecfeb061c84b4bade081641021a9d257
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / spglm-1.1.0-py3-none-any.whl

Download URL spglm-1.1.0-py3-none-any.whl
Size 41.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98240e3889c6672405ca90d9f9e7bd59bc86f8ecb69c03a14b87c38d8e6cf1c4
BLAKE2b-256 checksum
How to use checksums
0414fac87dce2abbd7ee3b3bb3250cc2980388802f8cded9234d8ecb09801534
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page