2

I am trying to apply vector autoregression to my data using statsmodels package. This package has a lot of tools for univariate time-series modeling, including statsmodels.tsa.ar_model.AutoReg() method that accepts a list of custom lags. For a vector autoregression, the function statsmodels.tsa.vector_ar.var_model.VAR only supports integer for a lag, in which case all of the lags until the specified integer are included.

In my problem I want to use lags at 1,2,3,24,48,72. The motivation behind this is that my data has a very strong daily trend, so I want to have 24, 48, and 72 hours lag. At the same time, I don't want to include all of the lags until 72, as this will be a really heavy and potentially over-parametrized model.

I do realize that VAR accepts exogeneous variables, and I can provide 23 seasonal dummies that will indicate each hour. However, I would like to take advantage of both seasonal dummies, and autoregression.

Does anyone know how to make VAR work with a list of custom lags? Is this possible with R (never worked with R before)?

EDIT: Found VARIMAX function that accepts order parameter. However, the order parameter for AR part has to be integer, so I still cannot use custom lags.

Mikhail Genkin
  • 3,247
  • 4
  • 27
  • 47

0 Answers0