For production and simulation
1. Use the validated GARCH model in production
The GARCH model can be used in production once the model engineer has done a proper validation.2. Use in production
A practical challenge is that the data used by the model engineer is different than the data available once the model is used in production.3. New functionality
When using the model in production, you therefore need to use the function ugarchfilter for analyzing the dynamics in the mean and volatility, while, for forecasting, you need to apply the ugarchforecast function to a ugarchspec object rather than a ugarchfit object.4. Example on MSFT returns
To make this clear, consider the example of the 1999 till 2017 daily Microsoft returns. The model engineer uses the data available at the of end 2010 to fit the model. Suppose now you that at the end 2017 you wish to use this model to analyze past volatility dynamics and predict future volatility. Then there are three steps.5. Step 1: Defines the final model specification
First, the data engineer needs to specify the complete model. In the example, the model is first fitted and the resulting parameter estimates are then assigned to the model specification using the setfixed method. The complete model specification is called here progarchspec.6. Step 2: Analysis of mean and volatility dynamics
Then using all the returns, you can use the ugarchfilter function to compute the time series of mean and volatility predictions. Note that the volatility at the end of the series is below the average volatility.7. Step 3: Make predictions about future returns
The main use in production is to make mactual forecasts. For this, you need to apply the ugarchforecast function to the complete time series of returns and setting the argument fitorspec to the garch model specification used. Applying the mean and sigma method gives you then the predicted mean and volatility for the next ten days. Note that the volatility in the second column is predicted to increase since at the time of prediction it is below the average volatility.8. Use in simulation
You can also use the complete model specification to simulate artificial log-returns, defined as the difference between the current log-price and the past log-price. This simulation is useful to assess the randomness in future returns and their impact on future price levels. The future price at time t+h equals the current price multiplied with the exponential of the cumulative sum of all the log returns between t and t+h.9. Step 1: Calibrate the simulation model
As an example, let's make a simulation model that is calibrated on the daily log-returns for the Microsoft stock. You first need to compute these log-returns using a time series of prices and then fix the model parameters to those obtained by estimating the GARCH model.10. Step 2: Run the simulation with `ugarchpath()`
Next you can use the ugarchpath function to simulate the returns. You need to specify the model to use, the number of observations in the simulated time series, the number of time series you want to simulate and the seed used. The seed is required if you want to reproduce later the same simulated series. It can be any number. In the example, you can see that we use the simgarchspec model to simulate 4 series of ten years of 252 observations using the seed 12345.11. Step 3: Analysis of simulated returns
You get the simulated returns by using the method fitted. You can see here the time series plot of the four simulated series. Note the volatility clustering…12. Analysis of simulated volatility
...which you can also directly see in the plot with daily GARCH volatility of each series.13. Analysis of simulated prices
Here you can see the simulated price series. They differ a lot due to the randomness in the simulated returns and the use of a long horizon of ten years. Note in the R code that the prices are computed by taking the exponential of the cumulative sum of the simulated log-returns.14. Time to practice with setfixed(), ugarchfilter(), ugarchforecast() and ugarchpath()
It's now up to you to put the course material in production!Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.