1、 VAR 模型的应用举例1 案例分析的目的股市对居民储蓄存款存在分流的作用。一般来说,若股市出现牛市,资金会从存款性金融机构流向股市,居民储蓄存款下降或者增速会减缓。从当前我国经济发展趋势来看,居民储蓄存款与股市交易额均呈上升趋势。那么两者是否存在相互影响呢?本案例将分析居民储蓄与股市之间的这种联动效应。2 实验数据本实验选取从 1996 年到 2008 年 4 月的月度数据。整理如下。表 1 股市交易额与居民存款余额 单位:亿元日期沪深股市交易总额居民储蓄存款余额日期 沪深股市交 易总额 居民储蓄存 款余额1996.1 143.4932 30356.54 2002.4 3114.392 79
2、728.21996.2 63.94164 32026.25 2002.5 1924.594 80394.31996.3 217.756 33296.48 2002.6 4303.076 81711.791996.4 873.4221 34018.53 2002.7 3227.305 82527.91996.5 1163.74 34622.1 2002.8 1946.366 83275.971996.6 1812.862 35457.91 2002.9 1460.391 84139.051996.7 2718.62 36048.67 2002.10 1181.989 84725.131996.8
3、 1685.591 36705.8 2002.11 1908.617 85693.491996.9 1862.164 37085.17 2002.12 1781.228 86910.651996.10 4012.4 37671.42 2003.1 3060.933 90677.631996.11 3818.97 37917.26 2003.2 1666.802 92824.211996.12 4238.92 38520.8 2003.3 2120.637 94567.841997.1 1829.179 39038.18 2003.4 5848.297 95194.121997.2 1493.9
4、25 40869.12 2003.5 3209.45 96351.671997.3 4263.8 41580.97 2003.6 2557.15 97674.571997.4 5127.92 42112.16 2003.7 2351.917 98590.91997.5 4640.96 42295.16 2003.8 1519.427 99255.581997.6 3080.95 42771.16 2003.9 1661.203 100888.61997.7 2415.73 43312.5 2003.10 1615.799 101381.91997.8 1858.378 43914.92 200
5、3.11 2824.502 102235.41997.9 1625.713 44139.45 2003.12 4359.423 103617.71997.10 2081.673 44720.33 2004.1 3649.76 109232.71997.11 1586.95 45068.43 2004.2 7215.755 110646.41997.12 1570.195 46279.8 2004.3 5792.181 111872.21998.1 1716.977 46483 2004.4 5270.107 112175.41998.2 1171.906 48537.54 2004.5 182
6、3.421 112610.21998.3 1703.312 48686.48 2004.6 2627.057 113792.51998.4 3624.44 48984.6 2004.7 2548.009 114253.21998.5 3322.3 49700 2004.8 1880.649 114489.61998.6 2593.3 49949.89 2004.9 3978.274 115458.71998.7 1761.805 50749.82 2004.10 2893.065 1160011998.8 1497.882 50900.91 2004.11 3045.002 117617.91
7、998.9 2149.008 51580.74 2004.12 2094.784 119555.41998.10 1861.79 52247.77 2005.1 1754.347 122237.31998.11 2194.24 52952.32 2005.2 2021.07 127823.41998.12 1040.058 53407.5 2005.3 3047.432 129259.41999.1 1138.819 54293.67 2005.4 3036.061 129816.81999.2 334.0196 56767.45 2005.5 1497.376 130577.41999.3
8、1757.277 57814.65 2005.6 3177.354 132339.11999.4 2063.445 58369.07 2005.7 2243.73 133656.41999.5 2719.59 58967.84 2005.8 4776.333 1345051999.6 9562.59 59173.48 2005.9 4132.053 136316.31999.7 5538.02 59147.55 2005.10 2097.632 136827.11999.8 3665.47 59187.26 2005.11 2301.058 138504.31999.9 2705.12 593
9、64.31 2005.12 2350.086 1410511999.10 1250.087 59269.9 2006.1 3635.936 148008.41999.11 1558.049 59185.38 2006.2 3726.141 151179.61999.12 1482.013 59621.8 2006.3 4074.625 1528192000.1 4443.458 60241.8 2006.4 7308.726 1534012000.2 6621.819 62270.3 2006.5 10926.12 153523.42000.3 8877.355 62492.29 2006.6
10、 9159.456 154996.92000.4 5960.926 62536.12 2006.7 8197.536 155131.92000.5 4298.71 62195.39 2006.8 5526.955 156282.12000.6 6251.177 62842.38 2006.9 6705.497 158108.92000.7 5436.686 62841.5 2006.10 6793.858 158033.42000.8 6650.387 62861.11 2006.11 10586.65 159716.72000.9 3167.359 63243.27 2006.12 1586
11、1.8 161587.32000.10 2706.931 63122.34 2007.1 26191.65 161968.62000.11 5235.818 63492.06 2007.2 17845.01 171042.62000.12 3985.79 64332.38 2007.3 32526.3 172607.72001.1 3161.016 66547.31 2007.4 49865.94 170932.72001.2 2055.591 67343.36 2007.5 59864.23 1680402001.3 5368.465 68365.13 2007.6 55444.85 169
12、651.62001.4 5845.646 68618.46 2007.7 33764.63 169567.22001.5 4752.8 68393.54 2007.8 55638.96 169171.52001.6 5190.086 69628.58 2007.9 47008.27 169038.12001.7 3344.074 69677.77 2007.10 35870.9 163957.62001.8 2677.711 70558.48 2007.11 25750.72 166561.12001.10 2147.892 71818.81 2007.12 29632.95 172616.1
13、2001.12 2193.071 73762.43 2008.1 47340.36 174347.92002.1 2072.056 74953.71 2008.2 21457.51 183960.22002.2 1341.433 78114.33 2008.3 29058.96 187414.92002.3 4917.915 78728.3 2008.4 27832.14 188389.14.3 VAR 模型的构建4.3.1 数据平稳性检验考虑到本例中的数据是宏观经济月度数据,先消除季节性特征后再进行分析。另外数据变动趋势过大,本例还对数据进行了对数平滑处理。下图是两个变量经过季节性调整并取对
14、数后的新序列,其中 lsa 表示居民储蓄额, ltr 表示股市交易总额。在主窗口命令行中输入:genr lsa=log(savingsa)genr ltr=log(tradingsa)24681012149697989001020304050607LSDLTA根据图形特征选取同时存在截距项和趋势项进行单位根检验。分别在 lsa 和 ltr 窗口中点击 view/unit root test/。Lsa 单位根检验的结果:Null Hypothesis: LSA has a unit rootExogenous: Constant, Linear TrendLag Length: 0 (Autom
15、atic based on SIC, MAXLAG=13)t-Statistic Prob.*Augmented Dickey-Fuller test statistic -3.295765 0.0711Test critical values: 1% level -4.0225865% level -3.44111110% level -3.145082*MacKinnon (1996) one-sided p-values.Ltr 单位根检验的结果:Null Hypothesis: LTR has a unit rootExogenous: Constant, Linear TrendLa
16、g Length: 0 (Automatic based on SIC, MAXLAG=13)图 1 居民储蓄额与股市交易额对数值的对比图t-Statistic Prob.*Augmented Dickey-Fuller test statistic -4.102597 0.0078Test critical values: 1% level -4.0225865% level -3.44111110% level -3.145082*MacKinnon (1996) one-sided p-values.从而 lsa 和 ltr 在 10的显著性水平上均是平稳序列。3.2 VAR 模型滞后阶
17、数的选择选取view/lag structure/lag length criteria。由于总共有146 个月度样本,选取最大的可能滞后阶数为12。不同判断标准下滞后阶数的选取:VAR Lag Order Selection CriteriaEndogenous variables: LSA LTR Exogenous variables: C Sample: 1 146Included observations: 134Lag LogL LR FPE AIC SC HQ0 -241.1002 NA 0.129071 3.628361 3.671612 3.6459361 325.2560
18、1107.353 2.92e-05* -4.765015* -4.635261* -4.712287*2 327.8788 5.049985 2.98e-05 -4.744460 -4.528203 -4.6565803 329.2750 2.646384 3.10e-05 -4.705596 -4.402837 -4.5825654 332.5300 6.072830 3.14e-05 -4.694478 -4.305215 -4.5362945 336.7587 7.763083 3.13e-05 -4.697891 -4.222126 -4.5045556 337.4164 1.1879
19、34 3.29e-05 -4.648007 -4.085739 -4.4195197 341.9924 8.127393 3.26e-05 -4.656603 -4.007832 -4.3929638 342.9109 1.603927 3.42e-05 -4.610610 -3.875337 -4.3118199 349.2137 10.81825* 3.31e-05 -4.644980 -3.823205 -4.31103710 349.8590 1.088389 3.48e-05 -4.594910 -3.686632 -4.22581611 353.2477 5.614172 3.52
20、e-05 -4.585787 -3.591006 -4.18154012 355.3351 3.395945 3.63e-05 -4.557241 -3.475958 -4.117842从以上分析结果可以看出,FPE、AIC 、SC 和 HQ 都得出滞后阶数为 1 时 VAR 模型时最优的。因此选取的最优滞后阶数为 1,即 k=1。3.3 VAR 模型的估计下表是滞后阶数为 1 时 VAR 模型的估计结果。VAR(1)的估计结果:Sample (adjusted): 2 146Included observations: 145 after adjustmentsStandard errors
21、 in ( ) & t-statistics in LSA LTRLSA(-1) 1.001170 0.228703(0.00255) (0.09860) 393.219 2.31943LTR(-1) -0.004083 0.808610(0.00119) (0.04622)-3.42147 17.4964C 0.032687 -0.987968(0.02389) (0.92510) 1.36837 -1.06795R-squared 0.999440 0.808826Adj. R-squared 0.999432 0.806134Sum sq. resids 0.020346 30.5150
22、1S.E. equation 0.011970 0.463567F-statistic 126697.4 300.3900Log likelihood 437.4447 -92.75374Akaike AIC -5.992341 1.320741Schwarz SC -5.930754 1.382329Mean dependent 11.31129 8.194037S.D. dependent 0.502269 1.052838Determinant resid covariance (dof adj.) 3.01E-05Determinant resid covariance 2.89E-0
23、5Log likelihood 346.2668Akaike information criterion -4.693335Schwarz criterion -4.570159从表中可以看出 VAR 模型的参数估计大多显著。3.4 VAR 模型的检验VAR 模型的检验包括 VAR 模型的平稳性检验,以及残差的独立性检验。选择 view/lag structure/AR roots table 或者 AR roots graph 可以得到平稳性检验的结果。Roots of Characteristic PolynomialEndogenous variables: LSA LTR Exogen
24、ous variables: C Lag specification: 1 1Root Modulus0.996192 0.9961920.813588 0.813588No root lies outside the unit circle.VAR satisfies the stability condition.-1.5-1.0-0.50.0.51.01.5-.-1.0-0.50. 0.51.01.5Invers Rots of AR Charcteristic Polynmial因此 VAR 模型满足平稳性的条件。选择 view/residual tests/correlograms,
25、得到各方程残差项的自相关图。-.3-.2-.1.0.1.2.312345678910Cor(LSA,(-i)-.3-.2-.1.0.1.2.312345678910Cor(LTR,(-i)utocrelations with 2Std.Er. Bunds所以残差不存在自相关性,满足独立性假设。3.5 VAR 模型的预测前文介绍,与 ARMA 模型不同,在 VAR 估计结果的窗口中没有直接预测的选项,此时需要建立 model 进行预测。命令:make model Assign all f上述命令表示建立模型进行预测,预测序列名称后缀名为 f。下图是动态预测结果。24681012142550751
26、0125LSALSA (Baselin)TRTR (li)4 VAR 模型的应用4.1 格兰杰因果检验将 lsa 与 ltr 建立 group,点击 view/granger causality。根据 VAR 模型的滞后阶数来决定滞后阶数,本例中选择滞后阶数为 1。Pairwise Granger Causality TestsSample: 1 146Lags: 1Null Hypothesis: Obs F-Statistic Prob. LTR does not Granger Cause LSA 145 11.7064 0.0008LSA does not Granger Cause
27、LTR 5.37978 0.0218从中可以看出,ltr 与 lsa 之间互为格兰杰原因。这说明居民储蓄与股票交易变动之间相互影响。4.2 脉冲响应脉冲响应函数受到变量顺序的影响,因此其结果与分析的的主观因素有关。在 VAR 模型输出窗口中,选择 view/impulse response-.02-.01.0.01.025101520253035Respone ofLSA toLSA-.02-.01.0.01.025101520253035Respone ofLSA toLTR-.2.0.2.4.65101520253035Respone ofLTR toLSA-.2.0.2.4.651015
28、20253035Respone ofLTR toLTRRspne tCholesky One S.D Inovati 2 .E观察第二个图形,股市交易量对居民储蓄是负向影响关系,这验证了股市的分流效应。从时间长短来看,股市交易对居民储蓄的长期影响要大于短期影响,而居民储蓄对股市交易的短期影响要显著些。4.3 方差分解在 VAR 输出窗口中,选择 view/variance decompositionVariance Decomposition of LSA:Period S.E. LSA LTR1 0.011970 100.0000 0.0000002 0.017238 98.82020 1.
29、1797953 0.021555 96.77410 3.2259024 0.025422 94.38567 5.6143345 0.029009 91.95391 8.0460906 0.032386 89.63370 10.366307 0.035591 87.49525 12.504758 0.038644 85.56194 14.438069 0.041559 83.83266 16.1673410 0.044348 82.29449 17.7055111 0.047020 80.92963 19.0703712 0.049581 79.71909 20.2809113 0.052040
30、 78.64447 21.3555314 0.054404 77.68891 22.3110915 0.056677 76.83729 23.1627116 0.058867 76.07633 23.9236717 0.060979 75.39447 24.6055318 0.063018 74.78169 25.2183119 0.064987 74.22934 25.7706620 0.066893 73.72997 26.2700321 0.068738 73.27715 26.7228522 0.070526 72.86532 27.1346823 0.072261 72.48970
31、27.5103024 0.073946 72.14614 27.8538625 0.075583 71.83105 28.1689526 0.077175 71.54130 28.4587027 0.078725 71.27418 28.7258228 0.080235 71.02731 28.9726929 0.081707 70.79862 29.2013830 0.083142 70.58628 29.4137231 0.084544 70.38870 29.6113032 0.085912 70.20446 29.7955433 0.087250 70.03232 29.9676834
32、 0.088557 69.87117 30.1288335 0.089836 69.72003 30.2799736 0.091088 69.57804 30.42196Variance Decomposition of LTR:Period S.E. LSA LTR1 0.463567 2.150008 97.849992 0.595911 2.069152 97.930853 0.668060 1.994640 98.005364 0.710903 1.928151 98.071855 0.737206 1.870888 98.129116 0.753584 1.823541 98.176
33、467 0.763826 1.786309 98.213698 0.770220 1.758971 98.241039 0.774190 1.740977 98.2590210 0.776635 1.731557 98.2684411 0.778125 1.729813 98.2701912 0.779025 1.734800 98.2652013 0.779568 1.745586 98.2544114 0.779901 1.761289 98.2387115 0.780114 1.781109 98.2188916 0.780266 1.804331 98.1956717 0.780390
34、 1.830333 98.1696718 0.780506 1.858581 98.1414219 0.780625 1.888624 98.1113820 0.780754 1.920080 98.0799221 0.780894 1.952636 98.0473622 0.781045 1.986028 98.0139723 0.781208 2.020043 97.9799624 0.781381 2.054505 97.9455025 0.781562 2.089270 97.9107326 0.781751 2.124222 97.8757827 0.781945 2.159267
35、97.8407328 0.782144 2.194327 97.8056729 0.782346 2.229344 97.7706630 0.782552 2.264266 97.7357331 0.782759 2.299055 97.7009532 0.782967 2.333679 97.6663233 0.783176 2.368113 97.6318934 0.783386 2.402339 97.5976635 0.783595 2.436341 97.5636636 0.783804 2.470106 97.52989Cholesky Ordering: LSA LTR从方差分解的结果来看,居民储蓄波动的部分原因源自于股市交易量的变动,而股市交易量的变动更多是源于自身的影响。这与脉冲响应的结果一致。