I seem to be experiencing an issue with the summary() display from the
VAR class. When I create an class instance:
#Gets hands dirty with VAR class
import numpy as np
import scikits.statsmodels.api as sm
import matplotlib.pyplot as plt
from scikits.statsmodels.tsa.api import VAR
mdata = sm.datasets.macrodata.load().data
mdata = mdata[['realgdp','realcons','realinv']]
names = mdata.dtype.names
data = mdata.view((float,3))
data = np.diff(np.log(data), axis=0)
mymodel = VAR(data,names=names)
res = mymodel.fit(maxlags=8,ic=None)
print res.summary()
Produces the following output:
Summary of Regression Results
==================================
Model: VAR
Method: OLS
Date: Tue, 10, May, 2011
Time: 15:35:20
--------------------------------------------------------------------
No. of Equations: 3.00000 BIC: -27.4257
Nobs: 199.000 HQIC: -27.7212
Log likelihood: 1961.15 FPE: 7.47593e-13
AIC: -27.9222 Det(Omega_mle): 6.45336e-13
--------------------------------------------------------------------
Results for equation realgdp
==============================================================================
coefficient std. error t-stat prob
------------------------------------------------------------------------------
const 0.001281 0.001295 0.989 0.324
L1.realgdp -0.286148 0.171582 -1.668 0.097
L1.realcons 0.673869 0.132245 5.096 0.000
L1.realinv 0.030578 0.026428 1.157 0.249
L2.realgdp 0.025691 0.174478 0.147 0.883
L2.realcons 0.295441 0.147990 1.996 0.047
L2.realinv -0.014443 0.026963 -0.536 0.593
L3.realgdp -0.180031 0.174857 -1.030 0.305
L3.realcons 0.183702 0.148048 1.241 0.216
==============================================================================
Results for equation realcons
==============================================================================
coefficient std. error t-stat prob
------------------------------------------------------------------------------
const 0.012632 0.026449 0.478 0.633
L1.realgdp 0.004837 0.001094 4.420 0.000
L1.realcons -0.127156 0.144955 -0.877 0.381
L1.realinv 0.256394 0.111722 2.295 0.023
L2.realgdp 0.024043 0.022326 1.077 0.283
L2.realcons -0.086634 0.147402 -0.588 0.557
L2.realinv 0.205707 0.125024 1.645 0.102
L3.realgdp 0.003846 0.022779 0.169 0.866
L3.realcons -0.359067 0.147722 -2.431 0.016
==============================================================================
Results for equation realinv
==============================================================================
coefficient std. error t-stat prob
------------------------------------------------------------------------------
const 0.418452 0.125073 3.346 0.001
L1.realgdp 0.041906 0.022345 1.875 0.062
L1.realcons -0.020597 0.006812 -3.024 0.003
L1.realinv -1.862537 0.902338 -2.064 0.040
L2.realgdp 4.403374 0.695465 6.332 0.000
L2.realcons 0.223717 0.138981 1.610 0.109
L2.realinv 0.331425 0.917568 0.361 0.718
L3.realgdp 0.878198 0.778270 1.128 0.261
L3.realcons -0.096555 0.141797 -0.681 0.497
==============================================================================
Correlation matrix of residuals
realgdp realcons realinv
realgdp 1.000000 0.599898 0.759619
realcons 0.599898 1.000000 0.142964
realinv 0.759619 0.142964 1.000000
Notice that there is no coefficient for the third lag of 'realinv'.
This happens no matter the lag length specfied.
Bart
> Notice that there is no coefficient for the third lag of 'realinv'.
> This happens no matter the lag length specfied.
>
Good catch. This was my fault. I changed the variable definitions to
be consistent (trendorder = order of trend polynomial, k_trend =
actual number of columns used in the trend; note to self, still need
to document this somewhere) and didn't change it in the summary
method.
Fixed in devel branch.
Skipper