Nixtla / statsforecast

Lightning ⚡️ fast forecasting with statistical and econometric models.
https://nixtlaverse.nixtla.io/statsforecast
Apache License 2.0
3.87k stars 269 forks source link

Re-use parameters found by AutoARIMA #287

Closed DonLeif closed 1 year ago

DonLeif commented 1 year ago

I want to forward validate several auto AutoARIMA models wrapped in a StatsForecast object (multiple time series).

Is there a way to freeze once found optimal auto arima parameters to re use them (I think it's fair to assume they are relatively stable)?

I could not find such option and think it would be useful for resource-efficient repeated forecasts.

Thanks!

cwwang1128 commented 1 year ago

I just found a way to do this.

Try this:

from statsforecast import arima results2=arima.auto_arima_f(train.values,start_p=6,seasonal=True, start_q=5,max_p=10, max_q=10,max_order=20, period=24,allowdrift=False) #SARIMA model print(arima.ARIMASummary(results2))

You can use this code to get the autoarima parameters, and then apply other packages, such as statsmodel, to rebuild your model.

But it wasn't efficient. I'm still wondering if there is a better way to make it.