## 5 Genetic Algorithm for Searching for Optimal Parameter - Values: FOU Prediction Model
It should be noted that the longer the BP length, the more accurate the estimates of the Hurst exponent will be [51; 52]. In the FOU model, the value of the Hurst exponent first helps us obtain a rough idea of how quickly we can perform the forecasting process one step ahead of time. It also helps us obtain a rough idea of the \"range\" of the parameters of the \"uncertainty footprint of FOU\". Implementing GA directly considers the specifics of the applied problem, which involves searching for optimal parameter values. First, we must determine the structure of a chromosome and its encoding method. Next, we determine the method for selecting chromosome parents, as well as the procedures for crossover and mutation. Finally, we choose a favorable correspondence function, which we need to minimize when we apply GA [53]. The chromosome providing the minimum value of the fitness function (21) is recognized as the best in the current generation of the GA. In the context of the task of developing a model for predicting FOU for the selection of parents in GA, the principle of probabilistic selection was used: the smaller the value of the fitness function of chromosome sl (l = (\(\overline{1,\ p}\)) in the current population, the greater the probability \(p_{1}\) that chromosome sl will act as a parental chromosome in forming offspring chromosomes for a new population. When performing the crossover operation in GA, the parent chromosome was selected according to the following algorithm. 1. Sort by increasing probability \(p_{1}\) (l = \(\overline{1,\ p}\));  
2. Generate a random (uniformly distributed) number z from the interval [0, 1]: z = random([1, 0]);  
3. Select chromosome 1 as the parent chromosome if the random number z falls into the lth interval [\(p_{1-1}\); \(p_{1}\) (l = \(\overline{0,\ p}\)); \(p_{0}\) = 0]. To determine the two parent chromosomes, steps 2 and 3 are repeated twice. For the crossover operation, the crossover coefficient \(Rc\) is fixed. A random number zc random([1, 0]), c = is generated when attempting to cross two parent chromosomes. If \(Rc>zc\), then the intersection point is chosen c \(r_{m}\) (\(r_{m}\) \(\in\) {1, 2, 3, 4, 5) and the intersection is performed with two parental chromosomes and the formation of two offspring chromosomes. For the mutation operation, the crossover coefficient Rm is fixed. When applying a GA, a single-point crossover of the parental chromosomes is performed and no more than one element (gene) in the parental chromosome undergoes mutation. The GA for a predictive model of FOU can be described by the following sequence of steps (Figure 4):  
1. Create an initial population of chromosomes of size P from randomly selected viable chromosomes of the type s = (D1, D2, n, k, \(\alpha_{\text{lower}}\), \(\alpha_{\text{upper}}\)) taking into account the calculation of the values of the fit function and the removal of non-viable candidates from consideration. Sort the chromosomes of the initial population in increasing order of the values of the fit function. * Perform crossover and mutation operations on the current population of chromosomes. * Calculate the values of the fit function for each chromosome of the offspring. * Form an expanded population of chromosomes of size P + R\({}_{\text{c}}\)*P, from the current population of size P and offspring chromosomes. * Go to step 3 when g \(\leq\) G, increasing the current number of generations g by 1 (G and g are the maximum and current number of generations of the GA, respectively). Go to step 7 when g \(>\) G.
* Choose the best chromosome, i.e., the one with the minimal fit value. First, the structure of chromosomes and the method of their encoding must be determined. The technique for selecting parental chromosomes must also be determined, and then the possibilities for crossover and mutation operations must be defined. We chose an adequate fit function, which should be minimized (maximized) when applying the GA.