Skip to main content

Conformal recalibration audit for tail quantile forecasters

Project description

conformal-oracle

Conformal recalibration audit for tail quantile forecasters.

Given any black-box probabilistic forecaster and a return series, conformal-oracle computes a one-parameter conformal correction (static or rolling), classifies the forecaster as signal-preserving or replacement, and reports a full backtest panel.

Implements the methodology from:

Pele, D.T., Bolovăneanu, V., Ginavar, A.T., Lessmann, S., Härdle, W.K. "Recalibrating Tail Event Forecasts under Temporal Dependence" (2026).

Install

pip install conformal-oracle

For TSFM wrappers:

pip install conformal-oracle[chronos]    # Chronos
pip install conformal-oracle[lag_llama]  # Lag-Llama
pip install conformal-oracle[tsfm_all]   # all four TSFMs

For development:

git clone https://github.com/QuantLet/Conformal_Oracle.git
cd Conformal_Oracle/python
pip install -e ".[dev]"

Quickstart — static audit

import pandas as pd
from conformal_oracle import audit_static
from conformal_oracle.forecasters import GJRGARCHForecaster

returns = pd.read_csv("returns.csv", index_col=0, parse_dates=True).squeeze()
result = audit_static(returns, GJRGARCHForecaster(), alpha=0.01)
print(result.summary())

Quickstart — rolling audit

from conformal_oracle import audit_rolling
from conformal_oracle.forecasters import GJRGARCHForecaster

result = audit_rolling(returns, GJRGARCHForecaster(), alpha=0.01, window=250)
print(result.summary())

Quickstart — benchmark comparison

from conformal_oracle import audit_with_benchmarks

comp = audit_with_benchmarks(returns, my_forecaster, benchmarks=["gjr_garch", "hist_sim"])
print(comp.comparison_table())
print(comp.diebold_mariano(baseline="gjr_garch"))
print(comp.comparison_table_latex())

Custom forecaster

Any object implementing fit(returns) and forecast(returns, t) works:

from conformal_oracle._types import SampleDistribution

class MyForecaster:
    def fit(self, returns): pass
    def forecast(self, returns, t):
        hist = returns.iloc[max(0, t-250):t]
        return SampleDistribution(samples=hist.values)

result = audit_static(returns, MyForecaster(), alpha=0.01)

See examples/04_custom_forecaster.py for a full example.

Worked examples

Documentation

Requirements

Python 3.10+, numpy, pandas, scipy, statsmodels, arch, matplotlib.

License

MIT

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

conformal_oracle-0.2.2.tar.gz (39.3 kB view details)

Uploaded Source

Built Distribution

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

conformal_oracle-0.2.2-py3-none-any.whl (58.8 kB view details)

Uploaded Python 3

File details

Details for the file conformal_oracle-0.2.2.tar.gz.

File metadata

  • Download URL: conformal_oracle-0.2.2.tar.gz
  • Upload date:
  • Size: 39.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for conformal_oracle-0.2.2.tar.gz
Algorithm Hash digest
SHA256 e921e2b551314a9a8fa51ff1512a18165892d7c528c3580b182a20fced2c88f0
MD5 a4fb91e39770c608d9d8d2d7cb3bb538
BLAKE2b-256 84a7e5f3a56ce7380c96b814e6603f4a07d70dc875711a3d42877537c70712f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for conformal_oracle-0.2.2.tar.gz:

Publisher: release.yml on danpele/Conformal_Oracle

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

File details

Details for the file conformal_oracle-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for conformal_oracle-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 35840796ca8b1b10591107b30a104dede7ff6c067281aa069cd307ed9141c643
MD5 784e18b9262e3c122bb56663fa40efb9
BLAKE2b-256 e9e35540a6bb6830c4f935c18caffbbdc487e0a8366866c041c383e95cd3d8b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for conformal_oracle-0.2.2-py3-none-any.whl:

Publisher: release.yml on danpele/Conformal_Oracle

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