全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 EViews专版
941 2
2013-10-31
%eqname="eq01"    'please set the estimated equation name,
%maxlag = "12"              'maximum number of lags
%dep = "M2GR"               'please set the dependent variable name
%regs1 = "RGDPGR"               'independent variables name
%regs2 = "CPI"  
%regs3 = "CREDITGR"  
%criterion = "@AIC"   '  "@AIC" for Akaike, "@schwarz" for Schwarz, and "@HQ" for Hannan-Quinn

!maxlag = @val(%maxlag)      'trans string to a value

close {%eqname}     ' 不显示eq的估计结果

smpl @first @last

!mincrit = 1e10 '赋予初值

!x1lag=0
for !i=0 to !maxlag
  !x1lag = !x1lag + !i

    !x2lag=0
  for !j=0 to !maxlag
        !x2lag = !x2lag + !j

     !x3lag=0
   for !k=0 to !maxlag
        !x3lag = !x3lag + !k
        
  'estimate equation
  equation {%eqname}.ls {%dep} {%regs1}(0 to -!x1lag) {%regs2}(0 to -!x2lag) {%regs3}(0 to -!x3lag) c

  'capture criterion
        if @upper(%criterion) = "@AIC" then
        !crit = {%eqname}.@aic
        endif
        
        if @upper(%criterion) = "@SCHWARZ" then
        !crit = {%eqname}.@schwarz
        endif
        
        if @upper(%criterion) = "@HQ" then
        !crit = {%eqname}.@hq
        endif

        'compare criterion
        if !crit < !mincrit then
        !mincrit = !crit
        !bestx1lag = !x1lag
        !bestx2lag = !x2lag
        !bestx3lag = !x3lag
        endif
        
      next
   next
next

equation {%eqname}.ls {%dep} {%regs1}(0 to -!bestx1lag) {%regs2}(0 to -!bestx2lag) {%regs3}(0 to -!bestx3lag) c

show {%eqname}
matrix bestlags = @filledmatrix(!bestx1lag,!bestx2lag,!bestx3lag)

二维码

扫码加我 拉你入群

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

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

全部回复
2013-11-1 18:55:59
该怎么取消悬赏了?  我自己解决了啊
二维码

扫码加我 拉你入群

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

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

2013-11-1 18:57:28
请版本帮忙取消悬赏吧
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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