I updated the Alpha and Gamma weight optimizations. Further explanation of the update can be found in the code's comments.
Meanwhile, a few things that should be clarified from the previous version's description:
1. The (1,1) in GARCH (1,1) means that the model is using data from the most recent period to make projections.
2.In the previous description I said that JP Morgan advised using a Beta weight of 0.94 for all time frames. This is a mistake. Actually, they advised using 0.94 for daily data, and 0.97 for monthly data. Despite this, like I said in the original description, there is dispute over whether these values should be used, and their numbers don't take into account other time frames. This is why the SSE method is used in this script to calculate the optimal weights for you.
3.The Beta weight determines how closely the prediction will be to the previous period's variance.
4. The Alpha weight determines how volatility reacts to new information.
5. The Gamma weight determines the degree to which the Garch model's projections will revert to the mean, aka the Long Run Variance.
6. The (Alpha+Beta) component of the Projected Variance equation in the original description, determines the tendency of the projection to stick to the Long Run Variance. This is important to know because Alpha+Beta+Gamma must equal 1. This means that the higher (Alpha+Beta) is, the smaller Gamma will be, and vice versa. As stated above, Gamma determines the degree to which the projections will revert to the Long Run Variance. So the larger (Alpha+Beta) is the slower the rate of reversion will be; meanwhile the smaller (Alpha+Beta) is the quicker the rate of reversion will be.
For Example:
(the numbers presented below are solely for illustrative purposes)
Scenario A: Let's say you are projecting the variance of an asset over the next 5 days using this Garch model, where the Long Run Variance is 1%, (Alpha+Beta)=0.9, and Gamma=0.1. The projections for the next 5 days may look something like this: [Today: 1.6%, Day1: 1.5%, Day2: 1.4%, Day3: 1.3%, Day4: 1.2%, Day5: 1.1%].
Scenario B: Let's say you are projecting the variance of an asset over the next 5 days using this Garch model, where the Long Run Variance is 1%, (Alpha+Beta)=0.7, and Gamma=0.3. The projections for the next 5 days may look something like this: [Today: 1.6%, Day1: 1.45%, Day2: 1.3%, Day3: 1.15%, Day4: 1%, Day5: 1%].
In Scenario B Gamma is higher than in Scenario A, and because of this the projections for the next five days revert to the Long Run Variance at a much quicker rate than in Scenario A.
I hope this clarifies things better.