Skip to content

feat(conformal): add adaptive conformal methods and finite-sample correction #89

Open

Description

@AzulGarza

today ConformalIntervals (foundationforecast/core/conformal.py) has two methods: conformal_error (quantiles of absolute calibration errors per horizon step) and conformal_distribution (point forecast ± an empirical distribution of calibration errors). both use a fixed set of n_windows and no finite-sample correction; we kept the first release simple.

ask: add as new method values (or a follow-up class if the state doesn't fit):

  1. finite-sample corrected quantile level, ceil((n + 1) * level) / n, so coverage holds with few windows (usually n_windows is small).
  2. adaptive conformal (ACI, Gibbs & Candès 2021): update the miscoverage level online so coverage tracks drift.

open: how to carry the adaptive state across forecast calls, since the api is stateless today.

tests: extend the parametrized tests/models/test_models.py so every model runs the new methods. docs: describe each method, plus an empirical coverage check (e.g. rolling-origin on m4 hourly) so we back the claims.

Activity

  1. viventriglia commented on Nov 19, 2026

    @viventriglia
    Contributor

    Hi @AzulGarza! Now that #92 is merged and PID / ConformalMethod are available, I’d like to clarify the intended scope for the remaining ACI work in #89.

    I see two possible approaches:

    1. Stateless replay, following PID’s current design: Add ACI(ConformalMethod) and reconstruct the adaptive miscoverage state from the chronological calibration windows on each forecast() call. Track alpha separately per series, horizon step and requested level, respecting feedback availability when step_size < h. This would fit the existing ConformalIntervals(method=...) API.
    2. A persistent online session: Introduce an explicit object that retains adaptive state and pending forecasts across calls, with an update(observations) operation when actuals arrive. This would also require defining reset/serialization behavior and handling delayed or duplicate observations.

    My preference would be to start with replay-based ACI, consistent with PID, and document clearly that restarting calibration on each call does not preserve a continuous ACI trajectory or automatically inherit its long-run coverage guarantee.

  2. AzulGarza commented on Nov 19, 2026

    @AzulGarza
    MemberAuthor

    hey @viventriglia! agreed, 1 is more coherent with the design we already have for PID. yeah, i see the limitation of not having the long-run coverage guarantee, but getting it would take more work and more design, as you mentioned. let's do 1. let me know how we can help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions