简体   繁体   中英

ARIMA/Holt Winters for multiple Time Series

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.

在此处输入图片说明

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

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))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM