楼主: suhongwei127
12107 63

求助:rat中运行FMOLS出现错误,如能帮助解决运行,重谢 [推广有奖]

21
epoh 发表于 2011-10-10 07:53:16 |只看作者 |坛友微信交流群
MCOV — Consistent Covariance Matrices
mcov( options ) start end list of resids
# list of variables in regression format
options:
lwindow=neweywest/bartlett/damped/parzen/
               quadratic/[flat]/panel/white
lags=correlated lags
         LAGS gives the bandwidth
******
Examples
mcov(lwindow=bartlett,lags=lags) startl+1 endl resids
# constant
computes an estimate of the spectral density of RESIDS at frequency zero, using
“LAGS” lags. The computed matrix (which here will be 1x1) will be in %CMOM.
[%CMOM] : SYMMETRIC array for computed matrix
******
paneldols:
* Compute the long-run variance of the residuals.
   *
   mcov(lwindow=bartlett,lags=lags,noprint) 2 jperiods
   # dolsres
   compute idlrvar = %cmom(1,1)/(jperiods-1)
   *
   * Pull out of this regression:
   *  1. The coefficients on the RHS endogenous variables
   *  2. The covariance matrix of those coefficients
   *  3. The precision matrix of those coefficients (inv of #2)
   *  4. The matrix of reciprocal square roots of the diagonal elements of the
   *     covariance matrix. That's the weighting matrix for the coefficients which
   *     will match up with the averaged t-statistics.
   *
   compute bdols=%xsubvec(%beta,1,m)
   compute vdols=%xsubmat(%xx,1,m,1,m)*idlrvar
   compute hdols=inv(vdols)
   compute ddols=inv(%sqrt(%diag(%xdiag(vdols))))
   *
   * Compute t-stat vs the hypothesized vector
   *
   ewise tdols(i)  = (bdols(i)-bvec(i))*ddols(i,i)
*****************

Compute the long-run variance of the residuals.

用于计算t-statistics


已有 1 人评分学术水平 热心指数 信用等级 收起 理由
kk22boy + 5 + 5 + 5 观点有启发

总评分: 学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

使用道具

22
epoh 发表于 2011-10-10 22:00:37 |只看作者 |坛友微信交流群

以data su.xls而言

缺失数据移除后:

     30, 32, 26, 20, 22
     32, 19, 22, 22, 17
     16, 26, 22, 19, 22
     22, 21
@paneldols(dlags=1,lags=1,bvec=||1.0, 1.0||,print=full,average=simple,$
   ibetas=dolsbeta,itstats=dolststat)
# rsca tt gl


      ENTRY             RSCA             TT              GL
      1//1978:01   0.257641839609       NA        0.156015173234
      1//1979:01   0.307419077479  0.553063566057 0.194814596798
      1//1980:01   0.262577662442  0.442310123828 0.229375365193
      1//1981:01   0.303105769603  0.445302107996 0.194061481224
      1//1982:01   0.301117251300  0.420500118290 0.218151668183
      1//1983:01  -0.012388199413  0.411642089372 0.200560824263
      1//1984:01   0.349557828965  0.472841912637 0.257193965796
      1//1985:01   0.315739766193  0.592881533136 0.254707867204
      1//1986:01   0.271698054286  0.688418397365 0.239100151039
      1//1987:01   0.269137372944       NA        0.257429700575
      1//1988:01   0.283158495448  1.140386101428 0.303810355350
      1//1989:01   0.287574771241  0.966916909964 0.352827342356
      1//1990:01   0.284783959955  0.991608848975 0.384850657079
      1//1991:01   0.275336294516  1.153822150107 0.370298078518
      1//1992:01   0.250821583719  1.109294960073 0.363212498554
      1//1993:01   0.222448371012  1.141289139152 0.371818360876
      1//1994:01   0.236197899843  1.370573767360 0.413914530739
      1//1995:01   0.224694548483  1.533196234874 0.486019239510
      1//1996:01   0.208729510009  1.495223523197 0.574993559838
      1//1997:01   0.188110745753  1.488179508618 0.614294551892
      1//1998:01   0.145103687851  1.331365361857 0.639879768690
      1//1999:01   0.164797227270  1.330451331081 0.594415331583
      1//2000:01   0.135730353165  1.485715290455 0.641917851470
      1//2001:01   0.131994102172  1.497637573517 0.672226769409
      1//2002:01  -0.230507469429  1.634081577551 0.674705525836
      1//2003:01   0.081186482580  1.665875993369 0.716799147617
      1//2004:01   0.091734108500  1.828384057861 0.685992082574
      1//2005:01   0.107492807574  1.682804420641 0.627041958829
      1//2006:01   0.104976326470  1.645793289263 0.676911258771
      1//2007:01   0.077111029215  1.463276457608 0.635252909934
      1//2008:01   0.110737241644  1.623064492461 0.600914991040
      1//2009:01   0.173704142070  1.634624534144 0.524715909043
************

第一个unit : 差分1,dlag lag 1,

                 缺失2,dlag lead 1 .

       所以dolsres由1980 ~ 2006

      ENTRY            DOLSRES
      1//1980:01   0.066513294758
      1//1981:01   0.001220431405
      1//1982:01  -0.230164747029
      1//1983:01   0.057518179123
      1//1984:01   0.045726275097
      1//1985:01   0.025949846190
      1//1986:01   0.015981763355
      1//1987:01  -0.017145216581
      1//1988:01  -0.003040805094
      1//1989:01   0.037954460069
      1//1990:01  -0.009095938769
      1//1991:01  -0.030741836947
      1//1992:01   0.003024476715
      1//1993:01   0.015611163348
      1//1994:01  -0.005253401923
      1//1995:01   0.068195752708
      1//1996:01   0.007432886805
      1//1997:01   0.152440288192
      1//1998:01   0.074864586408
      1//1999:01   0.045781583523
      1//2000:01  -0.250040962271
      1//2001:01  -0.032596798897
      1//2002:01   0.000962434200
      1//2003:01   0.070215389182
      1//2004:01  -0.040331285736
      1//2005:01  -0.034634603461
      1//2006:01  -0.036347214371

使用道具

23
zhangtao 发表于 2011-10-24 19:24:29 |只看作者 |坛友微信交流群
epoh 发表于 2011-10-10 07:53
MCOV — Consistent Covariance Matrices
mcov( options ) start end list of resids
# list of variable ...
epoh老师,您好!
      您的这个MCOV估计程序我怎么没有看到?
您能提供程序和说明一下如何使用吗?
非常感谢!
数学好就是要天天学

使用道具

24
epoh 发表于 2011-10-24 20:37:24 |只看作者 |坛友微信交流群

是这样的,zhangtao兄

楼主问@paneldols(dlags=5,lags=5,bvec=||1.0||,print=short,average=simple)

       # logexrate logratio

lags的问题

所以我才引用paneldols.src中的一段代码

paneldols:

* Compute the long-run variance of the residuals.

   mcov(lwindow=bartlett,lags=lags,noprint) 2 jperiods

   # dolsres

   compute idlrvar = %cmom(1,1)/(jperiods-1)

告诉他这里有用到function mcov()

详细可参考RATS 7.0 Reference Manual, page 305/632

已有 1 人评分学术水平 热心指数 信用等级 收起 理由
zhangtao + 5 + 5 + 5 非常感谢epoh老师!

总评分: 学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

使用道具

25
annietang111 发表于 2011-11-1 13:17:57 |只看作者 |坛友微信交流群
epoh 你好,怎样才能获得残差?具体怎么操作?是在dols估计后直接输入以下命令?
linreg(noprint) dvec(1) 2 jperiods  dolsres

   # reglist

使用道具

26
epoh 发表于 2011-11-1 18:44:38 |只看作者 |坛友微信交流群

修改程序在8楼

使用道具

27
annietang111 发表于 2011-11-3 13:49:32 |只看作者 |坛友微信交流群
epoh,非常感谢!

使用道具

28
kk22boy 发表于 2011-11-22 10:33:06 |只看作者 |坛友微信交流群
恩,谢谢epoh老师
呵呵,已经在会务区帮您申请奖励了!
如果该贴对您有些许帮助,希望你能回复一下或者评一下热心指数!谢谢!

使用道具

29
epoh 发表于 2011-11-22 11:28:16 |只看作者 |坛友微信交流群
kk22boy 发表于 2011-11-22 10:33
恩,谢谢epoh老师
呵呵,已经在会务区帮您申请奖励了!
哈哈!感谢kk22boy兄
能帮的上别人,
其实也是自己的荣幸.
就怕自己不知量力.
已有 2 人评分经验 威望 论坛币 学术水平 热心指数 信用等级 收起 理由
星野 + 1 + 1000 感谢您对论坛的支持,感谢您对其他坛友的热.
Sunknownay + 100 + 10 + 5 + 5 + 5 热心帮助其他会员

总评分: 经验 + 100  威望 + 1  论坛币 + 1010  学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

使用道具

30
kk22boy 发表于 2011-11-22 11:43:56 |只看作者 |坛友微信交流群
我承认论坛里边卧虎藏龙,各种高手如云
但像您这样无私慷慨,热心帮助别人的人还真不多见
不知epoh兄是做什么的
感觉您好像什么软件都很精通,R、sas、matlab。。。
呵呵,真得好好像您学习
如果该贴对您有些许帮助,希望你能回复一下或者评一下热心指数!谢谢!

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-20 11:38