全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 MATLAB等数学软件专版
2504 1
2013-09-06
data(format=prn,org=columns,skips=6) 1960:01 1982:04 invest income cons
*
set dinc = log(income/income{1})
set dcons = log(cons/cons{1})
set dinv = log(invest/invest{1})
*
system(model=varmodel)
variables dinv dinc dcons
lags 1 2
det constant
end(system)
estimate(sigma,resids=resids) * 1978:4
*
@VARBootSetup(model=varmodel) bootvar
*
compute rstart=%regstart()
compute rend =%regend()
*
compute bootdraws=2000
compute nvar =3
compute nsteps=8
declare vect[rect] %%responses
dim %%responses(bootdraws)
declare rect[series] impulses(nvar,nvar)
declare vect ix
*
infobox(action=define,progress,lower=1,upper=bootdraws) $
"Bootstrap Simulations"
do draw=1,bootdraws
@VARBootDraw(model=varmodel,resids=resids) rstart rend
*
* Estimate the model with resampled data
*
estimate(noprint,noftests)
impulse(noprint,model=bootvar,factor=%identity(3),$
results=impulses,steps=nsteps)
*
* Store the impulse responses
*
dim %%responses(draw)(nvar*nvar,nsteps)
ewise %%responses(draw)(i,j)=ix=%vec(%xt(impulses,j)),ix(i)
infobox(current=draw)
end do draw
infobox(action=remove)
*
@mcgraphirf(model=varmodel,center=median,percent=||.025,.975||,$
shocks=||"Investment","Income","Consumption"||,$
footer="95% other-percentile bootstrap bands")
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2013-9-6 00:57:23
关于RATS的使用,现在在国内还不是很流行,但是它比EViews好用,特别是计量学到最后的人就越发有深刻体会。希望有更多人使用它推广它。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群