Announcement

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

  • Help with hetroskedasticity in time series

    Hi!

    I am doing a project where I look for seasonalities in stock prices. E.g. we have created dummies for "turn of month effect", the last day of every month and the first day of the next month will have the value 1.
    We need to find out whether to use OLS or GARCH methods due to heteroskedasticity.
    We are analysing one effect at the time.

    So first we have the day of week effect, where we regress the days of week dummies on the Log return of the index.
    The data is from 1996 to 2020.

    First I use the tsset command and create the times series.

    Then I run the regression:
    reg IndexReturn dayOfMonthDummy

    and this will by the output. We cant reject the H0 of heteroskedasticity,


    chi2(1) = 0.00
    Prob > chi2 = 0.9776

    But when I run the test from for ARCH:
    estat archlm

    lags(p) | chi2 df Prob > chi2
    -------------+-------------------------------------------------------------
    1 | 297.097 1 0.0000

    I get this, which means there are ARCH effects.
    We dont know what to do here. Are the time-series heteroskedastitic or not?
    Thank you so much in advance.

    Mathias

  • #2
    Show exactly what you typed at Stata, and exactly what Stata returned to you. And use code formatting, this symbol from the formatting panel: #.

    In particular it is not clear to me which test you are referring to when you say "We cant reject the H0 of heteroskedasticity,


    chi2(1) = 0.00
    Prob > chi2 = 0.9776"

    Comment


    • #3
      Hi Joro, thanks for answering. I meant homoskedasticity. Do you know why I get different answers (in terms of either homo/hetroskedasticity) in the two tests?

      Comment


      • #4
        Again, show exactly what you typed at Stata and exactly what Stata returned. How can anybody possibly tell you why something is happening when we do not know what you are doing?

        Originally posted by Mathias Saeten View Post
        Hi Joro, thanks for answering. I meant homoskedasticity. Do you know why I get different answers (in terms of either homo/hetroskedasticity) in the two tests?

        Comment


        • #5
          I am sorry, I am new to this forum.

          First I typed:
          Code:
          reg IndexReturn dayOfMonthDummy
          
            Source |       SS           df       MS      Number of obs   =     6,014
          -------------+----------------------------------   F(1, 6012)      =      7.92
                 Model |  .001504258         1  .001504258   Prob > F        =    0.0049
              Residual |  1.14195394     6,012  .000189946   R-squared       =    0.0013
          -------------+----------------------------------   Adj R-squared   =    0.0011
                 Total |   1.1434582     6,013  .000190164   Root MSE        =    .01378
          
          ------------------------------------------------------------------------------------------------------------------------
              IndexReturn              |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------------------------------------------------
              dayOfMonthDummy |   .0012709   .0004516     2.81   0.005     .0003856    .0021562
                                     _cons |   .0001276   .0001977     0.65   0.519    -.0002599    .0005151
          -------------------------------------------------------------------------------------------------------------------------
          then

          Code:
          estat hettest
          
          Breusch-Pagan / Cook-Weisberg test for heteroskedasticity 
                   Ho: Constant variance
                   Variables: fitted values of IndexReturn
          
                   chi2(1)      =      0.00
                   Prob > chi2  =   0.9776
          then the ARCH test:

          Code:
          estat archlm
          
          Number of gaps in sample:  1307
          LM test for autoregressive conditional heteroskedasticity (ARCH)
          ---------------------------------------------------------------------------
              lags(p)  |          chi2               df                 Prob > chi2
          -------------+-------------------------------------------------------------
                 1     |        297.097               1                   0.0000
          ---------------------------------------------------------------------------
                   H0: no ARCH effects      vs.  H1: ARCH(p) disturbance


          Comment


          • #6
            So these are different tests. The first tests whether your error variance is related to your, dayOfMonthDummy and apparently it is not.

            The second tests whether the squared error is related to past (lagged) squared errors, look at the wikipedia page formulas here
            https://en.wikipedia.org/wiki/Autore...res%20of%20the
            and particularly at "ARCH(q) model specification" what is under numbers 1.,2.and 3.
            The second test shows that your squared error is related to past squared errors. Hence you probably should be using an ARCH model.


            Comment


            • #7
              Maybe a dumb question (this is a little bit difficult I think), but can I then use both OLS estimation (because the error term is not related to the dayOfMonthDummy) and the ARCH/GARCH model and not get biased results? Which is in case the best to use?

              Comment


              • #8
                I do not think this is a dumb question at all.

                OLS with robust standard error give you all you need as far as the conditional expectation function is concerned, E(IndexReturn | dayOfMonthDummy). In your case you do not even need robust standard errors.

                The ARCH model explicitly models the autoregressive variance of the error function. I think this is interesting if you are particularly interested in the error variance. If you are just interested in the conditional expectation function E(IndexReturn | dayOfMonthDummy), I think both models should be estimating the same. It might be that the ARCH is more efficient, but less robust.

                Overall it does not hurt to estimate and report both OLS and ARCH.

                Originally posted by Mathias Saeten View Post
                Maybe a dumb question (this is a little bit difficult I think), but can I then use both OLS estimation (because the error term is not related to the dayOfMonthDummy) and the ARCH/GARCH model and not get biased results? Which is in case the best to use?

                Comment


                • #9
                  Thanks. Just to make sure I understand I will now run the regressions E(IndexReturn | turnOfMonthDummy) (i meant turn of month earlier, not day of month but that doesnt matter).

                  First I run the OLS regression and the test for hetroscedasticity (as earlier) :

                  Code:
                  reg IndexReturn turnOfMonthDummy
                  
                        Source |       SS           df       MS      Number of obs   =     6,014
                  -------------+----------------------------------   F(1, 6012)      =      7.92
                         Model |  .001504258         1  .001504258   Prob > F        =    0.0049
                      Residual |  1.14195394     6,012  .000189946   R-squared       =    0.0013
                  -------------+----------------------------------   Adj R-squared   =    0.0011
                         Total |   1.1434582     6,013  .000190164   Root MSE        =    .01378
                  
                  -------------------------------------------------------------------------------------------------------------------
                       IndexReturn             |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                  -------------+-----------------------------------------------------------------------------------------------------
                                  turnOfMonthDummy |   .0012709   .0004516     2.81   0.005     .0003856    .0021562
                                             _cons |   .0001276   .0001977     0.65   0.519    -.0002599    .0005151
                  -------------------------------------------------------------------------------------------------------------------
                  
                  estat hettest
                  
                  Breusch-Pagan / Cook-Weisberg test for heteroskedasticity
                           Ho: Constant variance
                           Variables: fitted values of IndexReturn
                  
                           chi2(1)          =     0.00
                           Prob > chi2  =   0.9776
                  Then I run the test for ARCH. And I also do the ARCH regression and the combined ARCH and GARCH regression:

                  Code:
                   estat archlm
                  
                  Number of gaps in sample:  1307
                  LM test for autoregressive conditional heteroskedasticity (ARCH)
                  ---------------------------------------------------------------------------
                      lags(p)  |          chi2               df                 Prob > chi2
                  -------------+-------------------------------------------------------------
                         1     |        297.097               1                   0.0000
                  ---------------------------------------------------------------------------
                           H0: no ARCH effects      vs.  H1: ARCH(p) disturbance
                  
                  
                  
                  
                  
                  arch IndexReturn turnOfMonthDummy, arch(1)
                  
                  ARCH family regression
                  
                  Sample: 1/2/1996 - 12/30/2019, but with gaps      Number of obs   =      6,014
                  Distribution: Gaussian                            Wald chi2(1)    =      16.96
                  Log likelihood =  17546.35                        Prob > chi2     =     0.0000
                  
                  ------------------------------------------------------------------------------
                               |                 OPG
                      IndexReturn |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                  -------------+----------------------------------------------------------------
                  IndexReturn    |
                  turnOfMonthReturn |   .0014992    .000364     4.12   0.000     .0007857    .0022127
                  _cons |    .000311   .0001687     1.84   0.065    -.0000197    .0006418
                  -------------+----------------------------------------------------------------
                  ARCH         |
                          arch |
                           L1. |   .4233033   .0149999    28.22   0.000     .3939041    .4527025
                               |
                         _cons |   .0001164   1.76e-06    66.32   0.000      .000113    .0001199
                  ------------------------------------------------------------------------------
                  
                  
                  
                  
                  arch IndexReturn turnOfMonthDummy, arch(1) garch(1)
                  
                  ARCH family regression
                  
                  Sample: 1/2/1996 - 12/30/2019, but with gaps      Number of obs   =      6,014
                  Distribution: Gaussian                            Wald chi2(1)    =       8.74
                  Log likelihood =  17850.82                        Prob > chi2     =     0.0031
                  
                  ------------------------------------------------------------------------------
                               |                 OPG
                      IndexReturn |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                  -------------+----------------------------------------------------------------
                  IndexReturn     |
                  turnOfMonthDummy |   .0010544   .0003567     2.96   0.003     .0003553    .0017534
                  _cons |   .0005855   .0001457     4.02   0.000        .0003     .000871
                  -------------+----------------------------------------------------------------
                  ARCH         |
                          arch |
                           L1. |   .2748273   .0169766    16.19   0.000     .2415537    .3081008
                               |
                         garch |
                           L1. |   .7478399   .0334006    22.39   0.000     .6823759    .8133039
                               |
                         _cons |  -7.28e-06   3.91e-06    -1.87   0.062    -.0000149    3.70e-07
                  ------------------------------------------------------------------------------
                  As you see, all coef. and P-values are different. And according to the two different tests, all models should be okay to use. Could you explain to me which model I should use in term of interpretation of the "turn of month" effect on Index return? Can you even compare the turnOfMonthDummy coefficients in the ARCH and ARCH/GARCH models with coefficients with the OLS model? I am trying to find som kind of "system". My thesis includes a lot of indices and different calendar effects, so this would be really helpful to know.




                  Last edited by Mathias Saeten; 14 Oct 2020, 01:36.

                  Comment


                  • #10
                    Could you please help me out one last time Joro?

                    Comment


                    • #11
                      Mathias: As Engle discussed in his classic 1982 paper, and Joro has emphasized, there is a difference between Var(y(t)|x(t)) and Var(y(t)|x(t),I(t-1)), where I(t-1) means information observed up through time t - 1. The usual heteroskedasticity tests are for Var(y(t)|x(t)), and ARCH tests pick up dynamic heteroskedasticity -- that is, as a function of I(t-1).

                      What I see happening is that there is no heteroskedasticity related to turnOfMonthDummy but there is strong dynamic heteroskedasticity. Therefore, there is a potential for efficiency gains using ARCH/GARCH versus OLS. And you can see that your standard errors are smaller when you account for dynamic heteroskedasticity. There is one subtle point: Using ARCH for the variance means you must be interested in E(y(t)|x(t),I(t-1)), and you haven't put lags of y in your mean equation. That's perhaps because lagged y does not matter because it is a return and then that is fine.

                      The coefficient on turnOfMonthDummy actually does not change very much. Did you expect it not to change from OLS to weighted least squares (which is what ARCH/GARCH is)? I actually see promising findings, but I'm not sure the effect is practically large. You need to discuss that.

                      Personally, I would report both the OLS estimates and the GARCH(1,1) estimates. But in the first case, make the standard errors robust to heteroskedasticity, just to be consistent. In the GARCH(1,1) case, compute the
                      Bollserslev-Wooldridge standard errors that are robust to nonnormality using the vce(robust) option.

                      JW



                      Comment


                      • #12
                        Thank you so much for helping me out Jeff Woolridge. I am in addition doing tests for normality on the returns on the different indices. In all tests (using Jarque-Bera, Shaprio-Francia) I get that I ran reject the H0 at 0.0% level. Will this have implications for my results in the OLS or GARCH model? Or is it anything I can do to correct for this? I have made a histrogram with the residuals of the IndexReturn, which looks normally distributed. This is why I am a little confused. Examples are provided:

                        Code:
                        Jarque-Bera:
                        
                        reg IndexReturn turnOfMonthDummy
                        predict residIndex, residuals
                        jb residIndex
                        
                        jb residIndex
                        Jarque-Bera normality test:  1.2e+04 Chi(2)      0
                        Jarque-Bera test for Ho: normality:
                        
                        
                        Then the Sharpio-Francia test
                        
                        sfrancia IndexReturn
                        
                        
                                          Shapiro-Francia W' test for normal data
                        
                            Variable |       Obs       W'          V'        z       Prob>z
                        -------------+-----------------------------------------------------
                            IndexReturn |     6,014    0.92093    274.252    14.381    0.00001
                        
                        Note: The normal approximation to the sampling distribution of W'
                              is valid for 10<=n<=5000 under the log transformation.
                        Click image for larger version

Name:	normality.png
Views:	1
Size:	141.9 KB
ID:	1577855

                        Last edited by Mathias Saeten; 19 Oct 2020, 02:55.

                        Comment


                        • #13
                          Forget the last post, I saw you mentioned that I can correct non-normality with the Bollserslev-Wooldridge standard errors. Thanks.

                          Comment


                          • #14
                            You do not "correct" non-normality, you robustify against non-normality. Not the same thing.

                            Comment


                            • #15
                              My mistake Eric, I meant robustify. But should we also robustify the standard errors in the OLS regression?

                              Comment

                              Working...
                              X