3

0

I'm using VAR model for multivariate time series. The structure is that although each variable is a linear function of past lags of itself and past lags of the other variables, **one and/or two** of the variables **MAY NOT** alter within the period under investigation. Out of 10 variables.

Below is a similar dataframe to the one I'm working on. The actual dataset has 190 rows.

```
x0 = [0,0,0,0,0]
x1 = [0.011866,0.013380,0.015357,0.024451,0.030889]
x2 = [0,2,2,3,3]
x3 = [1,1,2,3,3]
x4 = [0,0,0,0,0]
T = ['2000-01-01', '2000-01-02', '2000-01-03', '2000-01-04', '2000-01-05']
TDT = pd.to_datetime(T)
df = pd.DataFrame({'X0': x0, 'X1': x1, 'X2': x2, 'X3': x3, 'X4': x4})
df.index = TDT
df
model = VAR(df)
result = model.fit(1)
**ValueError: x already contains a constant**
```

Is there a way to fix this?

1Is this the

`VAR`

object from the`statsmodels`

package for python? Why are you passing`1`

to`fit()`

, because you only want 1 lag? – n1k31t4 – 2018-09-13T13:51:05.720Yes. Also with lag=2, I get the same result. – Abs – 2018-09-13T13:55:18.877