DEVISING A METHOD FOR CONSTRUCTING THE OPTIMAL MODEL OF TIME SERIES FORECASTING BASED ON THE PRINCIPLES OF COMPETITION

This paper reports the analysis of a forecasting prob­ lem based on time series. It is noted that the forecasting stage itself is preceded by the stages of selection of fore­ casting methods, determining the criterion for the fore­ cast quality


Introduction
Tasks related to implementing the forecast based on retrospective data are addressed during decision-making processes in various fields of human activities. To solve each specific forecasting problem, experts-analytics are typically involved, or specially developed software is used. An important factor influencing the choice of tools for calculating predictive values is the presence or absence of the need to improve the accuracy of the forecast. That depends on the context of the task and the purpose of forecasting.
An analytical review of current research and software aimed to solve the problem of forecasting based on time series shows that there are now a large number of methods of forecasting that are different in terms of application complexity and speed of computations. An expert analyst or the owner of the problem, when solving a forecasting problem, should at the preparatory stage decide which tools could be used, based on the characteristics of the specified time series. Several approaches to resolving this issue are considered. The first approach is to choose the most accurate method for the specified series according to some criterion [1,2]. To this end, the series is divided into two parts and, while performing forecasting for already known time periods, one evaluates the accuracy of each particular method. Another way makes it possible to select several sufficiently accurate methods for the specified time series and analyze the results of their use in a complex, by building, for example, some combination of them [3,4]. This approach makes it possible to improve the accuracy of the forecast but it all depends on the number and accuracy of the selected methods.
The relevance of devising new approaches and methods of forecasting based on time series is confirmed by the theoretically proven impossibility of the existence of the single forecasting method best for all time series [5]. A method for building an optimal forecasting model based on the principle of competition could make it possible to simultaneously take into consideration any number of forecasting methods. The analysis of forecasting results involving several methods in different combinations would ensure the possibility of selecting exactly those methods that together produce the most accurate result.

Literature review and problem statement
Paper [6] describes a modular regression model with interpreted parameters. Using this model does not require the involvement of analysts who have experience in time series modeling and allows its intuitive setting. Study [7] addresses Bayesian forecasting models. In it, the authors unified concepts and requirements for modeling in accordance with a dynamic linear mode (DLM). The cited study reports a presentation of the Bayesian paradigm. Using neural network forecasting methods requires some analyst experience in setting neural network parameters but makes it possible to get more accurate forecast results. Paper [8] analyzes the tools used in the study of time series. The peculiarities of the application of different methods in the study of the influence of external factors on the time series are shown. Work [9] gives a diagram of automatic simulation of an artificial neural network based on a generalized regression neural network. Deep learning models based on recurrent and convolutional neural networks are given in [10]. The effectiveness of the developed models for forecasting some time series is shown. The approach to deep learning, which is a deep architecture of long-term memory and makes it possible to resolve the limitations of traditional forecasting methods associated with the analysis of large time series, is given in [11].
Forecasting fuzzy time series by a specially devised method based on the optimization of ant colonies was investigated in [12]. The advantages of the developed method are shown, compared to some other forecasting methods, for specified time series.
A separate group of modern forecasting methods based on time series consists of combined forecasting methods. Such methods either include specific predefined forecast models or make it possible to include any models at the discretion of the analyst. Paper [13] tackles the development of such a combined forecasting method that integrates four different neural networks. The devised approach makes it possible to improve the forecast results obtained separately from each neural network. Study [14] reports a hybrid forecasting model that combines an exponential smoothing model and a short-term memory network. As a result of this combination, a hybrid hierarchical forecasting method was developed in the cited study. The development of the combined forecasting method based on the basic forecast models and expert conclusions is considered in [15]. The proposed method makes it possible to effectively combine the forecasting results obtained by using various methods, as well as make an amendment in accordance with the forecasts of competent experts. Paper [16] reports a hybrid method that uses a new CSA optimization method in the process of training an artificial neural network in order to improve its effectiveness. The use of this approach allowed for certain time series to avoid the problem of getting to a local minimum. A method that combines a linear regression model and a DBN neural network is given in [17]. The feature of those combined methods is that in the process of researching the time series it is impossible to change the set of basic models. That deprives the methods of flexibility and adaptability.
In [3], a combined model for constructing a forecasting scheme based on various basic forecast models is proposed, which makes it possible to take into consideration their results with different weights. The weights are calculated based on forecasting results in previous periods of time. Paper [4] reports a combined forecast scheme that makes it possible to take into consideration the conclusions by experts regarding future values of the predicted value. This method is advisable to use when a time series is affected by an external influence of a non-systemic nature, which is not reflected in the series itself. However, the selection of experts and the processing of their conclusions require the solution to additional problems. The devised methods for synthesizing predictive schemes based on basic predictive models, while making it possible to expand the set of basic models, do not include an apparatus for their preliminary analysis. Therefore, when using these methods, all predictive models remain under consideration at each stage while the results of their application are taken into account when calculating predictive values. In some cases, an increase in the number of basic models can lead not only to the growth of the computational complexity of the forecasting algorithm but also to a deterioration in the quality of the forecast.
Our analytical review [3][4][13][14][15][16][17] has shown that the combination of forecasts is the most effective approach to forecasting time series. However, the considered works lack the mechanisms for preliminary analysis and rejection of predictive models that are inefficient for the specified time series. Leaving into consideration and taking into account the results of the use of such models may cause a deterioration in the quality of the forecast. Thus, it is necessary to study the development of techniques to select more effective forecasting methods and to build their combination to improve the quality of the forecast.

The aim and objectives of the study
The purpose of this study is to devise a method for building an optimal model for predicting time series based on the principle of competition in order to improve the quality of forecasts. This would make it possible to automate the process of selecting the best forecasting models for the specified time series.
To accomplish the aim, the following tasks have been set: -to analyze the main aspects that accompany the process of solving a forecasting problem based on time series; -to devise an approach to the categorization of predictive models, in accordance with their accuracy for the specified time series; -to build a method for selecting and combining more effective predictive models to improve the accuracy of the forecast; -to experimentally verify the devised method.

The study materials and methods
A mathematical statement of the problem of forecasting time series is as follows [18].
Let a discrete time series be given without spacesv 1 , v 2 , …, v n , where n is the length of the series. The elements of the time series are the values for the studied quantity fixed at discrete time points. It is required to build a decisive rule F, which makes it possible to calculate the estimate of the forecast value in future periods, that is, to find  v n k + , such as: ,..., , 1 2 (1) where k * is the depth of the prehistory, k is the forecast step. Among the problems that need to be solved when solving a forecasting problem based on time series, the following can be distinguished: -the problem of determining the optimal value of the depth of the prehistory k*; -the problem of choosing a method to build a decisive rule (1); -the problem of choosing the quality criterion for the obtained predictive values.
The optimal prehistory depth value for the specified time series and forecasting step can be set by the owner of the problem or calculated using additional methods. A wellknown method employed to determine the optimal prehistory depth value for the specified series when forecasting in increments k is the auto-aggression method [1]. The linear autoregression forecasting model can be written using the where The algorithm for calculating the optimal depth of the prehistory involves the consistent solution of forecasting . The algorithm execution determines such a value of k * at which the forecast results would be the best according to the specified optimality criterion [1,3,15].
The task of choosing a forecasting method is key to solving the forecasting problem based on time series. Typically, a forecasting problem is reduced to an optimization problem, so, according to the «No free lunch» theorem [5], it is impossible to choose a single forecasting method that would ensure the best predictive values for all time series.
To assess the quality of the forecast, use one of the following criteria [2,19].
In the case when the forecasting problem is solved many times and there is a need to minimize the deviation of each specific predictive value from actual data, it is appropriate to choose the volatility of the forecast [20] as the quality criterion. Such problems are typically solved when predicting medical and economic indicators. Volatility can be calculated as the root mean square deviation of predictive values from actual data from the following formula (6) where The choice of a specific criterion for the quality of the forecast lies with the researcher or decision-maker.

5.
The results of devising a method for building an optimal model for predicting time series based on the principle of competition

1. Categorization of predictive models in accordance with their accuracy
Consider a forecasting problem based on the time series. Assume that for the specified time series v 1 , v 2 ,…, v n , the values of the forecast step k, the optimal prehistory step k * are fixed. We divide the time series into training and control parts, that is, we fix the value of n 1 , k * + k £ n 1 < n, starting with which we shall analyze the quality of the forecast.
Let m of the forecasting models M 1 , M 2 ,…, M m be selected. We shall perform forecasting and build a table for the specified time series (Table 1). Table 1 Forecasting results from different predicting models The task of constructing an optimal time series forecasting model based on the principle of competition is to select the «best» predictive models from the specified ones and build, on their basis, a new predictive model.
For the further analysis of predictive models, we shall consider quantities ∆ ij , which would show deviations of predictive values from the corresponding elements in the specified time series, and which are calculated according to the following rule: We assume that for the specified time series, the forecast model M j 1 dominates over model M j 2 , 1 £ j 1 , j 2 £ m if the following condition is met: Meeting condition (9) means that more accurate predictive values were obtained when using the model M j 1 , compared to values obtained when using M j 2 . Such dominance is denoted through M M j j 1 2  . We shall term the forecast model M j 1 dominant for the specified time series if it dominates over any other predictive model from a set of the specified models. That is, M j 1 is dominant if the following condition is met: The forecast model M j 1 shall be termed accurate enough for the specified time series if the following condition is met: where ε > 0 is a predefined number. The use of the introduced concepts could make it possible to implement the principle of competition between models and reject the losing ones in advance.

2. Building an optimal time series forecasting model based on the competition principle to improve forecast accuracy
Consider the pre-selected forecasting models M 1 , M 2 ,…, M m and forecasting results ( Table 1). The implementation of the competition principle implies a consistent analysis of Table 1 rows and the application of the following rules for rejecting the models: Rule 1. Reject models that are inefficient for the specified time series. We shall consider the model M j 1 ineffective for the specified time series if the following condition is met (12): Rule 2. Reject insufficiently accurate forecasting models. According to this rule, only those models for which condition (11) is met will remain in consideration, where ε is a predefined positive number.
After applying one of the specified rules or their combination, the following cases are possible: 1. There is no model left for consideration. This case occurs if the ε is small enough. Next, depending on the owner of the problem, it is possible to clarify the value of ε, that is, its increase, and return to Rule 2. In addition, in some cases, it is advisable to expand the set of forecasting models and return to Rules 1 and 2. 2. One model M j , j Î{1, 2, …, m} is left to consider, which is dominant. In this case, it is advisable to predict the values of a given time series using this very model.
3. There are several predictive models left to consider. Denote them via M 1 , M 2 ,…, M s , s £ m. If there are many models and there are no dominant models among them, then one can narrow down their list, for example by reducing the value of ε and applying Rule 2.
For the case when ε is small enough and the number of models s > 1, a method for building an optimal predictive model is proposed.
Solve |A| = 2 s -1-s optimization problems in the following form (14): ( ) values would determine which predictive models are included in the constructed optimal model G a * . That is, if λ aj * , = 1 the M j model, j s = 1, , is included in G a * , otherwise -it is not included, and the model G a * itself would be optimal for the specified time series.
As a result of applying the proposed method, it is possible to calculate the forecast value  v n k + as follows: x v The choice of a function optimization method (14) rests with the analyst.

3. Experimental verification of the devised method
For verification, a time series was selected with information about the volume of money transfers from 2000 to 2020 (n = 21) to Ukraine according to the World Bank [21]. After preliminary processing of forecasting results, a set of two predictive models was built: the auto-regression method (M 1 ) and the linear regression model (M 2 ) in steps of prehistory k * = 5 and the forecast pitch k = 1. During the study, the method of constructing an optimal predictive model with the following parameters was applied: s = 2, a = 3. In accordance with (13), (14), we built the following functions for different values of parameter n 2 , n 2 9 21 = , : Next, according to the devised method, the following optimization problems were solved for n 2 9 21 = , : The solutions to problems (18) were derived by using a genetic algorithm. The calculation results are given in Table 2.
To compare the results, forecast errors (4) and forecast volatility (6), (7) were calculated. The results are given in Table 3.
Thus, as can be seen from Table 3, as a result of applying the devised method, it became possible to reduce the forecast errors and improve its volatility. Thus, the actual time series shows the advantages of the method reported in this study with a minimum number of predictive models. Therefore, taking into consideration the features of functions (13), based on the principle of mathematical induction, it can be argued that even with more models it is possible to improve the results of the forecast.
The results of short-term forecasting of remittance volumes can be the basis for forecasting the levels of gross domestic product, as well as budget revenues in subsequent periods.

Discussion of results of applying the devised method
In the problems of forecasting time series, one of the decisive aspects is the choice of a method for calculating predictive values. This work reports a method devised for building an optimal model based on the principle of competition. The proposed method is based on the idea of constructing such a predictive model, which would include the best predictive models for the specified time series. Underlying the selection of the best models are the concepts of dominance (9), (10) and sufficient accuracy (11) of models introduced in the study. The resulting model is built as a combination of specified models (13), the parameters of which are calculated by solving optimization problems (14).
Unlike the methods of synthesis of the forecast scheme based on basic predictive models [3,4], when calculating (16), it is possible that not all basic forecast models are taken into consideration. The principle of competition implemented in our method will make it possible, for the specified time series, to leave only those models that give better results. That is, with its repeated use, the quality of the forecast would be no worse than in each of the specified models. Thus, as one can see from Tables 2, 3 when considering only two basic forecast models, there was an increase in the accuracy of the forecast and its volatility. It is also possible to improve the accuracy of the forecast by expanding the initial set of predictive models, which cannot be made by a hybrid method of exponential smoothing [14] or by hybrid neural network methods [16].
The use of the devised method in practice does not require the active work of analysts, unlike the application of methods of optimization of an ant colony [12] or neural network forecasting methods [9,10]. Using the concept of sufficient model accuracy (11), it is advisable to involve competent experts. However, the participation of experts, in this case, is minimal compared to the combined forecasting method [15] where experts are engaged to clarify the results of the forecast.
With the correct use of relevant software, the results of solving optimization problems (14), (15) finally set the optimal predictive model.
All this allows us to summarize that the devised method has advantages in that regardless of what basic forecast models are considered in it, the quality of the forecast for the specified time series could be improved. However, the expansion of a set of basic forecast models leads to an increase in the number of optimization problems (14) and the growth of their computational complexity. This may complicate the use of the developed method in practice and increase the requirements for software and hardware, with the use of which these problems are to be solved. The issue of further development of the apparatus for the categorization of forecasting methods in accordance with their quantitative characteristics for the specified time series is relevant. Rejecting models due to their inefficiency at the initial stages of building an optimal forecast model would simplify and speed up the process of solving the forecasting problem.

Conclusions
1. We have analyzed the main aspects that accompany the process of solving a forecasting problem based on time series. It has been noted that the stages that precede forecasting are the choice of forecasting methods and determining the optimal step of prehistory. To assess the quality of the forecast, it is ne cessary to choose a quality criterion. Typically, one of the known prediction indicators is chosen as the quality criterion. However, in cases where the maximum deviation of the forecast value from the exact one is more important than minimizing the overall error, the volatility of the forecast is used. Such a need may occur when forecasting in medicine or other social areas.
2. An approach to the categorization of predictive models in accordance with their accuracy has been proposed. As the criterion of the accuracy of models during their categorization, the absolute value of the deviation of the forecast value from the exact value is chosen. The concept of dominant and Table 2 Results of forecasting the time series «Volumes of money transfers» by various methods (USD billion) No.
Year 1  2000  419  -----2  2001  829  -----3  2002 1,192  -----4  2003 1,523  -----5  2004 1,873  -----6 2005 2,408 2,201. 3   sufficiently accurate predictive models has been introduced into consideration. The use of these concepts would make it possible, at the initial stages of analyzing the results of forecasting by different models, to implement the principle of competition among them by using the devised rules for rejecting methods from consideration. 3. A method for building an optimal forecast model based on the principle of competition based on the selection and combination of more effective predictive models has been devised. The application of the method makes it possible to reject the dominant predictive models from consideration at the initial stages of solving a forecasting problem. The constructed optimization models describe the method for determining weight coefficients for a more effective combination of forecasting results by different forecasting methods. 4. During the experimental verification of the devised method, a problem of forecasting the time series was solved, which contains data on the volume of money transfers to Ukraine according to the World Bank. It has been shown that the developed method made it possible to reduce the forecast error from 0.477 and 0.427 for basic models to 0.395 and to improve the volatility of the forecast from 1969.489 and 1974.002 to 1607.065.