ARIMA/Holt Winters for multiple Time Series

1.9k views Asked by At

Is there a way of running an ARIMA/Holt-Winters model in python that deals with multiple items (time series) at once?

I can run a single ARIMA/Holt-Winters model using the StatsModels package in Python, but not for multiple Time Series.

To clarify what I mean by multiple Time Series, see my dataset.

enter image description here

2

There are 2 answers

0
Nikhil G On

Try this

from statsmodels.tsa.vector_ar.var_model import VAR
import numpy as np
model = VAR(endog=np.asarray(train))
model_fit = model.fit()
prediction = model_fit.forecast(model_fit.y, steps=len(valid))
1
Majo_Jose On

ARIMA is one of the mostly used Models for time series forecasting but, It is suitable only for univariate time series analysis. In your dataset, there are four variables

  • X1
  • X2
  • X3
  • X4

So it is a multivariate time series.

For Handling, this kind of time series forecasting VECTOR AUTO REGRESSION is a good Choice. it is capable of handling any number of variable. Even though the computation is higher you will get a decent accuracy on the prediction.

you can easily import it from Stats_Model by the following import statement:

from statsmodels.tsa.vector_ar.var_model import VAR

VAR METHOD :

model = VAR(array_of_data)
  • where arry_of_data should be a list (each observation as a row)

Input Format of Data:

[[5737,5100,2899,7431.26],

[5779,5500,5600,5237.5],

[5782,3520,3620,6534.39]]

Before implementing it, carefully read all parameters for better result.

for more understanding read this