GEO INFER SPM

From ActiveInferenceInstitute/GEO-INFER · View interactive version

GEO INFER SPM is an AI agent skill from the GitHub repository ActiveInferenceInstitute/GEO-INFER. Statistical Parametric Mapping for geospatial data. Use when performing GLM-based spatial analysis, random field theory corrections, cluster-level inference, or neuroimaging-style statistical mapping on geographic datasets.

How to use this skill

Skill file

GEO-INFER-SPM

Instructions

Core Capabilities

Key Imports

from geo_infer_spm.core.glm import GeneralLinearModel
from geo_infer_spm.core.rft import RandomFieldTheory
from geo_infer_spm.models.data_models import SPMData, SPMResult
from geo_infer_spm.visualization.interactive import create_time_series_explorer

Random Field Theory Inference

import numpy as np
from geo_infer_spm.core.rft import RandomFieldTheory

rft = RandomFieldTheory(
    field_shape=(64, 64),
    smoothness=np.array([4.5, 4.5]),
)
rft.compute_resel_counts()

peak_height = rft.peak_threshold(0.05, stat_type="Z", two_sided=True)
cluster_p = rft.cluster_extent_p_value(
    extent=1.25,
    cluster_forming_threshold=3.09,
    stat_type="Z",
    two_sided=True,
)

Examples

from geo_infer_spm.models.data_models import SPMData
import numpy as np

data = SPMData(
    data=np.random.randn(100, 50),
    coordinates=np.column_stack([
        np.random.uniform(-90, 90, 100),   # latitudes
        np.random.uniform(-180, 180, 100)   # longitudes
    ])
)

Agent interfaces

Use uv run --frozen geo-infer catalog SPM to discover public source

APIs, then geo-infer describe before calling a selected target. Scripts use

geo_infer_api.agent_runtime.AgentSession; the optional stdio MCP server is

geo-infer-mcp. See requests, native objects and composition.

The adapter retains this module's dependencies and authorization requirements.

Guidelines

uv run python GEO-INFER-TEST/run_unified_tests.py --module SPM

set chains and cores explicitly when allocating parallel CPU work.

native sampling profiles. Linux uses the

standard compiler profile; both profiles run actual PyMC and CLinker tests.

Integrations

and consumes plain numpy arrays / GeoDataFrames.

BayesianSPM; without them it falls back to a logged empirical-Bayes

approximation).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.