0
$\begingroup$

I am trying to learn about volatility forecasting using three models: ARCH(1), GARCH(1, 1) and EGARCH(1, 1) using python. I wanted to know if my general procedure is correct, and specifically if my time horizon is correct (i.e. is it reasonable to use 9 years of daily stock returns data to then forecast into 3 years).

The first step of my procedure is to import the daily returns data between 1st Jan 2010 and 25th March 2022 from two stocks, using the yfinance python package. I then took the first 80% of this data and calculated logarithmic returns and used this to be the "training set", where I used Scipy's minimise function to determine the parameters for each of the models. I then used the models with the determined parameters to forecast into the remaining 20% of the returns data, which I deem the "testing set" (roughly from 2019-2022). To compare my forecasts with the "actual volatility", I calculated log returns (it_test_returns) for the testing set as well, to get the actual volatility between 2019 and 2022:

(np.sqrt(252) * it_test_returns.rolling(window=30).std())*(1/100)

And then I plotted this against my forecasts. The resulting plots do look reasonable, but I can't find much information on whether I have used enough training data to forecast three years.

$\endgroup$
4
  • 1
    $\begingroup$ It would be easier for us to determine what you have done, if you include your code in the question (and maybe also the graphs). $\endgroup$
    – Pleb
    Apr 23, 2023 at 14:45
  • $\begingroup$ If you have used the arch package for estimating and forecasting the GARCH models, then you might find some help here. My answer also provides a link to the arch documentation where the author goes through a lot of examples forecasting various GARCH models. Maybe this will provide some additional insight? $\endgroup$
    – Pleb
    Apr 23, 2023 at 15:04
  • $\begingroup$ I didn't use the ARCH package, though I might try and redo it using that. Instead i defined the functions myself and calculated the model parameters using maximum likelihood estimation. However, my main question really was whether it was reasonable to use 9 years worth of daily returns data to forecast 3 years ahead $\endgroup$ Apr 23, 2023 at 15:18
  • 1
    $\begingroup$ You can use 9 years of daily returns to estimate the model parameters, that is not wrong. Typically, you use a rolling window to estimate your GARCH parameters, and then with your new parameters implemented, you forecast 1-step ahead to get the $t+1$ forecast (as an example). At the end of day $t+1$, you have new data available that you can feed into your GARCH model and re-estimate the parameters from day 2 till $t+1$, in order to forecast day $t+2$ and so on (this is one procedure to forecast a GARCH model 1-step ahead). Is this what you're doing when forecasting your model? $\endgroup$
    – Pleb
    Apr 23, 2023 at 16:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.