API Reference
Maps & exploratory spatial analysis
Interactive Plotly maps and ESDA — classified and animated choropleths, the weights connectivity graph, Moran scatterplots, LISA cluster maps, Moran’s I over time, and space-time descriptives of the regional distribution.
| explore_choropleth_map | Map one variable across entities as a classed (or continuous) choropleth. |
| explore_connectivity_map | Draw the spatial weights graph over the map and summarize its connectivity. |
| explore_moran_plot | Draw the Moran scatterplot and test global spatial autocorrelation in var. |
| explore_lisa_cluster_map | Map local Moran (LISA) clusters of var and the matching Moran scatterplot. |
| explore_moran_over_time | Track global Moran’s I in var period by period on a fixed entity set. |
| explore_distribution_over_time | Track how the cross-sectional distribution of one variable evolves over time. |
| explore_spacetime_heatmap | Draw one variable as an entity-by-time heatmap (every unit keeps its row). |
Convergence
β-convergence with OLS or spatial estimators (SAR / SEM / SLX / SDM) and the LeSage-Pace impact decomposition, σ-convergence (dispersion trends), and Phillips-Sul convergence clubs with club maps.
| analyze_beta_convergence | β-convergence of a panel variable, from plain OLS to the spatial Durbin model. |
| analyze_sigma_convergence | σ-convergence: track and test the cross-sectional dispersion of a panel variable. |
| analyze_convergence_clubs | Phillips-Sul log(t) convergence test and data-driven club clustering for a panel. |
| growth_cross_section | Build the per-unit growth cross-section a convergence analysis starts from. |
Spatial econometric models
The spreg suite — OLS / spatial lag / spatial error / SLX / spatial Durbin estimation with direct, indirect and total impacts; Lagrange-multiplier specification diagnostics with a model recommendation; and robustness of the impacts to the choice of spatial weights.
| analyze_spatial_model | Estimate a cross-sectional spatial econometric model with impact decomposition. |
| analyze_spatial_diagnostics | Run the LM specification tests on OLS residuals and recommend a spatial model. |
| analyze_spatial_model_by_weights | Re-estimate a spatial model under alternative weights and compare the impacts. |
Distribution dynamics
Markov transition analysis of the regional distribution and Rey’s spatially conditioned Markov chains (requires the dynamics extra).
| analyze_markov_transitions | Estimate a discrete Markov chain of movement between distribution states. |
| analyze_spatial_markov | Estimate a spatial Markov chain: transitions conditioned on the neighbors’ state. |
Regional inequality
Gini / Theil / CV trends over time (with the spatial Gini decomposition), and the Theil between/within decomposition across regional groupings.
| analyze_inequality_over_time | Track cross-sectional inequality measures over time and test their trend. |
| analyze_theil_decomposition | Decompose the Theil index between and within a group partition, per period. |
Local models
Geographically weighted regression and multiscale GWR with mapped local coefficients and multiple-testing-corrected significance masking.
| analyze_gwr | Fit a geographically weighted regression and map each local surface. |
| analyze_mgwr | Fit a multiscale GWR: every term gets its own spatial scale (bandwidth). |
Learn (concept sandboxes)
Monte-Carlo teaching sandboxes that simulate data from a known data-generating process so a learner can watch each estimator recover a planted parameter. No data required — each takes keyword knobs and returns .df / .fig / .summary / .interpret(). The two Markov sandboxes need the dynamics extra.
| learn_spatial_autocorrelation | See what spatial autocorrelation looks like — and how Moran’s I tracks it. |
| learn_spatial_weights | See how the choice of spatial weights changes what “neighbors” means. |
| learn_lisa_clusters | Plant hot and cold spots, then watch LISA find them (and sometimes cry wolf). |
| learn_spatial_spillovers | Plant direct and indirect effects, then recover them as LeSage-Pace impacts. |
| learn_omitted_spatial_lag | Show why ignoring spatial dependence biases OLS — and how SAR repairs it. |
| learn_beta_convergence | Plant a convergence rate, then watch the growth-on-initial regression find it. |
| learn_sigma_convergence | Plant a shrinking dispersion path, then watch the σ trend recover it. |
| learn_convergence_clubs | Plant convergence clubs, then watch the Phillips-Sul algorithm find them. |
| learn_markov_chains | Plant a transition matrix, then watch the estimated chain recover it. |
| learn_spatial_markov | Plant neighbor-dependent mobility, then watch the spatial Markov test flag it. |
| learn_theil_decomposition | Plant a between/within inequality split, then watch Theil decompose it. |
Utilities
Cross-cutting helpers — geometry loading, spatial-weights construction, panel declaration, data-dictionary inference, theming, and the concept-explainer registry.
| read_gdf | Read user geometry into a validated GeoDataFrame (the geometry entry point). |
| make_weights | Build a spatial weights matrix from geometry with the library’s conventions. |
| set_panel | Declare the panel’s entity, time (and optional entity_name) columns on df. |
| resolve_panel | Resolve the (entity, time) ids for df: explicit args win, else df.attrs. |
| set_labels | Declare human-readable variable labels on df and return it. |
| resolve_label | Resolve the display label for name: explicit label wins, else attrs, else name. |
| set_roles | Declare the main outcome and covariates on df and return it. |
| build_data_dict | Infer a best-guess data dictionary (df_dict) for df. |
| set_palette | Switch the global geometrics color palette. |
| get_palette | Return the name of the currently active palette ("default" / "colorblind"). |
| explain | Return the :class:Explainer for a method or concept. |
| list_topics | Return the sorted list of canonical topic keys (for app menus and docs). |
Interactive apps
The three no-code Streamlit apps — one per module — launched from Python (requires the streamlit extra) or from the repo’s app_*.py scripts.
| ExploreApp | Launch the Explore app (maps, weights, Moran/LISA, space-time views). |
| AnalyzeApp | Launch the Analyze app (convergence, spatial models, dynamics, inequality). |
| LearnApp | Launch the Learn app (concept sandboxes and explainers). |
Datasets
The bundled case studies — 520 Indian districts observed by satellite nighttime lights (1996-2010) with a 32-state demo, and the Bolivia PWT-anchored local GDP collection (departments, provinces, and 0.25-degree grid cells, 2012-2022). Files are fetched from pinned GitHub raw URLs, hash-verified, and cached locally.
| load_india | Load the India district (n=520) nighttime lights case study. |
| load_india_states | Load the India states (n=32) nighttime lights cross-section for 1992. |
| load_india_raw | Load the untouched source files of the India district case study. |
| load_bolivia | Load the Bolivia province (ADM2, n=112) PWT-anchored GDP panel. |
| load_bolivia_departments | Load the Bolivia department (ADM1, n=9) PWT-anchored GDP panel. |
| load_bolivia_grid | Load the Bolivia 0.25-degree grid cells (n=1603) PWT-anchored GDP panel. |
| load_bolivia_raw | Load the untouched files of one Bolivia level (including ADM0). |
| clear_cache | Remove the local cache of downloaded case-study files. |