Repository navigation
Description
Describe the bug
I developed a VARX (1) Model with 7 endogenous and 15 exogenous Variables. When I create the summary() of the "fit" the results of the equations aren't complete. I only see the constant and first 7 exogenous Variables. The Lags of the other endogenous Variables are completely missing. Furthermore the exogenous Variables don't have their proper names. It only says "exog0, exog1, ...".
results.params() shows all the coefficients correctly. But the names of the exogenous variables are also generic.
Code Sample, a copy-pastable example if possible
model = VAR(df_endog_train, exog=df_exog_train)
result = model.fit(1)
result.summary()
Output:
Summary of Regression Results
Model: VAR
Method: OLS
Date: Fri, 18, Oct, 2019
Time: 11:35:59
No. of Equations: 7.00000 BIC: -32.1637
Nobs: 51.0000 HQIC: -35.9318
Log likelihood: 630.126 FPE: 3.93928e-17
AIC: -38.2622 Det(Omega_mle): 2.90928e-18
Results for equation NTZ_AUT1
coefficient std. error t-stat prob
const 0.543775 0.185069 2.938 0.003
exog0 -0.176918 0.032237 -5.488 0.000
exog1 -0.275946 0.081418 -3.389 0.001
exog2 0.778170 0.168673 4.613 0.000
exog3 0.000004 0.000002 2.180 0.029
exog4 0.000006 0.000003 1.918 0.055
exog5 0.000004 0.000010 0.416 0.678
exog6 0.000012 0.000005 2.452 0.014
If the issue has not been resolved, please file it in the issue tracker.
Expected Output
I expect that the results of every equation show every coefficient.
Activity
bashtage commentedon Oct 18, 2019
This doesn't work the way you think. fit(maxlag) check lags 0, 1,2,...maxlag, and then selects the best lag length by minimizing an information criteria. Your model is selecting a lag 0. You can set ic=None to ignore the IC search and just fit the model you ask.
https://www.statsmodels.org/dev/generated/generated/statsmodels.tsa.vector_ar.var_model.VAR.fit.html#statsmodels.tsa.vector_ar.var_model.VAR.fit
This is an early choice in statsmodels and is probably classified as a mis-feature since it is not consistent with most of statsmodels.
hodor92 commentedon Oct 18, 2019
Oh thats good to know! But why does my result.params() Look like this:

And even if it selected 0 lags, why does the summary not show all exogenous variables?
bashtage commentedon Oct 18, 2019
You get a model parameter for each of the variables in your VAR. You have a constant 1 exog variables, and 1 lag of each of the 5 variables.
No idea what is going on with the lag 0 report. Could be buggy. Are you sure you don't see all exog with 0 lags?
bashtage commentedon Oct 18, 2019
Could be a bug in VAR summary.
hodor92 commentedon Oct 18, 2019
Sorry for the late answer.
I'm a beginner an I don't know if I understand everything correctly.

Doesn't this mean that I created a VARX (1) model?`
And this is a snippet of the Summary I get:

So there are only 6 out of 15 exogenous and none of the endogenous Variables. And is it normal that the exogenous are called "exog0" and so on? In my source dataframe they have different names.
bashtage commentedon Nov 27, 2019
Confirmed bug. Use res.params or res.tstats until the next release.
BUG: Correct VAR sumary when model contains exog variables
BUG: Correct VAR sumary when model contains exog variables
georgejosephada commentedon Aug 15, 2020
same issue with MNLogit