Skip to content

pyGWRx

Geographically
weighted modelling,
refined for research.

pyGWRx is a Python toolkit for spatially varying relationships—
multiscale, robust, and extensible.

Choose your path

Move from question to result

The documentation is organized around the task you are trying to complete—not around the internal file structure of the package.

A coherent toolkit

One workflow across five layers

Models share a consistent research workflow: fit, inspect, diagnose, visualize, and report—with capability boundaries documented rather than hidden.

01

Models

Regression, classification, transformation, local statistics, and inference families.

02

Core numerics

Kernels, distances, local solvers, bandwidth search, metrics, optimization, and validation.

03

Diagnostics

Residuals, influence, inference, local collinearity, temporal structure, weights, and regimes.

04

Visualization

Fifty-six model-aware and array-based plotting functions returning Matplotlib objects.

05

I/O and examples

NumPy/pandas-first contracts, built-in GeoDataFrame integration, persistence, and reproducible examples.

quickstart.py
from pygwrx import GWR
from pygwrx.diagnostics import diagnostics_frame
from pygwrx.plotting import plot_diagnostic_panel

model = GWR(
    kernel="bisquare",
    bandwidth=48,
    adaptive=True,
)
model.fit(X, y, coords)

print(model.summary())
print(diagnostics_frame([model], labels=["GWR"]))

fig, axes = plot_diagnostic_panel(model, theme="paper")
fig.savefig("gwr_diagnostics.png", dpi=200)
Model landscape

Start from the scientific structure

Begin with the simplest model that matches the response and spatial process, then add complexity only when diagnostics and theory justify it.

Core local regression

Continuous responses with spatially varying relationships.

Robust and regularized

Outliers, instability, local collinearity, and sparse effects.

Generalized and categorical

Counts, binary outcomes, and locally varying classes.

Space and time

Row-wise timestamps, historical stages, and parameter-specific scales.

Similarity and research models

Functional neighbourhoods, latent geometry, and connected regimes.

Research quality

Designed to make assumptions visible

Explicit capability boundaries

Prediction, transformation, classification, statistics, and inference are documented as different operations—not presented as interchangeable estimators.

Examples as a public contract

Every public API is mapped to a maintained example, with automated 174/174 coverage validation.

Reproducible engineering

Deterministic example data, strict documentation builds, typed result objects, isolated optional dependencies, and reference comparisons where available.

Ready to fit your first local model?

Install the base package, run the five-minute workflow, then use diagnostics before adding model complexity.

Install pyGWRx