Skip to main content

Information-geometric early warning signals: KL rate, Fisher–Rao geometry, geodesic acceleration.

Project description

geoews

PyPI version Python 3.10+ License: MIT

Information-geometric early warning signals on sliding-window Gaussian models: KL divergence rate, Fisher–Rao step distances, and geodesic acceleration, plus classical benchmarks and optional data helpers.

Math matches the validated research implementation (sliding-window Gaussian fit, same KL and FR formulas, same regularization).

Install

From PyPI (recommended):

pip install geoews

Upgrade:

pip install geoews --upgrade

Quick start — high-level API

ManifoldEWS fits sliding-window Gaussians, computes indicators, and runs a simple baseline-threshold detection:

import numpy as np
from geoews import ManifoldEWS

x = np.random.default_rng(0).standard_normal(500)
result = ManifoldEWS(window=40, cumul_window=30).fit(x).detect()
print(result)  # EWSResult with kl_rate, geodesic_acceleration, threshold, etc.

Lower-level API (same math, full control)

import numpy as np
from geoews.windows import estimate_gaussian_params, COVARIANCE_REGULARIZATION
from geoews.indicators import kl_rate, geodesic_acceleration

x = np.sin(np.linspace(0, 12, 2000))
times, mus, sigmas = estimate_gaussian_params(x, window_size=50, step=1)

kl = kl_rate(mus, sigmas)
acc = geodesic_acceleration(mus, sigmas, cumul_window=30)

kl_rate is the KL divergence rate between consecutive window Gaussians (alias of kl_divergence_rate).

Classical benchmarks

from geoews import variance_ews, acf_ews

times_v, var_series = variance_ews(x, window=50, step=1)
times_a, acf_series = acf_ews(x, window=50, step=1)

Optional datasets (local files)

load_ngrip and load_peter_lake expect paths to your own copies of the public datasets (Excel/CSV). See the examples/ notebooks in the repo for typical usage.

Constants

  • COVARIANCE_REGULARIZATION defaults to 1e-6 (diagonal ridge on covariance / variance).

Development (from a git clone)

git clone https://github.com/vonixxxxx/geoews.git
cd geoews
pip install -e ".[dev]"
pytest

Citation

See CITATION.cff in the repository for citation metadata.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geoews-0.1.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geoews-0.1.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file geoews-0.1.1.tar.gz.

File metadata

  • Download URL: geoews-0.1.1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for geoews-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d8cd2e14d5cbe400cac1fc32c62835d36e070869f9fc79857aadf2ebd401a080
MD5 efb3b005acca9e1e6e15b6c0efad42e5
BLAKE2b-256 20900e2e46673e0f2fc5c0e0e29d2a986e84c623ad89c263dd179a6f452b2346

See more details on using hashes here.

File details

Details for the file geoews-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: geoews-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for geoews-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b20b7bd72072188c364ef0adb42aa7d81474517a7096a88d7d1445b9325b0b6
MD5 fa35928e8a0bc59b8358c5c764ffb331
BLAKE2b-256 e272cbbc701732f2bd3677b2f9b33b6cf7c46c7606ad5ba62f41f9a7506905ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page