How to calculate long-term variance in GARCH?

Discussion in 'Automated Trading' started by micky04, Dec 25, 2018.

  1. micky04

    micky04

    I just started learning what GARCH is and how it works. In the future, I hope to incorporate it in my backtests.
    However, I'm not sure how I should calculate the long-term variance when doing backtests. I can't simply take all the returns in my dataset because that would create look-ahead bias. What should I do?
     
  2. sle

    sle

    Not sure what you are going to use it for, but for what it's worth, sensitivity to the little fluctuations in the long term is pretty small. Your best bet is probably to use a rolling window that would be always behind your estimator.
     
  3. micky04

    micky04

    So just to clarify, if I want to find the GARCH of 21 March 2007 of MSFT, I use the returns from the beginning of MSFT's price history to 21 March 07 to calculate the long term variance, and the same for 21 March 2008?

    If that's case, would it create some rather biased long-term variance for some dates? Like if a stock's history starts at 2006 and I want to find the GARCH of 21 March 2007. The long-term variance will probably be underestimated.
     
  4. Robert Morse

    Robert Morse Sponsor

    tommcginnis likes this.
  5. gaussian

    gaussian

    Since you were fairly vague I hope I am correct in understanding your definition of Long-Term Variance. You are training a model on N data and trying to predict N+X where X is some large number. For example, training on last year's data to predict the variance every day this year. Or the next 10 years of variance. Something like that.

    Assume we have a well-defined stable GARCH model with alpha + beta < 1. One primary feature of GARCH(1, 1) is it's recognition that variance pulls back to a long-run mean. What happens when you attempt to predict too far into the future is the GARCH model, operating on it's training data, will "go flat" as it approaches the long-run mean of the variance. This is expected because variance will eventually pull back to it's long run mean. In reality though, this isn't always the case. You have to deal with regime changes that can happen fairly frequently. This is why GARCH tends to give relatively poor forecasts of future variance as time goes on. Without getting too much farther into the mathematics of it GARCH models don't always perform well on long term forecasts because equities regularly undergo significant regime change. There are a ton of other GARCH models you can try, and a few papers on bivariate markov extensions to them. They seem to have some promise if you have the chops to implement them.

    @sle has the correct idea:

    His answer to solving long-term bias is to use a rolling window. You would train from your start point to 20 March 2007, predict 21 March 2007, and roll the window 1 day forward. This is a very traditional way of getting around the problems I listed above.
     
  6. micky04

    micky04

    I think I understand what you are saying. Since I am attempting to implementing GARCH to my options backtesting, I am trying to predict N+X, where X is somewhere between 30-45 days. Am I right to say my GARCH model will not be so affected by regime changes that it becomes useless?
     
  7. gaussian

    gaussian

    This depends a lot on the underlying volatility structure of the equity you are attempting to model. Regime changes are unique to the underlying. Imagine a very volatile penny stock. You might be lucky to get one really good forecast out of a GARCH model for it. Now imagine a very stable stock like IBM. You may be able to predict out a few days or more. The regime changes in IBM would primarily be around earnings and stuff like that.

    I have personally never had a good experience attempting to predict more than a few days out for most equities. I also never really deeply explored more advanced GARCH models because I had no use for them.

    You have to remember that the exponential decline in the weights as the model goes farther in time results in the pullback to the long-run mean. Even if your prediction is perfect, the equity you are modeling will probably not spend much time at it's actual mean. You will need to regularly update your predictions. How often you do that is contingent on a lot of things.

    I think one good thing to do is experiment. I don't know your mathematical sophistication but the GARCH model is kind of complicated. One way to prove this to yourself is to write your code such that:

    1. Loop over your data predicting 1-Day all the way to N-Day predictions (with windows like we said above)
    2. For each one calculate the AIC/BIC/whatever you use to determine goodness of fit
    3. Find the ones that fit best

    I suspect you won't get a much better out of sample prediction after 1-2 days. Doing this will tell you empirically without all the complicated math. Bonus points: plot the forecasts and see how it pulls back to the long-run mean exponentially (when alpha + beta < 1.... of course).
     
    Last edited: Dec 26, 2018
    .sigma likes this.
  8. micky04

    micky04

    Thanks for your response. I guess I will avoid using GARCH over earnings or other similar events where there may be regime change (FDA announcement date for biotech stocks?).

    If you don't use GARCH, how do you model vol (if you do, of course)?
     
  9. gaussian

    gaussian

    I have used GARCH in the past for volatility modeling. I've also used EWMA. GARCH is very satisfying once you understand it. However, it's not a be-all-end-all of forecasting.

    In options trading you are generally concerned with implied volatility vs the realized volatility. GARCH, which sometimes useful here, isn't as useful as knowing when IV is greatly overstating an equity's ability to move. GARCH doesn't help you understand the "equity's ability to move" in my opinion.

    A place where GARCH is useful is for modeling stock prices. You can combine an ARIMA and GARCH model together. ARIMA is generally not used in places constant variance is assumed. The ARIMA-GARCH model does not assume constant variance, so it is useful (and computationally very difficult!) for forecasting equity behavior.
     
    .sigma likes this.
  10. micky04

    micky04

    I haven't read up on ARIMA-GARCH model yet, but I will certainly take a look. About IV vs RV, I was thinking about using something like GARCH to estimate future volatility.
    Thanks for your help btw.
     
    #10     Dec 29, 2018