FCTA: A Forecasting Combined Methodology with a Threshold Accepting Approach

*e combination of forecasting methods is a widespread technique. *e most common technique for ensembling several individual methods is scoring. *ese ensemble methods have been useful for designing hybrid forecasting time series methods in several areas. However, more precise applications are required in modern times, and hybridizations using several ranking approaches have emerged to solve this problem. *e main difficulty of this technique is finding the most suitable methodology to combine forecasting methods. *is work presents a new methodology named FCTA (forecasting combined method with threshold accepting) for ensembling several forecasting methods. *is methodology uses a *reshold Accepting algorithm for weighting individual predictions. FCTA starts from an initial weighting and aims to find the best ponderation of the individual methods by optimizing the precision of the global prediction. For testing FCTA, we selected a dataset taken fromM4-Makridakiscompetition, and we compared it with the best individual forecasting methods. FCTA is also compared with other successful methodologies. *e experimentation shows that FCTA surpasses the best M4 individual methods and is equivalent or better than the best methodologies of the area.


Introduction
Forecasting is a complex problem, and for a long time, the forecasting community has focused its research on finding better techniques by minimizing the prediction error. Nowadays, the common methodologies apply filters and ensemble the best individual methods in many areas [1][2][3][4][5][6][7], and among them, the two with the best performance are PP-MA [1] and LA [2] methodologies. e former uses a filtering stage and the Bayesian information criterion (BIC) to select the best forecasting models for each slot of the time series [1]; the second, uses a novel learning automata approach deriving two main ensemble algorithms named LA-SW and LA-MW [2]. Other ensemble methods are EMD-PE-ANN and LSTM-KF applied to wind speed and energy consumption, respectively [4,5]. Combining multiple forecasting methods involves selecting them and determining their best weights distribution [8][9][10][11][12][13].
An ancient method is scoring; it combines several forecasting methods [14][15]. On the other hand, selecting a single prediction method can be seen as a risk when the performance of the models and data vary over time [9], and it is better to use two or more individual methods in a combination. e Bates-Granger ensemble methodology (B&G) has strong foundations [16] and has inspired successful modern approaches [13,17], including the methodology proposed in this paper.
One of the enormous challenges in forecasting is to develop a method with high requirements: a large spectrum, well-performance in multiple scenarios, datasets from several areas (industrial, financial, and so forth), and for diverse forecasting horizons such as one period or n periods ahead. e motivation to develop the proposed methodology is to solve this problem. e M4 competition permits these scenarios for testing new methodologies, as is proposed in this paper. As a result, the M4 has become a benchmark and includes the forecasting results for one hundred thousand series, with the best prediction methods [18].
In this paper, we present the FCTA methodology (forecasting combined method with threshold accepting), which combines several forecasting M4 methods. e significant FCTA elements are its architecture and the TAE algorithm (threshold accepting-enhanced). TAE is an innovative optimization method that uses a reheat and golden ratio heuristics to improve exploration of the search space. e experiments using almost twenty thousand times series and M4 methods show that FCTA obtains better forecasting results than all the individual methods in the combination. Besides, FCTA has statistically equivalent or better performance than two of the best methodologies of the area. e paper is organized as follows. Section 2 contains a general description of FCTA and the metric error used to evaluate the performance of the forecasting techniques. In Section 3, we present related works about combining forecasting methods. Section 4 presents a detailed FCTA description, architecture, and TAE algorithm. Section 5 presents the experimentation process, dataset description, results, and analysis. Finally, in Section 6, we present our conclusions.

Materials and Methods
Despite many publications in the forecasting area, new methods are still necessary to predict future time series values more accurately [19]. e forecasting methods have mainly used two approaches. (1) Using the best individual algorithms, and (2) Combining several approaches (hybridization). e latter has become the most popular in the last years. is work is related to both approaches. Makridrakis-Competitions provides times series, which are currently used as a benchmark for evaluating the quality of forecasting algorithms. M4-Competition, in particular, provides one hundred thousand time series for this task. is section presents a general description of FCTA Methodology, which is tested using datasets from M4-competition.

Combination of Forecast with FCTA.
Combining several forecasting methods aims to obtain better accuracy than each method in the combination; individual execution models provide forecast values which are combined to obtain the final forecast [20]. A key issue is the adequate number of combined methods to produce the lowest prediction error. e best practice is to combine methods based on their individual performance [20,21]. e FCTA process is shown in Figure 1 where x k t is the time series k which the last element is in the period t. For instance, the dataset x 1 t , x 2 t . . . x 6 t has the six time series: F. In other words the set 〈x k 1 |x k 2 | . . . x k t 〉 represents the data in the period 1, 2, . . ., t for the kth element of this dataset.
Our methodology requires selecting the best k methods for any dataset of the area. e selected individual methods are named in Figure 1 as M1, M2 . . .Mk, and f 1 , f 2 , . . . f k representing the predictions of these forecasting methods.
en FCTA obtains k estimations in h periods in the future, which are represented by Y t+h (M1), Y t+h (M2), ..., Y t+h (Mk). e weight estimations process is described in detail in section 4.2.3. is process obtains a ω j weight for each method. ese weights are averaged in a combination process of Figure 1 to produce the initial forecasting for each time series. Nevertheless, this prediction does not have, in general, a better prediction than the individual methods.
us, a refined algorithm, named TAE ( reshold Accepted Enhanced) based on the threshold accepting algorithm [22], is applied and presented in another section. e combined forecast F t+h can be obtained as a function of the k individual predictions of the best methods, where an initial ponderation ω k is assigned. Nevertheless, obtaining this function is not, in general, an easy task, although a simple weighting function for pondering the individual predictions is commonly used. On the contrary, as mentioned before, in FCTA, we refine the F t+h prediction, which is done by the TAE algorithm.

Forecasting Metrics.
e error metrics are used to estimate the quality of the forecasting methods; the most common are MAPE, MASE, and sMAPE [23][24][25]. e sMAPE metric is a variation of MAPE commonly used in M4-Makridakis competition; thus, we use this metric which formula is shown in equation (1) sMAPE where Y i is the current observation of the time series; the variable Y i represents the predicted value, n is the amount of data in the time series, m is the time interval between successive observations considered, and h represents the length of the forecast horizon.

Related Work
Combining forecasting using weighs was proposed by Bates-Granger [16], as in our model, weights are established for all the individual methods. e weights are determined according to the variance of the errors of the individual methods [14]. B&G determines the weights using the correlation between the variance of the errors of the individual forecasting methods in the combination. is method can be applied to several methods in the combination. When there are only two methods, weights ω k , and 1 − ω k should be assigned to the first and second method, respectively. e combined method with this strategy does not necessarily produce a better prediction than the best individual method. However, these weights should be modified to enhance the combined forecasting. B&G established that the best combination of individual methods is obtained when [16]: (a) e combination produces the lowest error (b) e total variance of the error is as low as possible e above methodology was applied many times for the one-day-ahead [2,5] and larger forecasting horizon [4,14,[26][27][28][29][30]. Some methods are relatively easy to be implemented, but most of them require adjusting their parameters for different applications [1,2]. Furthermore, a linear combination does not necessarily surpass the prediction of the best method in the combination [31]. As a result, the forecasting community proposed many alternatives [18]: (a) determine the weights using Monte Carlo Methods with a distribution density probably defined by the variance matrix of the combination, (b) to use only the diagonal variance values as a factor for obtaining enhanced weights. Some authors have used the latter ideas for large datasets. Specifically, in [9], the authors used weighting ponderation in time series taken from the competitions NN3 [3] and NN5 [32]. According to the experiments with enhanced weight, a pool of methods obtained better results than individual methods [9]. Also, the authors apply clustering and classification, and they use a large set of features in a decision tree. ey determine which features are essential for selecting methods in the combination. We note that the best combination is usually obtained when the best individual methods are used and when the combination has the most diverse approaches [2,3]. For example, Jaganathan and Prakash propose two forecasting combination approaches methods based on [33]: (a) historical evidence of well-evaluated methods inspired in Uniform weight distribution [34] and (b) weights optimization [33]. Jaganathan and Prakash took 24 forecasting methods from several sources to design a combination that surpassed most of the M4-Competition methods. Table 1 shows some of the most relevant related works regarding the used technique, performance metrics, benchmark, advantages, and disadvantages of the work.

Threshold Accepting
is section reviews the TA technique and its extension TAE within the FCTA methodology.

Basic reshold Accepting.
e threshold accepting (TA) algorithm proposed by Dueck-Scheuer has been applied to solve NP-hard optimization problems from different areas.
TA is a variation of simulated annealing and, likewise, represents an analogy of a thermodynamic process, and it has the following elements. In the TA algorithm, the objective function proposes to find the closest solution to the optimum. TA randomly seeks a new solution in the search space, accepting it when the objective function is enhanced. is algorithm consists of two loops: (i) e external loop: it is controlled by the temperature parameter that varies from the initial to the final temperature. e former is too high (for instance 100, or 1000), and the latter is too small (close to zero). (ii) e internal loop: this loop commonly increases the number of iterations with a fixed or variable rate, called beta in this paper.

A Detailed Description of FCTA Methodology.
FCTA is a methodology for calculating the best weight distribution of individual forecasting methods into a combination of forecasts that minimize a metric error.
First Combination e problem of obtaining the best combination of M individual forecasting methods for the period t + h can be mathematically described by the optimization model of

Select methods
where E is the estimated error for the combined forecasting methods; ω i � (ω 1 , . . . , ω M ), and.
gives the forecast for the period t + h of the M i method. All the individual methods predict h periods in the horizon whose size depends on the dataset (Yearly, Quarterly, Monthly, Weekly, and Daily). Time series used in this work were taken from the M4-Makridakis competition [17].

FCTA Architecture.
e architecture FCTA methodology is described in Figure 2, which was designed for testing FCTA for any application area of the M4 competition. e forecasting methods are previously executed for all Randomly generate a current solution x new εX (4) while convergence � false do (5) for i � 1: n Steps do if ∆ ≤ e, or k ≥ N max , convergence � true. (12) end while (13) x sol � x old ALGORITHM 1: Classical threshold accepting. 4 Mathematical Problems in Engineering the time series, and their errors are stored in a dataset named SFM (Set of Forecasting Methods). First, we have two databases: (a) the forecasting methods of the area and (b) a dataset with the time series requiring a forecast. As is typical, each time series is divided into three sections: Training, Validation, and Testing. For each time series, the process Selection determines the quality of the methods ranking them from best to worst. is ranking is stored by Selection in the Dataset as attributes of each time series. us, the best methods for each time series are determined; also, the average error and standard deviation for each time series are calculated in this process.
Weighting is a process that calculates an initial weight for each k method. is process uses two strategies: Uniform (FCTAU) and Standard Normal (FCTAN) distributions. ese weights are calculated and stored in the X o vector, which is an initial solution for the TAE algorithm. e TAE process determines the best ponderation for each method. Both Weighting and TAE are explained in other section.
Finally, TAE obtains the optimal weight distribution to determine the Combined Forecast of the selected best methods. is final forecast is computed using the Testing part of the time series. en the error metric for the final forecast is obtained, and the process is finished. Figure 3 shows the sequential diagram for FCTA, which order the actions as is described as follows: (i) e actor asks "Selection" to start the process with some options. en, "Selection" requests to DataSet for the subset of time series (subdivided into training, validation, and test data), which are returned to it; "Selection" also demands SFM for the metric errors, which are returned to it. (ii) Selection" sorts the best k methods and sends them in a priority vector with their initial weights. "Weighting" uses one of two distributions (Normal or Uniform) to obtain an initial weighting vector named X 0 and sends it to TAE; X 0 has the first ponderation of the methods. (iii) TAE obtains the data for validation from the DataSet, with X 0 and the TAE optimization process enhances the ponderation. en, TAE obtains the forecasting values and metric errors for the testing part. Finally, TAE sends the results to the actor.

Selection of the Best Methods.
FCTA selects the best methods for each time series with the process " Selection" of Figure 2. is process works as follows: Step 1: the performance of each method (according to the metric error) in the validation set validation is previously stored in the SFM repository.
Step 2: the individual methods of Step 1 are ranked according to their metric errors for each time series. e order is stored in SFM in a ranking vector. e methods in this vector are named BestM 1 , BestM 2 , . . . BestM k , . . . BestM N .
Step 3: the best N methods, with the lowest metric error, are chosen by Selection process.
To include several methods in the combined forecasting, Selection uses the Include Process shown in Algorithm 2. First, this algorithm starts (line 1) with a Ranking vector which has the best N methods arranged in priority order (BestM 1 , . . . , BestM k . . . BestM N ). In line 2, the algorithm selects the two best methods ( BestM(1), BestM(2); this list is increased if the subsequent best method is not worse than the latter in the list in a φ small value previous tuned (line 6); if this condition is accomplished a new best method is added to this list, and the number of the best method is increased by one (line 7); the latter method in this list is consistently identified as the best current method in line 8 or BestM(current); when the last condition (in line 6) fails the Boolean variable named include takes the false value in line 9 and the process is finished. Include Process continues selecting a method until the stop criterion (include � false) is applied. is criterion depends on the threshold φ defined in the tuning process.
To find the best weights for the combined forecast, we define a vector of weight is vector is an initial solution for pondering the forecasting methods ((1, 2,&, m)) in the combined forecasting. e process Weighting in Figure 4 uses the Uniform and Standard Normal distributions for defining this X o vector. For the first case, the process simply assigns the same weight to each method. e second case is explained in the next paragraph. Figure 4 shows that the Weighting process receives for each time series the following information previously generated: the forecasts and metric errors. Furthermore, this process reads the average and standard deviation of these metrics associated with each group of time series. For the Standard Normal distribution: a population of metric errors is used for each group of time series, where several samples of metric errors are taken. All the samples are characterized by their average error. As is well known, when the number of samples is large enough, they follow the Standard Normal distribution. en Weighting determines the mean µ of these average errors and its standard deviation σ. At this point, it uses the Standard Normal distribution to normalize the metric errors by using Z-score values determined by the well-known relation Z i � e i − μ/σ; where, e i is is the average of the forecast error of the method M i ; μ is defined as the mean of all the average errors methods in the entire dataset; and σ is the standard deviation of all the e i s, for the Z i values area under the normal distribution curve is easily determined.
By definition, the total area under the standard curve represents around 100% of the probability related to this distribution, as shown in Figure 5. erefore, in our case, we need to find out what percentage of the probability represents the area under the curve for each average error to obtain the partial weight. us, we apply formula (3) for obtaining that we name the partial weights for each method Pw I . ey are named partial weigths, because they are not  the final weights; this is because, in general, they do not satisfy the constraint in the optimization model defined by equation (3).
where A i represents the area under the curve for each method in the combined forecasting, and A i represents the sum of all the areas under the curve for these methods. In formula (3), the number one on the right-hand side represents the total area under the standard curve. In Figure 5, we give an example, where the area under the curve is divided in 1σ, 2σ, and 3σ; it is obvious that Pw i is different from one. e final process consists of determining the final weights Fw i . First, having the partial weights, we normalize them by Fw i � Pw i / Pw i . On the other hand, the initial weights can be determined by replacing the normal distribution for the Uniform distribution, and a similar process is followed. en, Weighting process provides an initial solution to the TA algorithm.

TAE Algorithm.
e proposed TAE algorithm is shown in Algorithm 3, and some of the strategies incorporated in this algorithm: roulette, memory, cooling scheme, reheat, and the thermal equilibrium to be explained in subsequent sections.
TAE uses the parameters: e variable X o , contains the weights of the method in the combination and is provided by the Weighting process (line 1). First, the following parameters are initialized T k , X old , α, Φ (lines 2-3). e temperature parameter controls the external cycle (lines 4-33), while the internal cycle (lines 6-28) by the number of iterations (which in our case is variable); the parameter L k determines this number of iterations. e first procedure is to generate a new feasible solution using the initial solution X o stored in X old . A random number is used by the Roulette and Memory methods (lines 8 and 10). e new solution X new . is determined by applying a perturbation function to X old . en, an energy calculation is performed (line 12). TAE obtains the energy E k with the sMAPE, E 0 with X o and the subsequent with X k . e ensuing process in the sequence is the ΔE calculation (line 13), which is the difference between the energy of the current and candidate solution. erefore, we subtracted the error of the current combined forecast from the new one  (2); BestM(next) � BestM(k); (4) include � true (5) while include � true//Next best methods Selection (6) ifBestM(current) − BestM(next) ≤ φ, then (7) add BestM(next); k � k + 1: Mathematical Problems in Engineering hand, If k ≥ L k , the inner cycle ends, and the parameters are updated: the cooling speed, (α parameter) in line 29 and a first final temperature with the Φ parameter; in line 30, the temperature with T k+1 � α * T k , the threshold tolerance Tol k , and the L k parameter with the β value (line 30). e reheat strategy is applied when stagnation is detected. In the external cycle, the slope is calculated to activate the stop criterion is activated in line 32. Lastly, the process is finished when the stop criterion is accomplished. e TAE main processes are described in Section 4.2.5. e variables and parameters in the TAE algorithm are as follows: (i) e initial parameters: T initial : initial temperature;

Generating a New Solution in TAE.
e new solution is generated following one of the two methods: the roulette and memory methods. ey are explained in the following paragraphs.
Roulette Method. Having an X k vector or weight configuration, the subsequent vector X k+1 is determined by the Monte Carlo method as follows: Firstly, the process starts with the initial solution X 0 which is a vector of the weights in the combination X o � (ω 1 , ω 2 , . . . , ω i . . . ω j . . . ω m ). TAE determines the intervals for the weights in the initial solution X 0 , and subsequent solutions. For instance, for five methods X 0 � (0.30, 0.15, 0.20, 0.25, 0.10), the five intervals are defined with the ranges: 0 < w i ≤ 30; 30 < w i ≤ 0.45; 0.45 < w i ≤ 0.65; 0.65 < w i ≤ 0.90; 0.90 < w i < 1.0.
Secondly, the next process consists of generating a new X k+1 solution; due to the condition that the summation of the weights should be one, the new weight must satisfy this condition.
us, if the algorithm removes a portion (quantum) of weight from one method, it should compensate this portion on another weight. Two random numbers are generated in the range [0, 1]; the first identifies the method for adding a value, while the second corresponds to the method for subtracting this value ( Figure 6).
Memory method. In this case, the algorithm has a structure named "memory" that stores the algorithm's last five iterations movements.
is structure allows verifying in the last movements those methods that have enhanced the metric error for the optimal solution. As well as in the roulette method, the process starts with a solution.
Firstly, an average of the last five movements is calculated and stored in the memory. Secondly, with the average previously computed, it is evaluated which method is beneficial for adding a quantum of weight and which method is convenient to decrease a quantum value of weight.

Energy Calculation in TAE.
e TAE algorithm is analogous to the classical Golden Ratio Simulated Annealing (GRSA), which minimizes an energy variable at each temperature [35]. Usually, the algorithm determines this energy with the current state solution, and at the beginning of the process, it commonly has a high value. At each step, with a new solution, its new energy is determined. e energy value of a solution determines its probability of being accepted as a current solution. When the temperature is high, the algorithm accepts almost all the new solutions, even if they have a high error. When the temperature is low, the algorithm accepts only a few solutions in which energy has not been decremented. As in TA algorithms, the energy defines the search space of the next iteration. As the energy variable is reduced, the search space is reduced too. A new energy value is evaluated in TAE with a metric error commonly used in M4 forecasting evaluations: the sMAPE. In this case, the combined forecast value is given by where X new � (ω 1 , ω 2 , . . . , ω i . . . ω j . . . ω m ) has the new weights for pondering the individual forecast f t1 , f t2 , . . . f tn for the n chosen methods. In TAE, the difference between the current and new energy permits the algorithm evaluation if the current iteration produced a good or bad movement in the optimization process.

Cooling
Scheme. TAE can be improved using the Golden ratio (GR or Φ) technique. In a search process, GR is a parameter used to divide the searching space into several GR sections; in Simulated annealing and reshold heuristics, GR is a parameter for dividing the temperature cycle; each section has different initial and final temperatures [35]. e search strategy used by GRSA performs faster searches in every GR section. is Φ constant (or aura parameter) divides the temperature interval into segments, and in this way, the search space is faster explored. We used the geometrical cooling scheme, T k+1 � α * T k , where T k and T k+1 are the current and new temperatures, respectively. e α parameter is known as the cooling factor, and it is in the range 0.7 ≤ α < 1. In the first GR, α is small (α � 0.7), then the temperature decreases rapidly. In contrast, in subsequent GRs, α is growing, and the explorations are more and more slowly; the last GR section has an α value close to one, and the acceptation criterion becomes very strict. is cooling factor variation allows decreasing the temperature more slowly when the temperature is closer to the final temperature. e temperature T Φ is modified, using the golden (1) TAE parameters:(T initial , T final , α, L k , β, X 0 , E 0 , F t0 NonImprove, elitism, slope) (2) Parameters initialization:  (5) if (NonImprove � � MaxΥ) then Reheat (T k ) end if (6) whilek <L k //Internal cycle or Metropolis Cycle (7) if elitism < MaxΕ then (8) memory � UpdateMemory (ΔE, X old , X new ) (15) ifΔE < 0 then (16) X old � X new (17) ifE new < E best then (18) Best � (E new , X new ) (19) end if (20) Else (21) ifΔE ≤ Tol k then (22) X old � X new (23) ifE new < E best then (24) Best � (E new , X new ) (25) end if (26) end if (27) end if; k � k + 1 (28) end while (29) Tf � T k * Φ; Up da te Cooling Spee d(α, Tf);  Mathematical Problems in Engineering 9 number Φ, the search space to find the optimal solution is reduced when the GR strategy is used to define the cooling scheme. Figure 7 shows the sections where the rates of temperature decrease change, thus decreasing the number of iterations of the algorithm to arrive at the optimal solution.

Reheat Strategy for TAE.
Another strategy used in TAE is Reheat (RH) [36]; in RH, the current temperature T k is restarted at an earlier value if the algorithm does not improve its quality during a determined number of metropolis cycles. e algorithms restarts the temperature to explore more solutions from the search space. In TAE, the RH is applied in the last GR section, and when detects stagnation condition; this is performed when for some iterations (ten is common), a significative improved was not achieved (MaxΥ � � 10 in lines 3 and 5 of Algorithm 3). e RH process is started when this number is reached (line 5 of Algorithm 3). en, the RH process is repeated a maximum number of times (commonly three times). After this number, TAE is normally executed until the stop condition is reached. e HR strategy permits the algorithm to escape from local optima, explore more solutions, and avoid premature convergence. Figure 8 shows some elements of the RH strategy.

ermal Equilibrium in TAE.
e dynamic equilibrium of a TA algorithm is the metric that expresses when the current temperature (T k ) has reached a value very close to zero, indicating that the search is finished. e dynamic equilibrium in the TAE algorithm is achieved when two conditions are satisfied: T k, < T min or when slope < Minς. erefore, the In Figure 8, reheat algorithm calculates the slope of the curve in each iteration. e minimum slope curve value is Minς which indicates that the thermal equilibrium has been reached. At this point, the end of the search is determined. Figure 3, the FCTA execution time depends essentially on its elements selection, weighting, and TAE, which complexity classes for the worstcase are the following:

TAE Complexity. As is shown in
For selection: O(k log k) is due for sorting the k best methods, and O(k) for selecting the best methods that will participate in the combination.
For weighting: O(k) for pondering the k methods, and O(1) for storing the weights in the priority vector and sends it to TAE. us, complexity of Weighting is O(k).
For TAE: O(n 2 + n)log n), where n, is the number of temperatures, that is the complexity class for the threshold accepting algorithm, even for the multi-objective Case [37,38].
FCTA is based on pondering methods as B&G, which performs similar tasks, except that the latter does not have an enhancing stage as TAE. In other words, TAE provokes an overhead which complexity is after the big-O reduction: O(n 2 log n).

Experimentation and Results
is section evaluates the combined forecast performance using the weight distribution with the FCTA methodology.

Dataset Description.
e dataset used corresponds to some of the M4 competition series. e Makridakis M4 Competition contains one hundred thousand time series. It is built from different public domain sources, such as industries, services, and exports, [17]. e time series are divided into six groups with different frequencies: Yearly (Y), Quarterly (Q), Monthly (M), Weekly (W), Daily (D), and Hourly (H). Due to the extensive length of this dataset, the time series can also be divided into six types: demographics, finance, industry, macro, micro, and other. e criteria for selecting a representative subset of this data for testing require at least two hundred fifty until one thousand observations and are shown in Table 2.
In each frequency, the time series have different types. erefore, the hourly group was not selected because it contains only time series of type Other. At the end of this table, there are two final columns named size and percentage (%). e first refers to the number of selected series in each frequency group. e last column is the corresponding percentage of time series selected relative to the total.

Experimentation Environment.
e Experimentation Environment used to run the FCTA methodology is done using the R language. e hardware configuration used for processing all FCTA components is displayed in Table 3.

Experiment I: FCTA versus M4 Competition Methods.
e experiment consisted of applying the proposed FCTA methodology and forecasting the future values of the selected time series of the M4 Competition. We define two scenarios: Scenario A. Individual forecasting methods in the combination compared to FCTA. Scenario B. Performance of FCTA for different frequencies of the dataset (Y, Q, M, W, D). e experimentations is explained as follows: (i) e experiment combines the best forecasting methods to forecast future time series values using one of the two weight distribution techniques (Uniform or Standard Normal) (Figure 2), which is optimized with the TAE algorithm. (ii) Each time series of the selected subsets of the M4 is divided into three parts: Training, Validation1, and Validation2, as shown in Figure 9. e test portion described in the figure is unknown to the algorithm, as it is common to corroborate the final forecast.    (vi) Finally, the best combination of weights and the best forecasting methods are applied using the historical time series to forecast the Test portion.
e fourteen methods used in the experiment are described in Table 4. e first twelve methods are available in [39] while the last two methods, FFORMA [13] and Jaganathan [33] are in M4-Competition. e optimization process uses the proposed TAE algorithm, which we observed in Algorithm 3. As shown in Table 6, the results of this experimentation present all the 14 individual methods, including [13,33], used for the ensemble. e results of the above methods are contrasted with the proposed methods' results: FCTA and Bates Best (BAB). We designed the latter based on the classical B&G. methods. e results indicate that, on average, FCTA has a lower average error (despite the weight distribution chosen) than the best individual method for each series in all of the subsets used. However, in the monthly subset, the difference between the average error of the best individual and FCTA is very little. Because of this, to validate the obtained results, two statistical tests were applied to them: the Friedman and Wilcoxon tests. ree plots have been developed to view the results from another perspective. e first plot ( Figure 10) shows a comparison between FCTA using a Uniform weight distribution (FCTAU), and FCTA using a Standard Normal weight distribution (FCTAN), and the reference methods. en, in Figure 11, the three proposed methods (BAB, FCTAU, FCTAN) have been compared. Finally, in Figure 12, we have selected the three best methods from all fourteen to compare them with FCTAN, FCTAU, and BAB.
We observe in Figures 11 and 12 that the BAB method increases its metric error when the horizon is higher than fourteen.
us, we recommend using BAB method only when the horizon prediction is small. On the contrary, FCTAU and FCTAN have consistently obtained a good performance, considering them in the following experiments. e analisys of FCTA in the two scenarios produced the following observations: (1) FCTA produces better results than the forecasting methods in the combination; (2) FCTA produces excellent prediction results for all the frequencies in data sets (Y, Q, W, D) except for monthly series.

Statistical Tests.
Friedman's nonparametric hypothesis test seeks to test the differences between groups (three or more paired groups) when the same parameter has been measured under different conditions on the same subject. Wilcoxon, also a nonparametric test, seeks to find significant differences between two specific groups. Since Friedman's test does not give the average range for each group, the idea is to run the Friedman test using all the individual and proposed methods, and then run the Wilcoxon test with the top two frequencies. e results of statistical tests using Standard Normal weight distribution are shown in Table 7.
According to Table 7, Friedman's test indicates that with 99.9% certainty FCTA is the best method compared to all individuals in Y, Q, M, W , and D subsets. To verify how significant, the difference is between the best and the secondbest forecast methods, we proceed to perform the Wilcoxon test.
e results indicate that the FCTA is statistically equivalent to Bagged for the Y set in this second test. However, in the other subsets, FCTA is statistically superior to the second with 99.9% certainty. Also, we can observe the results of the statistical tests when we use Uniform weight distribution. Friedman's test indicates that with 99.9% certainty FCTA is the best method compared to all individuals in Y, Q, M, W , and D subsets. e Wilcoxon test was executed to verify the best and the second-best forecast   Table 4). e methodologies comparison are FCTA (with FCTAU, FCTAN); LA (with LA-SW and LA-MW) [3]; PP-MA [2]; and BIC (with BICU and BICN). BICU and BICN are methods that make the selection of the individual methods that will be combined according to the measure of the BIC and optimize the weights assigned to each of these methods using the proposed reshold Accepting Enhanced algorithm (TAE) In this experimentation, only LA algorithms do not use TAE algorithms for enhancing their weights. e experiment uses the first 30time series of each group obtained by the filtering process shown in Table 2.
is experiment evaluates the forecast combinations strategies in terms of the quality of the final solution and the time to obtain it. Each combination methodology is executed using the same set of individual methods and the same set of time series. e differences consist of how the methodologies explore the time series and combine the individual methods. e experiment consisted of testing for each methodology its one-day-ahead forecast and the n-day-ahead forecast (determined with the same individual methods). e sMAPE error average results for the 150 time series used in the analysis are shown in Table 8. e first row presents the results for the one-day-ahead horizon, while the second row presents the results for the n-day-ahead horizon. Finally, the final row shows the average execution time in seconds to process the 150 time series. e results presented in Table 8 indicate that, on average, FCTAN has a lower average error than the other ensemble prediction algorithms in both forecast horizons (H1, Hn), followed by FCTAU in H1 horizon. In Hn, the second and third places are for FCTAU, and BICN, respectively.
Concerning execution times, the different FCTA variants have a shorter time than the LAs variants and PP-MA. To validate the results, two statistical tests were applied: the Friedman and Wilcoxon tests shown in Table 9. Table 9 shows the Friedman and Wilcoxon tests, where the first column shows the horizon, which can be 1 or n. e second and third columns show the result of the Friedman test, the methods ordered from best to worst, and the percentage of certainty that there is a statistical difference among those methods. Finally, columns fourth and fifth show the result of the Wilcoxon test between the most relevant methods identified by the Friedman test and the percentage of certainty of statistical difference.
According to Table 9, FCTAN shows the best performance regarding the Friedman test for both horizons. Additionally, the percentage of certainty that there is a statistical difference among the methods is 99.4% and 100% Jaganathan JA e classical Jaganathan method [33] Other methods used in this comparative are the reference models described in Table 5. Bates BAC Classical B&G [16]: it uses the (AA) method and the (HO) method e sum of negative ranges is larger than the sum of positive ranges; the sMAPE error of the FCTA method is smaller than the BICN method. On the other hand, the p-value equals 0.198 (see Table12), showing that both methods have the same statistical performance. Table 11 shows the Wilcoxon test results applied to FCTAN and  BICN forecast methods. e sum of negative ranges is larger than the sum of positive ranges. erefore, the sMAPE error of the FCTAN method is smaller than the BICN method. Finally, the p-value equals 0.002 (see Table 12), indicating that both methods have a statistically significant difference.
us, according to the Wilcoxon tests, there is no significant difference between FCTAN and BICN in H1.
In Hn FCTAN outperforms the other methods. Finally, to verify the quality of the FCTA, we use the metric average [2], but we use sMAPE with equation (5). Figure 15 shows         Figure 15: Error ratio of the proposed FCTAN compared to other ensemble prediction algorithms.
Mathematical Problems in Engineering the error ratio of the best-proposed combination methodology FCTAN compared to other ensemble prediction algorithms; according to this metric, FCTAN has the best performance than all the other methodologies of the comparison.

Conclusion
In the forecasting area, enormous defiances are related to improving the ability to obtain good forecasts in various scenarios where the data sets are coming from diverse areas to obtain good predictions for n periods ahead in the horizon. is work presents the FCTA forecasting methodology for time series from different scenarios, which can forecast n-periods-ahead. e FCTA architecture and sequence diagram are included for supporting future applications. e proposed methodology, as in previous works, assigns weights to the individual forecasting methods in the ensemble. FCTA, has two implementation modes: (A) initial ponderation, and the enhanced stage are both performed with FCTA techniques and (B) initial ponderation comes from another methodology, but it is enhanced with FCTA techniques.
e first mode has produced FCTAU and FCTAN. e second mode produced BICU and BICN. ese methods were tested with datasets taken from M4-competition, and hypothesis test were performed.
FCTAU and FCTAN were compared in a first experiment with the best reference methods of M4 and using almost twenty thousand time series from several areas. In one-period-ahead, and n-period-ahead, FCTAN surpassed all these methods. Besides, in a second experiment, FCTA methods were compared with those of the state-of-the-art: LA, and PP-MA. e experimentation for one period, and n-periods-ahead, shows that FCTAN obtains the best results followed by FCTAU. e analysis of the results for the methods produced by FCTA in the second mode, BICU, and BICN, for one-period-ahead show the following ranking: FCTAN, BICN, FCTAU, BICU. For n-periods-ahead, the ranking is FCTAN, FCTAU, BICN, and BICU. erefore, BIC hybridized with FCTA obtained best results than the state-of-the-art methods. Consequently, FCTA is a good methodology and can be hybridized with other methods with the condition that they can produce good rankings of individual forecasting methods. us, FCTA is a significant contribution to the ensemble forecasting area.

Data Availability
All data generated or analyzed during this study are included in this article.

Conflicts of Interest
e authors declare that they have no conflicts of interest.