# Automated Application of Inventory Optimization

## Abstract

We present automated application of inventory optimization based on sales forecast. Inventory stock optimization is very required issue by companies recent years, however inventory models are based on the sales expectation. Therefore, the problem of optimizing inventory stock is divided into two parts, sales forecast and setting optimal inventory. We describe an automated solution to model selection for sales forecast and the inventory setting based on those predictions. In the end, we present our validation of the system through historical simulation. We compare simulations results against real inventory levels. Due to the large number of different length time series, this simulation was run in parallel on cluster and was parallelized in R. The algorithms were developed and tested on inventory time series from real data sets of the K2 atmitec company (Sales forecasting and inventory optimization are parts of ERP solution K2, which is provided by K2 atmitec s.r.o. company, http://www.k2.cz/en/).

## Keywords

Inventory optimization Sales forecasting Model selection Parallelization## 1 Introduction

The goal of our work was the design and implementation of automated application of inventory control for optimization and simplification of the decision making process of sales managers. Models for inventory control are based on the products sales expectations. Therefore, as the first step of inventory control, the sales forecast needs to be estimated. In our application, the sales forecast can be determined by four different models applied on several modifications of sales history. The result of the model with the best prediction according to the selected measure of accuracy is used as the input for the inventory control model.

Because of the lack of information needed for the standard inventory control models like Economic Order Quantity model or newsvendor model, we had to base our approach for the second step of inventory control on a fixed time review period model with variable demand and modify it to better suit our needs. This modification was verified by the simulation, which imitates behavior of sales manager on the assumption of complete trust in our application. The results of such simulation were compared with the real historical data of inventory time series.

The simulations were parallelized in R language and run in parallel on cluster because of the large number of products used for verification and repeated model estimations.

## 2 Inventory Stock Optimization

As described above, the inventory stock optimization consists of the two steps: sales forecasting and optimal inventory setting.

### 2.1 Sales Forecasting

Sales forecasting represents a typical application of time series analysis and prediction. Classical time series analysis is based on the assumption that the time series \(y_t\) for \(t = 1, 2, \ldots , n\) can be decomposed into four components: trend, cyclic, seasonal and irregular. The trend component characterizes a long-term tendency of the examined phenomenon that is influenced by factors operating in the same direction eg. production technology, demographic conditions, market conditions, etc. The first approach we used in time series modeling is based on the idea that if the long-term tendency of time series corresponds to a certain function of time eg. a linear, quadratic, exponential, S-curve etc., the trend component can be modeled using this function [1].

*t*, and \(\varepsilon _t\) is the residual component with the character of white noise process.

- 1.linear trend function in the form$$\begin{aligned} T_t = \beta _0 + \beta _1 t, \ \ t = 1, 2, \ldots , n, \end{aligned}$$(2)
- 2.quadratic trend function in the form$$\begin{aligned} T_t = \beta _0 + \beta _1 t + \beta _2 t^2, \ \ t = 1, 2, \ldots , n, \end{aligned}$$(3)
- 3.and cubic trend function in the form$$\begin{aligned} T_t = \beta _0 + \beta _1 t + \beta _2 t^2 + \beta _3 t^3, \ \ t = 1, 2, \ldots , n . \end{aligned}$$(4)

The regression parameters of the trend functions \(\beta _0, \beta _1, \beta _2\) and \(\beta _3\) were estimated by the least squares estimation method. Although this approach may appear to be too simple, in many practical cases the best solution is the simplest one.

The second approach we used in time series modeling is provided by the ARIMA model [2]. ARIMA - Autoregressive integrated moving average - is part of the Box-Jenkins methodology, which was developed for the analysis of time series, where we assume that the residual component \(\varepsilon _t\) does not have the character of white noise. Unlike the first approach, where the regression model is built only as the function of time, the Box-Jenkings models are built as the function of linear combination of *p* past values of the modeled variable itself, hence the term autoregressive, and regression-like model of \(q+1\) past forecast errors. In such way the ARMA(*p*, *q*) - autoregressive moving averages - model is obtained. ARIMA(*p*, *d*, *q*) model is then essentially an ARMA model applied to the *dth* difference of the original series. Such approach is used in the cases when the studied series is not stationary (it’s properties depend on the time at which the series is observed). The stationarity can be achieved by applying the difference of the first or the second order, difference of the higher order are usually not used in practice.

The final sales forecast is made in four steps. At first, all the models described above are fitted to the training part of the data, \(y_t \) for \(t = 1, 2, \ldots , m,\) where \(m < n\), then the sales forecasts \(\hat{y}_t\) for \(t = m+1, m+2, \ldots , n\) are made on the basis of fitted models. The different forecasts are compared with the test part of the data \(y_t\) for \(t = m+1, m+2, \ldots , n\) using appropriate measure of accuracy, and finally the best forecast is chosen as the input for inventory control model. Additionally, the models are fitted simultaneously on the original daily data and data with weekly and monthly aggregation.

### 2.2 Inventory Control

Numerous models for inventory control were developed such as Economic Order Quantity model (EOQ) or newsvendor model. Those are the basic deterministic and stochastic models for the inventory control. Based on the stochastic nature of our problem and available data we used fixed time review period model with variable demand as a basis for our solution.

*E*(

*s*) is expected mean sales and \(\sigma _{l}\) is lead time standard deviation. Now we can define reorder point, which is the level of inventory needed to cover the demand until the arrival of the next batch of inventory plus safety stock. If we assume the constant demand and constant lead time we can define reorder point as follows

*A*is actual level of inventory. This definition of order quantity covers the demand for the defined time with set service level for covering the stochastic behaviour of customers.

### 2.3 Automated Application of Inventory Optimization

The theory described in Sects. 2.1 and 2.2 was used for development of an approach for inventory optimization that was implemented as part of ERP software by K2 atmitec company. This software can simplify the decision making process of sales managers. It includes three main parts, which are “best model selection”, “sales prediction” and “inventory control”.

## 3 Verification of Automated Application of Inventory Optimization

To evaluate our approach, we created a simulation which imitates behavior of sales manager on the assumption of complete trust in our approach. The simulation includes all three parts mentioned in previous section, which are complemented by an automatically controlled decision making process for running specific parts. We used historical time series of sales and inventory stock levels for verification of our simulation, the results are given in Sect. 3.3.

### 3.1 Data Description

The real historical data for our software verification was provided by the K2 atmitec company. The dataset contained the information about approximately 33 000 products in several warehouses in Czech Republic. We were not able to simulate the behavior for all of the provided products due to the small number of observations in the followed history. The software was finally verified on about 950 and 750 products in two selected warehouses, what was sufficiently large enough number.

### 3.2 Simulations

On the beginning of the simulation, some parameters must be set. The lead time for the given goods, order interval and maximum level of inventory. The lead time and maximum level of inventory are variable for every type of stock. The review period was set to 30 days. In addition, we had to select the service level, which was set to 95 %.

After the first day, the simulation iterates by day, reducing the inventory level by the same amount as it is reduced in the real inventory time series. When it reaches the reorder point, the “sales prediction” and “inventory control” parts are run again. The reorder point and safety stock are updated according to the new results and order for the new inventory is made. The ordered inventory is added to the simulated inventory after the lead time period. Every three months new predictive model is chosen based on the “best model selection” part. This process is repeated until the end of the time series.

Because of a large number of products at each warehouse and repeated model estimations, we had to parallelize this algorithm. Due to the independency of simulations for specific goods, the computation was easily parallelized through Rmpi^{1} package in R software. This package uses MPI for communications between nodes. Our algorithm uses distributed apply function, where a master node sends time series data to free slave nodes, which execute the simulation on given data. This method allows us to run this algorithm both single node or on the cluster and scales well, because there is minimal need for the communication. The computation was made on Salomon cluster equipped with Intel Xeon E5-2680v3 processors. We used 8 compute nodes, each with 24 cores and 128 GB RAM.

### 3.3 Comparison of Simulation Results and Real Inventory Data

Summary statistics for the comparisons of the mean level of real inventory and the mean level of simulated inventory.

Warehouse 1 | Warehouse 2 | |
---|---|---|

Number of products | 950 | 761 |

Mean stockout [%] | 2.7 | 3.1 |

Mean relative percentage difference [%] | 17.4 | 20.0 |

Median relative percentage difference [%] | 34.8 | 35.2 |

The values of median relative percentage difference suggest, that the decrease could be even more significant, and that the mean relative percentage difference value is influenced by several unsuccessful simulations, as can be seen from the distribution of relative percentage difference with removed outliers in Figs. 4 and 5. Those were mainly simulations on products with the lead time greater than 40 days. Improvement of the simulation on such products is one of the tasks for our future research.

## 4 Conclusion

Our paper describes design, implementation and verification of the automated application of inventory control that is based on predictions of real historical sales data. The sales prediction is estimated by several approaches of time series modeling of which the best is chosen by the selected measure of accuracy. Modification of fixed time review period model with variable demand was proposed for inventory control model and verified by the described simulation process which compares inventory time series simulated by our application with the real inventory time series. The results of the simulation showed, that if the sales manager acted completely in accord with our application recommendation, the mean inventory level would decrease by 17.4 % in one tested warehouse and by 20.0 % in the second tested warehouse.

The future work in this area involves, besides the tasks mentioned in previous section, the research and the implementation of other suitable models for sales forecasting and their ensembles, an improved model selection, and alternative inventory control models.

## Footnotes

- 1.
Yu, H. (2002). Rmpi: Parallel Statistical Computing in R. R News 2/2:10-14.

## Notes

### Acknowledgment

This work was supported by The Ministry of Education, Youth and Sports from the National Programme of Sustainability (NPU II) project ‘IT4Innovations excellence in science – LQ1602’ and from the Large Infrastructures for Research, Experimental Development and Innovations project ‘IT4Innovations National Supercomputing Center – LM2015070’.

## References

- 1.Hyndman, R.J., Athanasopoulos, G.: Forecasting: Principles and Practice. OTexts, Melbourne (2013). http://otexts.org/fpp/. Accessed 26 April 2016
- 2.Asteriou, D., Hall, S.G.: Applied Econometrics, 2nd edn. Palgrave MacMillan, Basingstoke (2011)Google Scholar
- 3.Palit, A.K., Popovic, D.: Computational Intelligence in Time Series Forecasting: Theory and Engineering Applications. Springer-Verlag, London (2005)zbMATHGoogle Scholar
- 4.Hyndman, R.J., Koehler, A.B.: Another look at measures of forecast accuracy. Int. J. Forecast.
**22**, 679–688 (2006)CrossRefGoogle Scholar - 5.Russell, R.S., Taylor, B.W.: Operations Management. Wiley, Hoboken (2011)Google Scholar
- 6.Durbin, J., Koopman, S.J.: Time Series Analysis by State Space Methods. Oxford Statistical Science Series. Clarendon Press, Oxford (2001)zbMATHGoogle Scholar
- 7.Baxter, M., King, R.G.: Measuring business cycles approximate band-pass filters for economic time series. Technical report, National Bureau of Economic Research (1995)Google Scholar

## Copyright information

**Open Access** This chapter is licensed under the terms of the Creative Commons Attribution-NonCommercial 2.5 International License (http://creativecommons.org/licenses/by-nc/2.5/), which permits any noncommercial use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.