## 3 2D KDE and LSTM-Based Forecasting Framework for Cost-Effective Inventory Forecasting
### Interval Prediction by Means of 2D Kernel Density Estimation  
The prediction model based on the LSTM described above is a point prediction method that outputs one value about what the future value will be based on the learned data. However, it is very difficult to find a specific pattern for randomly fluctuating data and to predict future outcomes. No matter how sophisticated the prediction model is, the predictive performance of such data drops. Therefore, the point prediction method has a disadvantage in that it is difficult to trust the predicted result according to the state of the data. In order to overcome these limitations, we generally use the interval prediction method. Interval prediction is a prediction method that outputs a section including a prediction result, rather than deriving a prediction result as a single value. It has a different range depending on the reliability: the higher the reliability, the larger the range, and the smaller the range, the more reliable the output. Generally, in the regression model, the prediction interval is calculated based on the actual value and the error between the models. This method is based not on the variability of the data but on how well the model is tailored to the learning data. However, for the learning model designed by means of LSTM, the training data is learned at a very sophisticated level and good predictions are the result. Therefore, since the error between the learning section and the model is very small, it is difficult to expect a great effect of the interval prediction based on the error. Therefore, in order to predict the interval of the LSTM model, the interval prediction method based on the variability of the data should be introduced rather than the learning rate of the model. In this paper, we propose a new interval-estimation method suitable for the LSTM model. The proposed interval-estimation method is based on the modeled probability distribution based on the variability of the data. In order to predict the interval, we first design a 2D KDE map based on past data. The 2D KDE map aims to model the probability distribution based on variability. Therefore, we derive the volatility by differentiating the original data. On the other hand, the differential results of the data are correlated with the original values. In the section where the value of the original data is large, the value is likely to drop, whereas in the section where the value of the original data is small, the value is likely to rise. In other words, since the probability-density function indicating the variability depends on the original data value, the original data is divided into several sections, and the probability-density function is modeled by differentiating the original data for each section. The algorithm is as follows (Algorithm 1) and the results are derived as shown in Figure 4.  
Figure 3: Overall architecture of the framework. Algorithm 1 is used to derive a 2D KDE map modeled by the interval probability-density function. Next, we derive the interval prediction result according to the reliability by means of the derived 2D KDE map. For the interval prediction results, the point prediction results are first derived, and the result is combined with the 2D KDE map to derive the maximum and minimum values. One converts the point prediction result according to the scaling value derived from Algorithm 1 and selects a suitable probability-density function from among the various probability-density functions. Then, a suitable maximum value and minimum value are derived according to the input reliability. The algorithm is as follows (Algorithm 2). In this way, the result of the interval prediction according to the variability of the data is derived. The result can represent reliable predictions to the user along with the point prediction result. In addition, the prediction result can be readjusted by combining the result of the interval prediction and the result of the point prediction.