时间序列模型分析的各种stata命令 - 图文 下载本文

order1, dln_inc, dln_consump.01order2, dln_inc, dln_consump.0050-.00505100510step95% CIGraphs by irfname, impulse variable, and response variableorthogonalized irf 接下来我们用irf table命令用列表式将两种脉冲响应结果表示出来:

irf table oirf, irf(order1 order2) impulse(dln_inc) response(dln_consump)

Results from order1 order2

+--------------------------------------------------------------------------------+ | | (1) (1) (1) | (2) (2) (2) | | step | oirf Lower Upper | oirf Lower Upper | |--------+-----------------------------------+-----------------------------------| |0 | .005338 .003545 .00713 | .005338 .003545 .00713 | |1 | .001704 -.000385 .003792 | .001704 -.000385 .003792 | |2 | .003071 .000963 .005179 | .003071 .000963 .005179 | |3 | -.00023 -.001636 .001176 | -.00023 -.001636 .001176 | |4 | .000845 -.000402 .002092 | .000845 -.000402 .002092 | |5 | .000481 -.000227 .001189 | .000481 -.000227 .001189 | |6 | .000045 -.000539 .00063 | .000045 -.000539 .00063 | |7 | .000157 -.000187 .000502 | .000157 -.000187 .000502 | |8 | .000095 -.000148 .000338 | .000095 -.000148 .000338 | |9 | .000019 -.000142 .00018 | .000019 -.000142 .00018 | |10 | .000036 -.000065 .000136 | .000036 -.000065 .000136 | +--------------------------------------------------------------------------------+ 95% lower and upper bounds reported

(1) irfname = order1, impulse = dln_inc, and response = dln_consump (2) irfname = order2, impulse = dln_inc, and response = dln_consump

从图形和表格我们可以得到这两种产生脉冲响应的命令本质上是相同的。在这次脉冲响应过程中,给dln_inc一个增加的正交冲击将引起对dln_consump的一个短暂的持续增加直到第四五期。

接下来我们也可以来考察收入与消费的方差分解:

use http://www.stata-press.com/data/r11/lutkepohl2,clear var dlinvest dlincome dlconsumption,lag(1/2) dfk small

irf create order1, step(10) set(myirf1)

irf graph fevd, irf(order1) impulse(dlincome dlconsumption) response(dlconsumption)

irf graph fevd, irf(order1) impulse(dlincome dlconsumption) response(dlincome)

order1, dlconsumption, dlconsumption.8order1, dlincome, dlconsumption.6.4.2005100510step95% CIfraction of mse due to impulseGraphs by irfname, impulse variable, and response variable

order1, dlconsumption, dlincome1order1, dlincome, dlincome.5005100510step95% CIfraction of mse due to impulseGraphs by irfname, impulse variable, and response variable

对于 irf graph stat这画图命令,以及irf table stat列表式命令,其

中stat的选项有如下几种:

Stat 类型 oirf 正交IRF dm 动态乘子 cirf 累积IRF coirf 累积正交IRF cdm 累积动态乘子 sirf 结构IRF fevd Cholesky方差分解 sfevd 结构Cholisky方差分解

4.6 预测

VAR ˇ ˇ ˇ ˇ ˇ ˇ SVAR ˇ ˇ ˇ ˇ ˇ ˇ VEC ˇ ˇ ˇ ˇ

例子:

use http://www.stata-press.com/data/r11/lutkepohl2,clear varfcast compute

list dlinvestment dlinvestment_f dlinvestment_f_L /// dlinvestment_f_U dlinvestment_f_se in 91/93

*-- 样本内一步预测: dynamic()选项

use http://www.stata-press.com/data/r11/lutkepohl2,clear var dlinvest dlincome dlconsumption,lag(1/2) dfk small varfcast compute, dynamic(5)

list dlinvestment dlinvestment_f dlincome dlincome_f /// dlconsumption dlconsumption_f in 4/7

*-- 多步预测: dynamic()选项+step()选项

use http://www.stata-press.com/data/r11/lutkepohl2,clear var dlinvest dlincome dlconsumption,lag(1/2) dfk small varfcast compute, dynamic(85) step(10)

list dlinvestment dlinvestment_f dlincome dlincome_f /// dlconsumption dlconsumption_f in 83/95

4.7 结构型的VAR模型

前面讲的缩减型VAR模型只能描述各个内生变量的动态形成过程;着重的是内生变量的“跨期”相关性,并不考虑内生变量的“同期”相关性,因此无法呈现内生变量之间的“因果关系”。而且在脉冲响应函数和方差分解中是采用Choleski分解,硬性地规定上面所说的B矩阵对角线的上半部分为零。而采用结构型VAR模型(SVAR),则可以根据相关理论设定变量之间的因果关系,从标准型(也即缩减型)VAR方程得到的残差分解出各个内生变量独立的残差(也即新息)。所以在结构型VAR模型中,最重要的一点就是要判断我们所分析的经济变量中,根据经济理论,确定它们之间当期的因果,那些当期没有因果关系的我们

就设定约束条件令为0,同时约束条件的个数跟标准型VAR模型的Choleski分解所要限定的约束条件的个数(n^2-n)/2是一样的。

实例:

根据美国的投资、收入、消费的数据,我们设定了结构型VAR模型: 模型 y_t = (dlinvestment, dlincome, dlcosumption)' 设

| 1 0 0 | | . 0 0 | A = | . 1 0 | B = | 0 . 0 | | . . 1 | | 0 0 . | 含义:

(1) 当期投资(invest)不受收入(income)和消费(consumption)的影响

(2) 收入(income)受当期投资(invest)的影响,但不受当期消费(consumption)的影响

(3) 消费(consumption)同时受到当期投资(invest)和收入(income)的影响 其中:

(1) A 的系数反映了各个内生变量的同期关系,即因果关系; (2) B 的系数反映了来自不同内生变量的随机干扰对系统的影响

程序:

use http://www.stata-press.com/data/r11/lutkepohl2,clear mat A = (1,0,0 \\ .,1,0 \\ .,.,1) mat B = (.,0,0 \\ 0,.,0 \\ 0,0,.) mat list A mat list B

svar dlinvestment dlincome dlconsumption, aeq(A) beq(B) est store svar01 mat list e(A) mat list e(B)

下面就得到了A、B矩阵的系数:

e(A)[3,3]

dlinvestment dlincome dlconsumpt~n dlinvestment 1 0 0 dlincome -.03136105 1 0 dlconsumpt~n -.05667905 -.47924065 1

symmetric e(B)[3,3]

dlinvestment dlincome dlconsumpt~n dlinvestment .04251726

dlincome 0 .01069078

dlconsumpt~n 0 0 .00744606

有时我们可以在做结构型VAR模型的估计过程,将原先的标准型VAR模型的估计给呈现出来:

svar dlinvestment dlincome dlconsumption, aeq(A) beq(B) var