GEO INFER MATH

From ActiveInferenceInstitute/GEO-INFER · View interactive version

GEO INFER MATH is an AI agent skill from the GitHub repository ActiveInferenceInstitute/GEO-INFER. Spatial statistics, native RBF interpolation, computation caching, topology, and graph theory for geospatial analysis. Use when computing spatial autocorrelation, interpolating observations, caching numerical work, calculating geodesic distances, graph connectivity, or kernel density estimates.

How to use this skill

Skill file

GEO-INFER-MATH

For MIMO power budgets, zero-gain parallel channels or spatial entropy units,

read communication and entropy conventions. Explicit

MIMO power is divided equally across transmitters; None retains unit power

per transmitter. These equal-stream rates do not optimize a transmit covariance.

Instructions

Foundation module with zero internal dependencies. Provides mathematical primitives consumed by all other modules.

Core Capabilities

Key Imports

# Spatial statistics
from geo_infer_math.core.spatial_statistics import (
    MoranI, SpatialDescriptiveStats,
    getis_ord_g, ripley_k, semivariogram,
    spatial_descriptive_statistics, spatial_entropy,
    local_indicators_spatial_association,
)
# Interpolation
from geo_infer_math.core.interpolation import (
    InterpolationConfig, SpatialInterpolator,
    IDWInterpolator, KrigingInterpolator, RBFInterpolator,
    InterpolationManager, create_interpolation_manager,
    interpolate_spatial_data, create_interpolation_grid,
)
# Optimization
from geo_infer_math.core.optimization import (
    OptimizationConfig, Optimizer,
    GradientDescentOptimizer, GeneticAlgorithmOptimizer,
    ScipyOptimizer, MultiObjectiveOptimizer,
    OptimizationManager, create_optimization_manager,
    optimize_function, compare_optimization_methods,
)
# Geometry / distance
from geo_infer_math.core.geometry import (
    Point, LineString, Polygon,
    haversine_distance, vincenty_distance,
    bearing, destination_point,
    point_in_polygon, buffer_point,
    line_intersection, polygon_area_spherical,
)

Examples

import numpy as np
from geo_infer_math.core.spatial_statistics import (
    MoranI, getis_ord_g, ripley_k, semivariogram,
    spatial_descriptive_statistics,
)

# Moran's I spatial autocorrelation
values = np.random.randn(100)
weights = np.random.rand(100, 100)
moran = MoranI(weights)
result = moran.compute(values)
print(f"Moran's I: {result['I']}, p-value: {result['p_value']}")

# Getis-Ord G* hot-spot statistic
g_stat = getis_ord_g(values, weights)
print(f"Getis-Ord G: {g_stat}")

# Ripley's K function
coords = np.random.rand(50, 2)
k_values = ripley_k(coords, distances=np.linspace(0.01, 1.0, 20))
print(f"Ripley K at first distance: {k_values[0]:.4f}")

# Semivariogram
semivar = semivariogram(values, coords)
print(f"Semivariogram computed: {len(semivar)} lag bins")

# Descriptive spatial statistics
stats = spatial_descriptive_statistics(values, coords)
print(stats)

Agent interfaces

Use uv run --frozen geo-infer catalog MATH 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

Integrations

Memory and accelerator boundaries

Import MemoryConstraintError from geo_infer_math.utils for module memory-budget

failures. Python's builtin MemoryError is distinct. MATH imports defer GPU runtime

initialization; explicit accelerator operations perform capability probing.

Interpolation and cached computation

RBFInterpolator(InterpolationConfig(method="rbf", rbf_function="thin_plate_spline"))

uses SciPy's native RBF kernel. rbf_epsilon (default 1.0) scales distances

in the supplied coordinate system; normalize coordinates or choose a scale

appropriate to the data. Native solver/configuration errors propagate. A failed

refit preserves the previous successful model. Real and complex observations

retain their native numeric support.

cache_result(maxsize=128, ttl=None) uses bounded LRU storage and monotonic TTL.

Array shape, dtype and content participate in keys. Cached results retain native

identity and mutability; callers share that value. Concurrent misses may compute

the same key independently. Zero capacity or TTL disables storage; unpickleable

arguments execute uncached. Key generation serializes inputs without loading

serialized data. Use the wrapper's cache_info() and cache_clear() for metrics

and explicit lifecycle management.

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.