Skip to content

I apply fundamental knowledge related to GARCH model to make forecast volatility of return of 10 big firm in IT industry

Notifications You must be signed in to change notification settings

LinhNguyen-MyLi/GARCH-model-to-forecast-in-excel

Repository files navigation

GARCH-model-to-forecast-in-excel

I apply fundamental knowledge related to the GARCH model to make forecast the volatility of return of 10 big firms in the IT industry. In more detail, I will take the daily close price (P) of them in The Nasdaq Stock Market from (1/1/2018 – 28/02/2023 -> we will have 1298 observation) and the 10 firms include Alphabet Inc. (GOOGL), Dell Technologies Inc (DELL), Apple Inc (AAPL), Tesla Inc (TSLA), IBM (IBM), Cisco Systems Inc (CSCO), HP Inc (HPQ), Intel Corporation (INTC), Meta Platforms Inc (META), NVIDIA Corporation (NVDA). And those P are input data.

Build up GARCH (1,1) model using Maximum Likelihood to predict the volatility of return on stock prices of 10 firms. You could read the following steps to get more insight into forecasting with the GARCH model:

  1. In the model, we have 03 parameters: alpha (α), beta (β), and gamma (γ). The sum of those parameters must be equal to 1. We will use those 03 parameters to compute the long-run average variance rate as the formula below:
    $~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$ image
    We set image with VL stand for long run daily variance => the formula change into:
                                                                                     image
    With sum of 03 parameters equal to 1 => γ=1- α- β we have the formula:
                                                                                    image
    Before running the solver we assume the following initial values for α, β, ω as follows:
                                                                                    image
    Based on those initial values and the formula V, we calculate long-run daily variance, then take the square root of V_L to obtain Long run daily Std, then by multiplying the Long run daily Std with the square root of 250 (number of trading days in a year), we achieve its annual value. The result for parameters before running the solver (the result for DELL):
                                 image

  2. We use the maximum likelihood method in this case instead of regular regression cause in this case, our data (the volatility of the rate of return) tends to fluctuate over time, and in traditional regression, it is often assumed that the errors (or residuals) have constant volatility. In maximum likelihood methods, we choose parameters that maximize the probability of observing the given rate of return data, in other words, choose the parameter that maximizes the likelihood function below, this function measures the probability of obtaining the observed data:
                                                                                    image
    => To obtain the result for the function, firstly, we need to calculate the ui and v or σ_n^2 (variance of Ut). The Ut is the rate of return, it's calculated as the formula: image. As for the Variance of Ut, the first volatility value equal to power 2 of the first ut, the second variance value is calculated as the formula:
                                                                                    image
    After achieving the value of ui and Rt we can compute the likelihood function. The result will look like this (DELL):
    image
    (Note: for calculating the Annual Std before the GARCH model we multiply square root of 250 with the square root of daily return)

  3. After the step 2 we should achieve the Sum of likelihood function. Next step, we use the Solver function for set a constrain for parameters (γ, α, β). As we have already mentioned above those parameters should be settled in the range from 0 to 1. And the sum of them must be equal to 1. The constrain input into Solver should be like this:
                                                                                    image
    After running the Solver, we will obtain a new set of parameters that maximize the Sum of the likelihood function. The result for DELL:
    image

  4. Recalculate the feature in step 2 with this new set of parameters. The result will be like below:
    image
    We also added 03 new features: GARCH Modeled Daily Std, GARCH Modeled Annual Std Dev and Long Run Annual Std. Computing the daily Std and Annual Std is the same as in I. As for Long run annual Std, we simply take Long run annual Std in the parameter table in step 3. The table result will be like this:
    image

  5. Forecased Standard Deviation over 300 days ahead
    Estimating Variance by applying the formula below:
                                 image
    Based on the estimated variance, we estimate GARCH Modeled Daily Std by taking the square root of the estimated variance above. Then estimate sigma t (GARCH Model annual Std Dev) by multiplying the estimated GARCH Model Daily Std with the square root of 250. The sigma L (Long run annual Std) is the same.
    The estimated result will look like this (DELL):
                                 image

  6. Find adjusted sigma n (adjusted Std n). As we observe via the chart in the step 4, the volatility of return on the stock price is fluctuated around some certain value called the long-run volatility (or long run annual Std or sigma L). The greater the volatility, the higher the risk. By calculating adjusted sigma n we know when (in the future) the volatility of the return will return to the long run annual Std.
    (Note: The higher the sum of α + β the slower the volatility of the return will return to the long run annual Std). The process to find adjusted sigma n:
          - Determine the sigma n. Sigma n is the last value of the volatility of the rate of return (historical volatity data).
          - Determine the lowest point of volatility by observing the chart or simply compute Min function excel on GARCH model annual Std.
          - From that min value (lowest point) we calculate adjusted sigma daily by deviding it by square root of 250.
          - Then, we power 2 the adjusted sigma daily to obtain adjusted variance.
          - Replace adjusted variance to the last old one in σ_n^2 column.
    Before we start to adjust sigma n, we need to ganerate a Check error indicator to check when (in the future) the percentage difference between sigma t and sigma L is less than 0.5%, in other word, they start to approach each other (X point in Estimated sigma graph above). If it > 0.5% the indicator will return 1. If it isn’t, the indicator will return 0. By using If function excel we can satisfy all those conditions.
    After compute the estimated GARCH model we fill out the table below:
    image

(Note:
• Time to return to sigma L (T) – is the time point before we adjust sigma n and when it start to equal to 0, we need to check the value of Check error indicator.
• Time to return to adjusted sigma n (Tk) – After we compute the new variance from the adjusted sigma n => we replace it into the last variance (as mentioned above). After the replacement the T will change. And the new T is Tk)

About

I apply fundamental knowledge related to GARCH model to make forecast volatility of return of 10 big firm in IT industry

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published