Skip to content

VARResults.summary doesn't show all Variables #6203

Closed

Description

@hodor92

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

  1. bashtage commented on Oct 18, 2019

    @bashtage
    Member

    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.

  2. hodor92 commented on Oct 18, 2019

    @hodor92
    Author

    Oh thats good to know! But why does my result.params() Look like this:
    result_params

    And even if it selected 0 lags, why does the summary not show all exogenous variables?

  3. bashtage commented on Oct 18, 2019

    @bashtage
    Member

    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?

  4. bashtage commented on Oct 18, 2019

    @bashtage
    Member

    Could be a bug in VAR summary.

  5. hodor92 commented on Oct 18, 2019

    @hodor92
    Author

    Sorry for the late answer.

    I'm a beginner an I don't know if I understand everything correctly.
    grafik

    Doesn't this mean that I created a VARX (1) model?`

    And this is a snippet of the Summary I get:
    grafik

    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.

  6. added this to the 0.11 milestone on Nov 27, 2019
  7. bashtage commented on Nov 27, 2019

    @bashtage
    Member

    Confirmed bug. Use res.params or res.tstats until the next release.

  8. added 2 commits that reference this issue on Nov 27, 2019
    22e6161
    7473eee
  9. georgejosephada commented on Aug 15, 2020

    @georgejosephada

    same issue with MNLogit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions