ENHANCING SALES FORECASTING ACCURACY THROUGH OPTIMIZED HOLT-WINTERS EXPONENTIAL SMOOTHING WITH MODIFIED IMPROVED PARTICLE SWARM OPTIMIZATION

The Holt-Winters Exponential Smoothing method utilizes three smoothing parameters, namely alpha (α), beta (β), and gamma (γ), which have a significant impact on the accuracy of the forecasting process. One of the main challenges in the Holt-Winters Exponential Smoothing method is to find the best combination of the smoothing parameters, α, β, and γ, to achieve optimal forecasting accuracy. In this research, the MIPSO optimization method is used to find the optimal combination of values for α, β, and γ. The sales data used in the study covers the period from January 2021 to May 2023. The research results indicate the best accuracy achieved by combining the Holt-Winters Exponential Smoothing algorithm with the MIPSO optimization algorithm during the data period from January 2021 to May 2023, with a MAPE value of 9.1717%. Therefore, the use of the MIPSO algorithm helps discover the optimal combination of α, β, and γ parameters for forecasting.


INTRODUCTION
In the business world, accurate forecasting helps companies increase customer satisfaction, reduce product damage, boost revenue, and enable more effective production planning [1]. Forecast optimization is crucial as it allows companies to make more precise and efficient business decisions. By employing the appropriate methods, companies can anticipate the demand for their products or services in the future, enabling them to plan better for production, inventory, and other resources.
In a lot of situations, forecast optimization can help businesses cut costs where they don't need to and improve productivity. For instance, if businesses can estimate demand more precisely, they can avoid spending excessive amounts on unsold goods. Furthermore, forecast optimization can help businesses make long-term strategic choices. Companies can create better strategies for their future business growth and development by comprehending historical trends and patterns and applying relevant models to maximize projections.
The choice of a forecasting technique is intimately related to the patterns seen in the data of an organization. Horizontal data patterns, seasonal data patterns, cyclic data patterns, and trend data patterns are a few examples of these patterns [2]. When the data values oscillate around a constant or steady average value, which is also referred to as being stationary with regard to its mean, this is referred to as having horizontal data [3]. When data patterns recur after a certain amount of time, such as daily, weekly, monthly, quarterly, or annually, they are said to exhibit seasonal patterns [4]. Cyclical data patterns are influenced by a condition that occurs periodically, typically over a span of several years, such as long-term economic fluctuations [5]. On the other side, trend data patterns appear when data gradually changes over a longer time period, either in the form of an increase or decline [6]. Grey-Markov is an illustration of a forecasting approach for horizontal data patterns [7], whereas Holt-Winters Exponential Smoothing is appropriate for forecasting with seasonal data patterns [8]. Additionally, trend data patterns can be applied with the double exponential smoothing technique [9].
This study makes use of sales information from a retailer in Bali Province that spans the months of January 2021 and March 2023. Typically, Bali's retail businesses rely on tourists to boost their sales. The increase of visits during vacation and festival times generates more revenue. On the other hand, fewer people come after the holidays and festivals. The resulting data pattern is seasonal as a result of these visiting patterns. Therefore, Holt-Winters Exponential Smoothing is the forecasting technique employed in this work [8].
The determination of the three smoothing parameters used by the Holt-Winters exponential smoothing approach, alpha (α), beta (β), and gamma (γ), will have an impact on the forecast's accuracy [10]. The main challenge in the Holt-Winters Exponential Smoothing algorithm is determining the optimal smoothing parameters, alpha (α), beta (β), and gamma (γ), in order to achieve the best forecasting accuracy. In the study conducted by Pondatu et al., the process of finding the optimal values of alpha (α), beta (β), and gamma (γ) involved assigning the same values to each smoothing parameter within the range of 0 to 1 with a step size of 0.1 [11].
Another study on sales forecasting using the Holt-Winters Exponential algorithm method was conducted by Anis Zubair and Rauda Umamit. In their research, the values of alpha (α), beta (β), and gamma (γ) were randomly determined until an accuracy of less than 10% was achieved. [12]. The genetic algorithm and Particle Swarm Optimization (PSO) are two often used optimization techniques to optimize a value. Due of its benefits over other optimization techniques, the genetic algorithm is a well-known and commonly utilized optimization algorithm. The capacity of genetic algorithms to optimize difficult problems with a large search space is one of its key benefits. [13]. A disadvantage of genetic algorithms is their high computational complexity. This is due to the activities involved in each generation of genetic algorithms, which include population duplication, crossover, mutation, and fitness value evaluation. The problem causes lengthy processing times [14]. In addition to the Genetic Algorithm, another optimization algorithm that can be used for the optimization process is Particle Swarm Optimization (PSO). PSO is an optimization algorithm inspired by the collective behavior of animal groups such as flocks of birds or schools of fish. In PSO, a group of particles iteratively moves through the search space, seeking the optimal solution based on information from the best particle in the group [15]. The Modified Improved Particle Swarm Optimization (MIPSO) technique is one of several optimization algorithms that can be used to get the ideal values. The MIPSO algorithm is an enhancement of the Particle Swarm Optimization (PSO) algorithm, and it has been shown to yield more optimal results compared to other optimization methods such as the Genetic Algorithm [16].
In this research, the researchers combine the MIPSO optimization method with the Holt-Winters Exponential Smoothing forecasting method. The aim of this combination is to find the optimal values of alpha (α), beta (β), and gamma (γ) in the forecasting process. By combining the MIPSO optimization method to search for the best combination of smoothing parameters, the researchers expect to achieve better and more accurate forecasting results. This improvement is anticipated to support more precise and efficient business decision-making.

METHOD
This research aims to optimize the parameters of the Holt-Winters Exponential Smoothing algorithm using MIPSO by utilizing daily total sales data from January 2021 to May 2023. The general stages of the forecasting process conducted in this study are illustrated in Figure 1.  Figure 1 shows that the normalization of the data occurs before the forecasting optimization. Data normalization aims to change the data so that its range consistently falls between 0 and 1 [17]. To do this, divide each value by the difference between the maximum and minimum values after deleting the minimum value from the data [18]. Min max normalization calculation is shown in equation 1.
In order to facilitate data comparison and interpretation, data normalization also aids in scaling the data to a shorter range. This makes it possible to compare the data fairly when dealing with variables that have a large range of values [19].
Min-max normalization helps the forecasting model reach convergence faster during training. When variables have a large range, the optimization process in the forecasting algorithm may require more iterations to adjust the weights and parameters correctly. With min-max normalization, the data scale is narrowed down, allowing the model to quickly adjust the weights and achieve convergence [20].
After normalizing the data, the MIPSO method is used to search for the best values of alpha (α), beta (β), and gamma (β). These values play a crucial role in shaping an accurate forecasting model and providing valuable insights into predicting future sales trends and patterns. The search for the optimal values of alpha (α), beta (β), and gamma (γ) is performed using the MIPSO method, which is an effective optimization algorithm. The range of values for alpha (α), beta (β), and gamma (γ) in Holt-Winters Exponential Smoothing can impact the quality of the forecast. Typically, these values range between 0 and 1. Alpha (α) controls the weight given to the most recent historical data, beta (β) determines the weight placed on trend changes, and gamma (γ) influences the impact of seasonal components on the forecast. During the search for optimal values, various combinations of alpha, beta, and gamma are iteratively evaluated to find the combination that yields the best forecast accuracy. Figure 2 depicts a thorough representation of the procedure.
In Figure 2, the initial process involves initializing the population and the initial velocity of particles. The population generated in this process consists of random numbers ranging from 0 to 1 for each parameter α, β, and γ. The subsequent step is to evaluate the objective function using the predetermined values of α, β, and γ. In this research, the objective function is the Holt-Winters Exponential Smoothing forecasting method, which is formulated as shown in Equations 2 to 5 [8].
where is exponential smoothing value for t period, α is smoothing constant for data (0 ≤ α ≤ 1), β is Smoothing constant for trend data is Estimated trend t period, is The seasonal estimate of t period, t is tperiod, s is Seasonal length (number of months/quarters in a year), and m is The number of future periods to be forecast. After predicting with the Holt-Winters Exponential Smoothing method, the variables pBest and gBest must be updated. pBest represents the population with the lowest Mean Absolute Percentage Error (MAPE) over all iterations. Meanwhile, gBest represents the best MAPE value obtained across all populations and iterations [21]. The process of updating pBest and gBest in MIPSO is crucial as it allows us to track and retain the best values found during the optimization search. pBest represents the best individual's excellence within the population at each iteration, while gBest represents the best performance achieved among all individuals throughout the entire search process. MAPE is one of the techniques used to assess forecasting accuracy. It indicates the accuracy of a forecasting system by averaging the discrepancies between forecasted and actual data [22]. The formula for forecasting accuracy using MAPE is shown in Equation 5 and Equation 6 [23].
is Actual data in the t period, is Data forecasts for the t period, n is Amount of data, and t is t period.
A smaller MAPE value indicates a higher quality of the utilized forecasting method. Table  1 demonstrates the range of MAPE values used to evaluate the accuracy of a forecasting method [24]. The subsequent process involves updating the particle velocity and updating the particle position in the MIPSO algorithm. The formula for updating the particle velocity is shown in Equation 7, while the formula for updating the particle position is shown in Equation 8 [16].
( + 1) = ( ) + ( + 1) where ( + 1) is the velocity of the particle at iteration (i+1), is inertia weight, ( ) is the velocity of the particle at iteration i, 1, 2 is the cognitive and social acceleration factors, pBest is individual best at iteration i, gBest is global best at iteration i, ( + 1) is the position of the particle at iteration i + 1, and is the position of the particle at iteration i. The evaluation of the objective function and the update of the particle position will continue until the appropriate conditions are met. The appropriate condition in this investigation is when the least MAPE value is reached and the particle locations no longer vary. Once the optimal values of α, β and γ have been determined, the forecasting process will be carried out using these parameters. This study will compare the results of combining multiple value of 0.1, 0.2, 0.3, and so on up to 0.9. with the results of searching for, and values using the MIPSO algorithm to test the accuracy and speed of forecasting outcomes.

RESULT AND DISCUSSION
The data used in this study is the sales history data of all stores from January 2021 to May 2023.. In the initial stage, the data will be normalized using min-max normalization. The results of the min-max normalization process are depicted in Table 1 and Figure 3.  Table 1 represents the result of min-max normalization on the forecast data. This normalization is used to transform the range of data values to be between 0 and 1, facilitating processing and analysis. Through normalization, each data point is compared to the minimum and maximum values in the dataset, and the percentage of its existence within that range is calculated. In Figure 3, it can be observed a value of 0 indicates the data point with the lowest value, while a value of 1 represents the data point with the highest value. Over time, fluctuations in the normalization values can be observed, reflecting changes in the underlying trends or patterns of the forecasted data. This normalized data provides us with a better understanding of the relative comparison between different data points within the established range. Consequently, we can observe changes and fluctuations occurring in the forecasted data over time. Further analysis can be conducted to identify trends, seasonal patterns, or anomalies within the forecasted data.. The next step is to search for the values of α, β, and γ using the MIPSO algorithm. The MIPSO search process will stop when the minimum MAPE value obtained is the same as the 5 previous search results. This is done to ensure that the search process does not take too long.
In Table 3, we can see the optimization results of MAPE for forecasting using the Holt-Winters Exponential Smoothing method with the MIPSO algorithm. The Iteration column indicates the iterations performed by the MIPSO method to optimize the MAPE. The MAPE column shows the accuracy achieved by the forecasting method at each iteration. An interesting observation from this table is the convergence of the MAPE values. In the initial iterations, there is a significant change in the MAPE value from 11.4 to 9.67 in the first iteration. However, after the first iteration, the MAPE value only undergoes very small changes, remaining at 9.67 and then becoming 9.54 and remaining unchanged from the 2nd to the 6th iteration. The iterations are stopped when consecutive identical values are encountered. The optimization results of MAPE using the MIPSO optimization method are also presented in the form of a graph shown in Figure 4.  After finding the optimal values of α, β, and γ, the process continues by calculating the forecast for the next 30 days using the Holt-Winters Exponential Smoothing algorithm with the obtained values of α, β, and γ from the previous process. The forecast results for the next 30 days can be seen in Figure 5, where the orange line represents the actual sales data, and the blue line represents the forecasted values for the next 30 days. In this study, testing was conducted on the Holt-Winters Exponential Smoothing algorithm with the integration of the MIPSO optimization algorithm. The purpose of the testing was to compare the manually determined optimal combinations of α, β, and γ with the optimal search of α, β, and γ using the MIPSO optimization algorithm. The range of values for each α, β, and γ is from 0 to 1. The mentioned combination values in this study refer to performing repeated calculations within the range of 0 to 1 with increments of 0.1 to search for all possible combinations of these three parameters [25]. The testing was performed on data with varying sample sizes. The results of the testing were then evaluated based on the accuracy achieved, expressed in terms of MAPE, and the algorithm's processing time for forecasting. The accuracy testing are presented in Table 3 and the time process testing are presented in Table 5. In the testing, it can be observed that the combination of specific values of alpha, beta, and gamma resulted in the highest MAPE for the period of January to May 2023, which is 16.6103%. On the other hand, the lowest MAPE was obtained for the period of January 2021 to May 2023, which is 9.5317%. When using the MIPSO method, the highest MAPE was found for the time range of January to May 2023, with a value of 14.5761%. Conversely, the lowest MAPE was achieved for the period of January 2021 to May 2023, with a value of 9.1717%. This indicates that as more data is used for the forecasting process, the resulting accuracy level increases.
The test results indicate that the Holt-Winters Exponential Smoothing method with MIPSO optimization provides good accuracy in data forecasting. In each data range, there are variations in the accuracy levels among the tested combinations of alpha, beta, and gamma values. In this study, testing was also conducted to determine the processing time required to search for forecasts using different combinations of alpha (α), beta (β), and gamma (γ) values and the MIPSO optimization method. The results of these tests are presented in Table 5. In the table, there is a column labeled Data which indicates the time range of the data used to test the forecasting method. Furthermore, there is a column labeled "Time Process" which represents the processing time required to execute the forecasting process. The Combination column shows the tested combinations of alpha, beta, and gamma values, namely 0.1, 0.2, 0.3, so on up to 0.9. Lastly, the MIPSO column presents the results of the testing using the MIPSO method.
The results of the testing in Table 5 indicate that the processing time increases with the amount of data used in the testing process. In the data, it can be observed that the combination of the alpha, beta, and gamma values provides the fastest processing time in the range of January to May 2023, which is 10.4112 seconds. On the other hand, the time period from January 2021 to May 2023 has the longest processing time, which is 42.3886 seconds. In the testing using the MIPSO method, the fastest processing time was obtained in the time range of January to May 2023, which is 3.1008 seconds. Meanwhile, the longest processing time is recorded in the time period from January 2021 to May 2023, which is 6.9527 seconds. Table 5 shows that the time needed for calculations and creating forecast results increases with the amount of data used in the forecasting process. This happens because the computation method for sales history grows more involved as there is more data. Furthermore, compared to manual search utilizing combinations, the MIPSO optimization algorithm and Holt-Winters Exponential Smoothing produce faster processing speeds. This is because the MIPSO optimization algorithm can search over a large and complex search space quickly and efficiently [15] .
The results of the accuracy testing and algorithm processing time in calculating the forecasts are also depicted in Figure 6 and Figure 7. The blue line represents the forecasting accuracy using the optimal values of α, β, and γ obtained from the combinations of 0.1, 0.2, 0.3, so on up to 0.9 . Meanwhile, the orange line represents the forecasting accuracy using the optimal values of α, β, and γ obtained from the MIPSO optimization algorithm.

CONCLUSION
According to the findings of the research, the MIPSO optimization method can be utilized to discover the ideal values of, and. Figure 4 shows how the MAPE value reduces from 11.4% to 9.54% in the second round. Furthermore, the MAPE value does not decline further, indicating that the 9.54% MAPE value is the best.
In comparison to utilizing the forecasting method without optimization, using the MIPSO optimization algorithm with the Holt-Winters Exponential Smoothing forecasting method has produced more accurate and ideal predicting outcomes. The accuracy test results in Table 4 demonstrate this. The maximum MAPE value and the smallest MAPE value in the nonoptimized forecasting method are 16.2394% and 9.4349%, respectively. The maximum MAPE value obtained using the optimization process is 14.5761%, and the smallest MAPE value obtained is 9.1717%. In addition to achieving better accuracy, the optimization algorithm MIPSO requires less time to obtain the optimal values of α, β, and γ compared to not using the optimization algorithm, as shown in Table 5. In the non-optimized forecasting algorithm, the fastest process time is 10.4112 seconds, and the longest process time is 42.3886 seconds. However, by using the optimization algorithm, the fastest process time is 3.1008 seconds, and the longest process time is 6.9527 seconds.. The MIPSO optimization algorithm has shown promising accuracy when combined with the Holt-Winters Exponential Smoothing forecasting method. For future research, it can be further developed on Big Data technologies such as Hadoop or Apache Spark to achieve even better process times.