全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
1630 0
2014-02-11
各位,我想用garch类方法估计企业每年的收益率条件方差,数据描述如下:大约有1000+企业以上,2004-2013年度上市企业的每日收益率。数据样本见附件
dailyreturn.xlsx
大小:(169.09 KB)

 马上下载


我用forvalues编写程序如下:

forvalues i = 1(1)1056  {
            bysort year: arch r if id==`i', arch(1) garch(1) nolog
            predict h, variance
                }
其中id表示企业代码,year表示不同年度。
可以运行,但是已经半天了还是没有结束,正在进行的程序显示如下:

-> year = 2004

Number of gaps in sample:  29   (gap count includes panel changes)
(note: conditioning reset at each gap)


ARCH family regression

Sample: 20040628 - 20041231, but with gaps         Number of obs   =       129
Distribution: Gaussian                             Wald chi2(.)    =         .
Log likelihood =  270.8619                         Prob > chi2     =         .

------------------------------------------------------------------------------
             |                 OPG
           r |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
r            |
       _cons |  -.0045339   .0027907    -1.62   0.104    -.0100035    .0009357
-------------+----------------------------------------------------------------
ARCH         |
        arch |
         L1. |   .2879147   .1467449     1.96   0.050        .0003    .5755294
             |
       garch |
         L1. |  -.1687872   .2891155    -0.58   0.059    -.7354432    .3978688
             |
       _cons |   .0008414   .0002682     3.14   0.002     .0003157     .001367
------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------------------------------
-> year = 2005

Number of gaps in sample:  53   (gap count includes panel changes)
(note: conditioning reset at each gap)

。。。。。






请问我的代码有问题吗?应该怎么编写更好?
谢谢各位对我的帮助!!



二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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