[ENH] Add prediction intervals to ARIMA iterative_forecast (#3100)
[ENH] Add prediction intervals to ARIMA iterative_forecast (#3100)
Reference Issues/PRs
- Fixes #3100.
What does this implement/fix?
This PR adds optional prediction interval support to the ARIMA.iterative_forecast method in aeon.forecasting.stats._arima.
Key features:
- Adds a new optional parameter:
alpha(default: None) - Backward compatible:
- If
alpha=None→ returns the samenp.ndarrayas before. - If
alphais provided → returns apandas.DataFramewith columns:"mean"- point forecasts"lower"- lower prediction interval"upper"- upper prediction interval
- If
- Prediction intervals are computed using:
- Empirical residual standard deviation
- Normal quantiles via
scipy.stats.norm.ppf - Standard error scaling with
sqrt(horizon)
Additional updates:
AutoARIMA.iterative_forecastnow forwards thealphaargument to the wrapped ARIMA model.- Added new unit tests covering prediction intervals.
- All existing tests pass with no modification.
This enhancement provides users with basic forecast uncertainty estimates while keeping the ARIMA implementation lightweight and backward compatible.
Does this contribution introduce a new dependency?
No.
Uses existing NumPy, SciPy, and pandas packages already in the project.
Any other comments?
- All pre-commit hooks pass (
ruff,flake8,isort,black, etc.). - Tests pass locally, including new interval tests.
- Changes are intentionally minimal to avoid regressions.
PR checklist
For all contributions
- [ ] I've added myself to the list of contributors (after merge).
- [x] The PR title starts with
[ENH].
For new estimators/functions
- [ ] Not applicable - this PR modifies an existing estimator.
For developers with write access
- [ ] Not applicable.
Thank you for contributing to aeon
I have added the following labels to this PR based on the title: [ enhancement ]. I have added the following labels to this PR based on the changes made: [ forecasting ]. Feel free to change these if they do not properly represent the PR.
The Checks tab will show the status of our automated tests. You can click on individual test runs in the tab or "Details" in the panel below to see more information if there is a failure.
If our pre-commit code quality check fails, any trivial fixes will automatically be pushed to your PR unless it is a draft.
Don't hesitate to ask questions on the aeon Slack channel if you have any.
PR CI actions
These checkboxes will add labels to enable/disable CI functionality for this PR. This may not take effect immediately, and a new commit may be required to run the new configuration.
- [ ] Run
pre-commitchecks for all files - [ ] Run
mypytypecheck tests - [ ] Run all
pytesttests and configurations - [ ] Run all notebook example tests
- [ ] Run numba-disabled
codecovtests - [ ] Stop automatic
pre-commitfixes (always disabled for drafts) - [ ] Disable numba cache loading
- [ ] Regenerate expected results for testing
- [ ] Push an empty commit to re-run CI checks
Hi, a fix for this has been merged.