4.6 Implementation of GARCH model
4.6.5 Implementing the Nelder-Mead algorithm
In this study the Nelder-Mead algorithm will be used extensively to estimate the parameters of the GARCH model in conjunction with the chosen log-likelihood function (see sections 4.6.3 and 4.6.4). The Nelder-Mead algorithm (or simplex search algorithm) is a popular algorithm for multidimensional unconstrained optimization without using derivatives. Since is does not require derivative information it is suitable for solving problems with non-smooth functions. The Nelder-
Mead algorithm can also be used for problems with discontinuous functions which occur frequently in statistics.
The Nelder-Mead algorithm was developed to solve the classical unconstrained optimization problem of minimizing a nonlinear function π: βπβ β. The method only makes use of function values at certain points in βπ and does not form an approximate gradient at any of these points.
It thus belongs to the general class of direct search methods. The Nelder-Mead algorithm is based on the concept of a simplex. A simplex (denoted π) in βπ is defined as a convex hull of π + 1 vertices π₯0, β¦ , π₯π β βπ. This implies that a simplex in β2 is a triangle and a simplex in β3 would be a tetrahedron.
In general, a simplex-based direct search method (such as Nelder-Mead) initially starts with a set of points that are considered the vertices of the working simplex π. These vertices can be denoted π₯0, β¦ , π₯π β βπ and their corresponding set of function values ππβ π(π₯π) for π = 0,1, β¦ , π. The vertices of the initial simplex may not lie in the same hyperplane3. The Nelder-Mead algorithm then performs a sequence of transformations on the working simplex π with the objective of decreasing the function values at its vertices. At each step the transformation is determined by computing one or more test points with their respective function values and by comparing these function values with those at the vertices. The process is terminated when the working simplex π becomes small enough such that the function values ππ provide a sufficient estimation.
4.6.5.2 Implementation overview of Nelder-Mead algorithm
The Nelder-Mead algorithm can be implemented in various ways. Apart from minor computational details in the basic algorithm, the main differences lie in the construction of the initial simplex and in the selection of convergence and termination tests. The general algorithm can be described as follows:
ο· Construct an initial simplex (π)
ο· Until the termination test is satisfied, transform the working simplex
ο· Return the best vertex of the current simplex and the associated function value 4.6.5.3 Initial simplex construction
The initial simplex is constructed by generating π + 1 vertices (π₯1, β¦ , π₯π+1) around a given input point π₯ππβ βπ. In this study, the choice of π₯1= π₯ππ is made and the remaining π vertices are generated such that all edges have the same specified length.
4.6.5.4 Simplex transformation algorithm
The simplex transformation algorithm of this implementation consists of six steps that will be discussed in this section and illustrated graphically with a simple example. The steps make use of coefficients that will be defined prior to the explanation of the steps. The coefficients include the reflection coefficient (πΌ), expansion coefficient (πΎ), contraction coefficient (π) and shrink coefficient (π). The standard values for these coefficients will be used (as described in [55]):
πΌ = 1 πΎ = 2 π = 0.5 π = 0.5
As an illustrative example, the steps of the Nelder-Mead simplex search algorithm will be displayed for an example where a minimum of a likelihood function (π) is searched for. When two points are compared in this example, the βbetterβ point will be the point that minimizes the likelihood function and the βworseβ point will be the point that maximizes the function. The optimization starts with the construction of an initial simplex.
The initial simplex of the accompanying example is depicted in Figure 4-1. Three points are shown, which indicates that the problem is to be solved in β2. It is important to note that the accompanying example depicts one possible iteration through the steps and that different situations may exist which will alter the graphical illustrations.
Figure 4-1: Initial simplex illustration
1. Ordering values
First, the likelihood function values are calculated for each point. The values at the vertices are ordered from best to worst such that:
For the sake of clarity in the example, assume that the worst point (which maximizes the function) is denoted π₯π+1 and the best point is denoted π₯1.
2. Calculating centroid
The centroid (π₯0) of all points except for π₯π+1 is calculated as π₯0=1πβπ π₯π
π=1 . In the example, the centroid can be depicted by the point labelled π₯0 in Figure 4-2.
Figure 4-2: Centroid and initial simplex
3. Reflection step
The reflected point is calculated as π₯π = π₯0+ πΌ(π₯0β π₯π+1) where πΌ > 0. If π(π₯1) < π(π₯π) <
π(π₯π+1) replace π₯π+1 with π₯π and restart execution at step 1. If the reflected point was worse than the worst point, continue with step 4. The reflected point (π₯π) is illustrated in Figure 4-3.
Figure 4-3: Reflection step illustration
4. Expansion step
If the reflected point is currently the best (i.e. π(π₯π) < π(π₯1)), calculate the expanded point π₯π= π₯π+ πΎ(π₯πβ π₯0) where πΎ > 0. If the expanded point is better than the reflected point (i.e.
π(π₯π) < π(π₯π)), obtain a new simplex by replacing the worst point π₯π+1 with the expanded point π₯ and restart execution at step 1. If the expanded point is worse than the reflected
Figure 4-4: Expansion step illustration
5. Contraction step
When execution of the algorithm reaches step 5, it is certain that π(π₯π) β₯ π(π₯π). The contracted point is calculated as π₯π = π₯0+ π(π₯π+1β π₯0) where 0 < π < 0.5. If the contracted point is better than the worst point (i.e. π(π₯π) < π(π₯π+1)) obtain a new simplex by replacing the worst point π₯π+1 with the contracted point π₯π and restart execution at step 1. Otherwise continue with step 6. The contraction step is illustrated in Figure 4-5.
Figure 4-5: Contraction step illustration
6. Reduction step
For all points, except for the best point, perform the following calculation and return to step 1:
π₯π = π₯1+ π(π₯πβ π₯1), π β {2, β¦ , π + 1}.
The reduction step is also referred to as the shrinkage step. This step is depicted by the
βmovementβ of π₯2 and π₯3 in Figure 4-6.
Figure 4-6: Reduction step illustration