Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Arch garch model for panel data

    I am trying to calculate the idiosyncratic volatility series of various firms using ARCH GARCH model (month wise). I have calculated the residuals using 3 factor Fama French Model.
    The sample of the dataset is as follows:

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input long co_code float(ym residual)
    162111 439   .0042536953
    227271 439     -.0889087
     97066 439   -.011321117
    367075 439     .02367586
     50695 439   -.017214414
    245886 439             .
     42306 439    .017057944
     13126 439    -.05439729
    253745 439    .063146174
    209539 439    -.04128059
    269428 439    .029811967
    181079 439      .0324439
    162540 439    -.02380483
    246273 439   -.027678173
    188555 439      .1902726
    244068 439     -.0485556
    227709 439    -.01003661
      5791 439    .032430828
     94055 439     .16896057
    148542 439    .067490876
     86929 439     .04922153
    197513 439    -.07096154
     92871 439     .05987762
     41903 439     .04885852
    204373 439    -.01450864
     40158 439     .15647385
    159601 439     .04170208
    145786 439    -.13478808
    126425 439    -.01979296
     40062 439    -.07774737
    246785 439    -.02039274
    147261 439             .
    236255 439 -.00014716794
    253849 439    -.05607938
    262704 439     .04819273
    248437 439   -.020234985
    248093 439    .027819507
    218419 439    .016986346
    225475 439     .08963166
     24976 439  -.0026520526
    126400 439     .00956684
     36390 439    .016334752
    172479 439    .001669633
     99542 439       .149147
     14039 439  -.0035041366
    215173 439     .05526623
    258465 439    .010570057
    267814 439    -.04414042
     52787 439     .04148282
     78330 439             .
    180372 439   -.026293574
     99444 439    .033244662
     85979 439   -.012695733
    101011 439    -.01430426
     78035 439   .0016982164
     92205 439    -.06900088
     75362 439    .063125774
    224641 439   -.022510434
    211892 439   .0013569007
     99769 439    -.00372645
    265493 439     -.0702878
     26629 439    -.07386757
    145085 439     .09205496
    194573 439    -.05234094
    128675 439     -.0493013
    190105 439             .
    245225 439     .08317745
     52864 439     .03903688
    124839 439    -.08498669
    130769 439     -.1771984
    143921 439   -.009185528
    122235 439     -.0712494
    368423 439     .20121115
    133559 439  -.0003262522
    124689 439   -.025125626
     46357 439     -.0762107
    379145 439     .08501237
     41793 439    .014354418
     60710 439     .11560681
     41095 439             .
    192359 439   -.007980871
     89597 439    .013466372
    230733 439      .1654436
     76897 439     .02157101
     36793 439    -.13674031
    172700 439     .11728674
     86957 439    -.05806407
    124892 439     .10495146
     96586 439     .10430045
    203362 439     .06231614
     71506 439     -.1151626
    185847 439    -.02021725
     76910 439     .24167775
     13450 439     .08508974
    268119 439    .013913353
    264646 439    -.10850558
    269860 439    -.03275739
     92437 439   -.035930336
    153393 439     .03613507
     91094 439    -.05886066
    end
    format %tm ym

    I have used the following command to calculate the idiosyncratic volatility series:
    Can you please help whether the following command is right? If not, please help with the same.

    Code:
    rangestat (reg) excess_firm_return excess_sensex_return SMB HML , interval(f_year -1 0) by(co_code)
    gen residual = excess_firm_return - b_cons - b_excess_sensex_return *excess_sensex_return - b_SMB*SMB - b_HML*HML
    sort co_code ym
    sort ym
    duplicates drop co_code ym, force
    xtset co_code ym
    reg residual L.residual
    arch residual, arch(1) garch(1)
    predict sigma, variance

  • #2
    Can anyone please help me with the code? Your help or suggestion would be truly appreciated.

    Comment

    Working...
    X