Skip to main content

Forecastability triage for time series using AMI, pAMI, and covariate-aware dependence diagnostics before expensive model search.

Project description

Forecastability Triage Toolkit

Forecastability triage for time series using AMI, pAMI, and covariate-aware dependence diagnostics before expensive model search.

CI PyPI Downloads PyPI version Version Docs Python 3.11-3.12 Research base License

Why this package

Forecastability triage for time series using AMI, pAMI, and covariate-aware dependence diagnostics before expensive model search.

Install

pip install dependence-forecastability

Optional runtime extras:

pip install "dependence-forecastability[transport]"
pip install "dependence-forecastability[agent]"

Quickstart

Run one deterministic univariate triage call through the top-level facade:

from forecastability import TriageRequest, generate_ar1, run_triage

series = generate_ar1(n_samples=300, phi=0.8, random_state=42)
result = run_triage(
    TriageRequest(
        series=series,
        goal="univariate",
        max_lag=20,
        n_surrogates=99,
        random_state=42,
    )
)

summary = {
    "blocked": result.blocked,
    "readiness_status": result.readiness.status.value,
    "compute_surrogates": None if result.method_plan is None else result.method_plan.compute_surrogates,
    "forecastability_class": None if result.interpretation is None else result.interpretation.forecastability_class,
    "primary_lags": [] if result.interpretation is None else list(result.interpretation.primary_lags),
}
print(summary)

Equivalent minimal files:

Start here

Canonical walkthrough

The canonical notebook is notebooks/walkthroughs/00_air_passengers_showcase.ipynb.

V0.3.1 fingerprint showcase

The v0.3.1 fingerprint surface is intentionally univariate-first and AMI-first. It packages AMI information geometry, the compact four-field fingerprint, deterministic family routing, and a strict agent-layer explanation that stays downstream of the deterministic outputs.

Run the canonical showcase:

MPLBACKEND=Agg uv run scripts/run_showcase_fingerprint.py --smoke

Minimal Python entry:

from forecastability import generate_fingerprint_archetypes, run_forecastability_fingerprint

series = generate_fingerprint_archetypes(n=320, seed=42)["seasonal_periodic"]
bundle = run_forecastability_fingerprint(
    series,
    target_name="seasonal_periodic",
    max_lag=24,
    n_surrogates=99,
    random_state=42,
)
print(bundle.recommendation.primary_families)

Batch CSV entry:

uv run python scripts/run_ami_information_geometry_csv.py \
  --input-csv outputs/examples/ami_geometry_csv/inputs/synthetic_fingerprint_panel.csv \
  --output-root outputs/ami_geometry_csv_script \
  --max-lag 24 \
  --n-surrogates 99 \
  --random-state 42

Primary fingerprint surfaces:

When to use it

Use this package when you need a deterministic pre-modeling screen to decide whether a series has exploitable structure before expensive model search.

Links

[!NOTE] run_covariant_analysis() supports six methods: cross_ami, cross_pami, te, gcmi, pcmci, and pcmci_ami. The two PCMCI methods are optional and skip gracefully when the causal extra is unavailable.

Install optional causal dependencies only if you need PCMCI methods:

pip install "dependence-forecastability[causal]"

Transport and runtime entry points:

Surface Entry point Stability
Python facade forecastability, forecastability.triage Stable
CLI forecastability Beta
HTTP API forecastability.adapters.api:app Beta
Dashboard forecastability-dashboard Beta
MCP server adapter surface Experimental
Agent narration adapter surface Experimental

Repository Workflow

If you are working in the repository rather than installing the package, start here:

uv sync

Canonical maintainer scripts:

Script Role
scripts/run_canonical_triage.py Canonical single-series workflow
scripts/run_benchmark_panel.py Benchmark-panel workflow
scripts/build_report_artifacts.py Report artifact builder

Secondary utilities:

  • scripts/download_data.py
  • scripts/run_exog_analysis.py
  • scripts/check_notebook_contract.py
  • scripts/rebuild_benchmark_fixture_artifacts.py
  • scripts/rebuild_diagnostic_regression_fixtures.py

Current config status:

Config Current role
configs/benchmark_panel.yaml Active benchmark-panel configuration
configs/canonical_examples.yaml Descriptive reference for canonical examples, not the root runner's only source of truth
configs/interpretation_rules.yaml Reference thresholds for interpretation policy
configs/benchmark_exog_panel.yaml Secondary exogenous benchmark workflow
configs/exogenous_screening_workbench.yaml Secondary workbench configuration
configs/robustness_study.yaml Secondary robustness-study workflow

Notebook Path And Artifact Surfaces

Canonical notebook:

Follow-on notebooks:

  • notebooks/walkthroughs/01 through 04
  • notebooks/triage/01 through 06 for deep dives

Main checked-in artifact surfaces:

  • outputs/json/canonical_examples_summary.json and related canonical JSON outputs
  • outputs/tables/*.csv
  • outputs/reports/*.md

[!NOTE] Checked-in artifacts are reference outputs. They are useful examples of the output surface, but they should not be treated as guaranteed-fresh build products for the current working tree.

Statistical Notes

  • AMI is computed per horizon rather than aggregated before computation.
  • pAMI is a project extension and a linear-residual approximation, not exact conditional mutual information.
  • Surrogate significance uses phase-randomized FFT surrogates with at least 99 surrogates and two-sided 95% bands.
  • “Significance skipped” and “no significant lags” are different outcomes. Use compute_surrogates or the route choice to tell them apart.
  • In rolling-origin workflows, diagnostics are computed on the training window only.
  • Phase surrogates can be conservative for strongly periodic series.

Documentation Map

Need Start here
Documentation index by role docs/README.md
Stable imports and runtime entry points docs/public_api.md
Live module layout docs/code/module_map.md
HTTP API contract docs/api_contract.md
Notebook path docs/notebooks/README.md
Contributor workflow docs/maintenance/developer_guide.md

For the repository-wide docs map, see docs/README.md.

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

dependence_forecastability-0.3.1.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

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

dependence_forecastability-0.3.1-py3-none-any.whl (283.8 kB view details)

Uploaded Python 3

File details

Details for the file dependence_forecastability-0.3.1.tar.gz.

File metadata

File hashes

Hashes for dependence_forecastability-0.3.1.tar.gz
Algorithm Hash digest
SHA256 ced94fc7aa64aa0de391176554eb90514fbceb1d3c2828f48a36342a0ea570b5
MD5 a61d2cb10c0e2d2c6c9c8acf240ade7d
BLAKE2b-256 cc198ee0162e1f9744dc31ba2fdcb6eceb9e60060e4a36883515cff4c157cf95

See more details on using hashes here.

Provenance

The following attestation bundles were made for dependence_forecastability-0.3.1.tar.gz:

Publisher: publish-pypi.yml on AdamKrysztopa/dependence-forecastability

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dependence_forecastability-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for dependence_forecastability-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 450b4a302dac3ee9ae3c89e2861cc154597104f060e9d71e91d5930d119d9716
MD5 6a6b80fd837e393d570d9eca521fc2e0
BLAKE2b-256 97d83bd781abb72f9ba8578b12918bfba5a5802008cc1a3b0c8828f8860dc365

See more details on using hashes here.

Provenance

The following attestation bundles were made for dependence_forecastability-0.3.1-py3-none-any.whl:

Publisher: publish-pypi.yml on AdamKrysztopa/dependence-forecastability

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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