statsforecast icon indicating copy to clipboard operation
statsforecast copied to clipboard

[AutoARIMA] when using AutoARIMA on a constant time series the forecast fitted values are zero no matter the constant.

Open omriKramer opened this issue 1 year ago • 1 comments

What happened + What you expected to happen

When fitting AutoARIMA to a constant series the forecast fitted values will be zeros even though the out of sample forecast will be correct.

Versions / Dependencies

library: 1.7.5 Python: 3.12.4 OS: macOS 14.5

Reproduction script

from statsforecast import StatsForecast from statsforecast.models import AutoARIMA import pandas as pd import numpy as np

size = 100 df = pd.DataFrame({'unique_id': 0, 'ds': range(size), 'y': np.full(size, 7)})

sf = StatsForecast(models=[AutoARIMA()], freq=1) fcst = sf.forecast(1, df, fitted=True) print(fcst) print()

fitted = sf.forecast_fitted_values() print(fitted)

Issue Severity

Low: It annoys or frustrates me.

omriKramer avatar Jul 04 '24 23:07 omriKramer

Hi @omriKramer , I just checked the code, with Nixtla version 2.0.1 it does not happen. The forecast is 7 in this case.

guilhermesilva07113 avatar Aug 11 '25 17:08 guilhermesilva07113