Skip to content

docs: document both ConformalSeasonalPool interval thresholds and validate n_samples - #1225

Open
Jorge Polanco (Jorge-Polanco-Roque) wants to merge 2 commits into
Nixtla:mainfrom
Jorge-Polanco-Roque:fix/csp-nsamples-thresholds
Open

Jorge Polanco (Jorge-Polanco-Roque) wants to merge 2 commits into
Nixtla:mainfrom
Jorge-Polanco-Roque:fix/csp-nsamples-thresholds

Conversation

@Jorge-Polanco-Roque

Copy link
Copy Markdown

Reference Issues/PRs

Fixes #1202 (items 1–3).

What does this implement/fix? Explain your changes.

Addresses the mechanical items from Shivam Lalakiya (@shivamlalakiya)'s detailed analysis in #1202:

  1. n_samples docstring: it documented only the lower-bound threshold and its 95% example was off by one. It now gives both thresholds — ceil(2/a) - 1 (lower bound) and ceil(4/a) - 1 (upper bound), with a = 1 - L/100 — and the worked example reads ≥39 / ≥79.
  2. predict_in_sample: added a note that its interval width depends on the calibration pool size R.size (set by calib_frac and the history length), not on n_samples.
  3. __init__: now rejects n_samples < 1 (0 produced a degenerate, zero-width interval); n_samples=1 stays allowed.

Item 4 (a runtime warnings.warn when the pool is below the threshold for a requested level) is a behaviour addition and is left to the maintainers' discretion, as the reporter noted.

Does your contribution introduce a new dependency? If yes, which one?

No.

Testing

Added test_invalid_n_samples_raises; verified it fails without the guard. ruff and the test_csp.py suite (23 tests) are green.

Thanks to Shivam Lalakiya (@shivamlalakiya) for the thorough analysis.

…idate n_samples

Addresses the mechanical items from Nixtla#1202:
- n_samples docstring now gives both the lower (ceil(2/a)-1) and upper
  (ceil(4/a)-1) thresholds and fixes the off-by-one 95% example.
- predict_in_sample notes its width depends on R.size / calib_frac, not n_samples.
- __init__ rejects n_samples < 1.

Thanks to @shivamlalakiya for the analysis. Fixes Nixtla#1202
@CLAassistant

CLAassistant commented Aug 30, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Jorge-Polanco-Roque

Copy link
Copy Markdown
Author

Gentle ping — this has been open ~a week. It documents both ConformalSeasonalPool interval thresholds and validates n_samples. Happy to adjust anything on review. Thanks!

This branch has not been deployed

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

Labels

None yet

Projects

None yet

2 participants