aeon icon indicating copy to clipboard operation
aeon copied to clipboard

[ENH] Make fit in ARIMA iterative_forecast optional

Open JoaquinAmatRodrigo opened this issue 2 months ago • 2 comments

Describe the feature or idea you want to propose

Hi,

First, thank you for the great work on implementing a Python-native and efficient version of ARIMA.

The current implementation of aeon.forecasting.stats.ARIMA.iterative_forecast includes fitting the forecaster as its first step:

https://github.com/aeon-toolkit/aeon/blob/c80baf772dcf0e60aaaae87c27d1befdef90a7b4/aeon/forecasting/stats/_arima.py#L210

If the ARIMA model has already been fitted, this additional fit step is unnecessary. All the required information for subsequent predictions is already stored in the fitted model.

An option to skip this initial fit will speed up the iterative forecast when the model is already fitted.

Describe your proposed solution

A possible solution would be to include an optional argument (e.g., fit=True) in iterative_forecast.

  • If fit=True, the method behaves as it currently does.
  • If fit=False, the method skips the redundant fitting step and uses the already-fitted model directly.
def iterative_forecast(self, y, prediction_horizon, fit=True):
    if fit:
        self.fit(y)

Describe alternatives you've considered, if relevant

No response

Additional context

No response

JoaquinAmatRodrigo avatar Sep 26 '25 13:09 JoaquinAmatRodrigo

thanks @JoaquinAmatRodrigo we will discuss it. On the one hand I want to minimise parameters, on the other, it seems sensible!

TonyBagnall avatar Sep 28 '25 09:09 TonyBagnall

Hi! @TonyBagnall @JoaquinAmatRodrigo @MatthewMiddlehurst I'd like to work on this issue.

My plan is:

  • Add an optional fit parameter to iterative_forecast (defaulting to True to preserve current behaviour).
  • When fit=False, skip the internal self.fit(y) call and use the already-fitted model for forecasting.
  • Add tests to ensure:
    • Behaviour remains unchanged when fit=True
    • Forecasting works correctly without refitting when fit=False
    • The method raises a meaningful error if fit=False is used before the model has been fitted.

Please let me know if this approach aligns with what you have in mind!

satwiksps avatar Nov 16 '25 08:11 satwiksps