Examples¶
The examples/
directory in the repository contains runnable scripts demonstrating the
package end to end. They are plain Python scripts with # %% cell
markers (compatible with the Jupyter/VS Code “run cell” workflow), not
Sphinx-executed notebooks, so this page links to them rather than
reproducing their full content.
Run any of them from a checkout of the repository, e.g.:
cd examples
python example_datasets_load.py
Datasets¶
example_datasets_load.py – list and load the bundled example datasets (
geossm.datasets).example_datasets_grid.py – create and manipulate spatial grids from a dataset.
Design matrices¶
example_DesignMatrix_OLS.py – build a design matrix with
DesignMatricesBuilderand fit a plain OLS regression against it.example_DesignMatrix_OLS_simulation.py – simulate data and recover known coefficients through the same design-matrix pipeline.
example_Params_ad.py – work with
Param/ModelParamsdirectly.
Covariance models and meshes¶
example_mesh_1.py, example_mesh_italy.py, example_mesh_lowrank.py – build 2D meshes with
buildMesh2d()and its density/grid variants.example_Cov_Model.py, example_Cov_Model_italy.py – build a mesh and set up
spdeAppoxCov, the finite-element Matérn covariance approximation.example_spde_pyfem.py, example_GP_FEM_1.py – lower-level finite-element (
FEMSolver) usage.
State-space models (full-rank)¶
example_SSM_build.py – construct a
StateSpaceModeldirectly from system matrices.example_SSM_estimate.py – estimate model parameters.
example_SSM_filter.py, example_SSM_smooth.py – run the Kalman filter and RTS smoother.
Low-rank state-space models¶
example_LRSSM_build.py – the workflow used in Quick Start: load data, build a mesh, attach a covariance model, and initialize a
LRStateSpaceModel.example_LRSSM_estimate.py, example_LRSSM_estimate_2.py, example_LRSSM_estimate_3.py – fit the model with custom
FitOptions, initial parameter values, and fixed parameters.example_LRSSM_inference.py – standard errors, significance, and confidence intervals via
results.compute_cov_params().example_LRSSM_simulate.py – simulate data from a (fitted or user-specified) model.
example_LRSSM_prediction.py – predict at new locations/times and export results with
to_geo().example_LRSSM_cpu_gpu.py – select the JAX compute backend (
backend='cpu'|'gpu'|'auto').
Case studies¶
The case_studies/ directory contains larger, applied scripts (e.g. a PM10 air-quality analysis) that combine several of the pieces above on a full dataset, closer to a real analysis than a minimal example.