A predictive analytics- integrated guaranteed service framework for multi-echelon safety stock optimization
Figures
Abstract
Multi-echelon inventory planning depends on reliable demand forecasts and a transparent treatment of uncertainty. This study evaluates a framework that integrates machine-learning demand forecasting with the GSM for safety-stock optimization. Seasonal naïve, Holt’s exponential smoothing, linear regression (LR), and XGBoost models were compared on chronological one-week-ahead forecasts for six retailer series from the Walmart Recruiting–Store Sales Forecasting dataset, using a 43-week test period per retailer. Aggregated across retailers, LR achieved the lowest RMSE (7,540), slightly below XGBoost (7,869); on the series used in the GSM case study, however, XGBoost was marginally more accurate, and its forecasts served as the demand input. Week-to-week variation in the forecasts and forecast error were treated as distinct quantities. Each retailer’s safety factor was selected from residual diagnostics; where these were not satisfied, an empirical factor from the 43 test-set errors was used, as a small-sample estimate rather than a guarantee of service coverage. The resulting parameters were applied to a network of one plant, two distribution centers, and six retailers, formulated as a quadratically constrained program with stochastic lead times and solved with Gurobi at a 97% cycle service level. Total holding cost was $123,141 under forecast-based demand and $131,150 under observed demand; this difference is specific to the dataset and assumptions and should not be read as a realizable saving. The main contribution is an empirical demonstration of how retailer-level forecasts propagate into multi-echelon safety-stock decisions. All instances, including synthetic networks of up to 60 nodes, were solved to optimality in under 0.02 seconds on average.
Citation: Shakil MAN, Hossain MN, Chowdhury SA, Mahmud S, Hossain MM (2026) A predictive analytics- integrated guaranteed service framework for multi-echelon safety stock optimization. PLoS One 21(12): e0363894. https://doi.org/10.1371/journal.pone.0363894
Editor: Erfan Babaee Tirkolaee, Istinye University: Istinye Universitesi, TÜRKIYE
Received: July 4, 2026; Accepted: November 15, 2026; Published: December 4, 2026
Copyright: © 2026 Shakil et al. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Data Availability: All relevant data for this study are publicly available from the Zenodo repository (https://doi.org/10.5281/zenodo.24371448).
Funding: The author(s) received no specific funding for this study.
Competing interests: The authors have read the journal’s policy and have the following competing interests: Md. Abu Naim Shakil is an employee of Walton Digi-Tech Industries Limited. Md. Nasif Hossain is an employee of Meghna Group of Industries. This does not alter our adherence to PLOS ONE policies on sharing data and materials. There are no patents, products in development or marketed products associated with this research to declare.
Introduction
Inventory management is central to supply chain (SC) performance because products should be available when customers want them [1]. Meeting this requirement is difficult when demand is variable and hard to predict accurately [2,3]. Firms must hold enough stock to satisfy demand without accumulating excess inventory, which ties up capital and raises costs. Demand forecasting, lead-time estimation, and coordination across the SC have therefore become key elements of effective inventory management [4]. The growing complexity and uncertainty of modern SCs further increase the need for analytical and modeling approaches that support these decisions [5]. Therefore, this study aims to enhance SC efficiency by reducing excess inventory, preventing stockouts, and improving operational flexibility.
Demand forecasting is essential to inventory management because it helps organizations reduce costs, remain competitive, and make sound decisions [6]. Recent disruptions, notably the COVID-19 pandemic, which raised transport costs, have made inventories harder to manage [7]. Uncertainty in both supply and demand further complicates planning, so firms need dynamic approaches to inventory planning [1].
The allocation of safety stock is critical to determining the amount of additional stock needed at different levels of the SC. This facilitates buffering uncertainties that may occur and be risky in the SC [8]. In the SC, the inventories keep safety stock levels at different locations to give desirable customer service at minimum cost to minimize the risks [9]. However, traditional single-echelon safety stock calculations calculate safety stock separately at different levels in the SC which is very inefficient because of the lack of correlation between levels in the chain. On the other hand, multi-echelon safety stock optimization considers the entire SC, allowing better coordination and more informed decisions [10]. This method is more complicated and computationally expensive, but generally yields better results in terms of both cost savings and service levels. Studies have shown that single-echelon systems lead to higher inventories and lower fill rates while multi-echelon systems have lower inventories and higher fill rates due to better coordination and efficiency [11]. Simpson [12] introduced the GSM to handle uncertainty of the final customer’s demand in multi-echelon inventory optimization (MEIO) strategies, whereas Clark and Scarf [10] developed the stochastic-service model (SSM). In the academic world, the GSM approach has become popular and feasible due to its practical assumptions on handling demand and service time variations. In contrast, a GSM can handle complicated multi-echelon structures while stochastic-service model methods are mainly applied to serial, assembly, or two-echelon distribution systems with a limited industrial application. This has brought about considerable practical improvements in the management of modern, large and complex supply networks [13]. While many extensions exist, none of the existing models optimizes safety stocks for complex supply networks including all relevant industrial characteristics [14].
Machine learning has been widely applied to demand forecasting and, increasingly, to inventory control, but its forecasts are seldom linked explicitly to GSM-based safety-stock placement. GSM applications typically rely on static demand parameters, which sits uneasily with real demand series that show seasonality and external shocks. We address this gap with a framework in which a machine-learning forecaster supplies demand parameters to a GSM that places safety stock across several echelons under uncertain demand and lead times. Following the guaranteed-service formulation of [14], the model accounts for customer service level, lead time, review period, and demand uncertainty. The aim is to examine how retailer-level forecasts shape multi-echelon safety-stock decisions and holding cost, not to propose a new GSM formulation.
- We compare XGBoost with three baselines (linear regression, Holt’s exponential smoothing, and a seasonal naïve method) on chronologically split, out-of-sample weekly demand series from six retail nodes.
- We present a data-driven pipeline in which demand parameters derived from XGBoost forecasts are passed to a GSM with stochastic lead times, and we compare the resulting safety-stock levels and holding costs with those obtained from observed demand.
- For each retailer, this study runs residual diagnostics, testing for normality and autocorrelation. These tests show when the standard normal safety factor is appropriate and when empirical error quantiles should be used in its place.
- We assess the computational scalability of the GSM formulated as a quadratically constrained program (QCP), reporting runtime, memory use, and solution status on the case study and on synthetic networks of up to 60 nodes.
The rest of this paper is structured as follows. We first review the literature on machine learning demand forecasting, multi-echelon inventory systems, and service optimization under the GSM. After describing the problem of study, optimization model is formulated with necessary assumptions and notations. Next, hybrid two-phase solution methodology is described. Computational experiments on empirical retail data and synthetic networks evaluate model accuracy and optimization scalability. The paper closes with a comparative discussion of safety stock policies, managerial implications, and concluding remarks.
Literature review
This paragraph examines the important literature about the topics studied here. First studies on machine learning-driven demand forecasting are examined to show progress in machine learning predictive analytics for inventory management. Next literature on multi-echelon inventory systems, including models, real‑world challenges and safety stock optimization is reviewed. Finally research on the GSM is discussed to illustrate the role of the GSM in inventory control and service‑level management. From this review the gaps, in existing research are identified, which motivates the machine learning‑integrated GSM framework we propose.
Machine learning-driven approaches for demand forecasting
Because machine learning algorithms can handle large amounts of data, are more accurate than traditional statistical methods, and are flexible in handling nonlinear demand patterns, demand forecasting using these algorithms has grown in popularity. Recent research has demonstrated that deep learning and machine learning algorithms can greatly improve inventory performance and decision-making. The growing significance of artificial intelligence-based forecasting systems for attaining improved accuracy and performance in service delivery was brought to light by a systematic review of 119 papers on the application of machine learning and deep learning in SC forecasting [15]. Similarly, Sanni [16] has emphasized the important contributions of forecasting and reinforcement learning techniques based on artificial intelligence to adaptive decision-making in service firms. Thus, utilizing demand forecasts produced by machine learning in inventory optimization frameworks presents a feasible way to improve inventory performance and SC resilience.
The application of deep learning and reinforcement learning concepts in demand forecasting models has been the subject of numerous recent studies. A demand forecasting model based on reinforcement learning and recurrent neural network concepts was presented by Zhang et al. [17], which reduced lead times and inventory turnovers while reducing mean squared forecasting error by 15%. Similarly, Yang et al. [18] suggested a multi-agent-based deep reinforcement learning strategy for retail SC management utilizing IoT and sensor-embedded applications, which reduced forecast error by 18.2% and stockout rates by 23.5% when compared to benchmark models. Recently, there has also been a lot of interest in forecasting models based on customer-focused strategies and business intelligence. When using customer data from the retail sector, Zohdi et al. [19] found that small multilayer perceptrons and extreme learning machines offered superior predictive performance and efficiency. Using real retail sales data, Khan et al. [20] integrated the DeepAR recurrent neural network algorithm into business intelligence systems and attained up to 92.38% accuracy.
The superiority of machine learning techniques in the majority of situations has also been demonstrated by comparisons between them and traditional statistical approaches to forecasting. Spiliotis et al. [21] compared several machine learning techniques with statistical methods on a large benchmark of 3300 daily SKU demand series. The study claimed that tree-based ensembles (Gradient Boosting Trees and Random Forests) delivered higher accuracy and lower bias than the statistical baselines. The authors also found that cross-learning noticeably improved the performance of neural networks while reducing their run time. These findings are an obvious recommendation for retail demand forecasting that can be connected to MEIO for better decision insights. In addition, Sarıışık et al. [22] developed a physics-based forecasting framework that solved a hybrid helical vertical-axis wind turbine and photovoltaic system powering street lights in Izmir, Turkey. This study compared XGBoost, Gradient Boosting and Random Forest models for predicting the system’s power output. The hybrid configuration showed roughly 38% less variability in output than the photovoltaic system operating alone. In addition, SHAP values identified the environmental variables that contributed most to the predictions, which made the models easier to interpret.
Multi-echelon inventory systems: Models, challenges, and optimization strategies
Multi-echelon inventory systems have drawn steady attention in SC research because they let planners coordinate stock across several linked stages. The aim is to cut operating cost and hold service levels while coping with uncertain demand, lead time and replenishment. Recent work has increasingly brought optimization algorithms, reinforcement learning and big-data analysis into this area.
Forecasting has been tied into MEIO as well, and transformer-based forecasters have performed well in multi-echelon chains. Zhang et al. [23] report that a transformer forecaster is considerably more accurate and efficient than ARIMA and LSTM models. Linking such forecasts to safety stocks and replenishment rules can dampen demand volatility and the bullwhip effect.
Deep reinforcement learning has become a promising tool for overcoming the challenges encountered in solving multi-echelon inventory system problems. For instance, Cheng et al. [24] proposed a Deep Q-Network model based on Radial Basis Functions for multi-echelon inventory control and found that it outperformed classical base-stock rules and other deep reinforcement learning approaches. Additionally, Hammler et al. [25] explored opportunities associated with deep reinforcement learning for MEIO and concluded that asynchronous advantage actor-critic-based algorithms reduced total inventory costs by 9–12% over a year compared to a traditional policy, but faced reliability issues.
Scalability and real-life applicability have been widely discussed within multi-echelon inventory system research. For example, Ziegner et al. [26] developed an Iterative multi-agent reinforcement Learning algorithm capable of handling large, highly complex SCs. It was able to achieve 6–14% cost savings compared to benchmark heuristics, while maintaining high levels of performance stability in different SC scenarios. Also, in a recent study, Rizqi and Chou [27] proposed a neuroevolutionary reinforcement learning algorithm for multi-echelon systems with stochastic discounting and delivery options, achieving up to a 58% cost reduction.
Research is also being conducted on optimizing multi-echelon inventory systems subject to uncertainties and sustainability constraints. Gu et al. [28] studied cross-region transshipment and reorder policies in a spare-parts inventory network, proving the potential of using the genetic algorithm to minimize total cost incurred by the changes in demand. Similarly, Wang et al. [29] developed a reinforcement learning framework to optimize inventory policies in closed-loop SC systems under carbon tax policies, demonstrating that smart inventory policies reduce both carbon emissions and costs.
Moreover, methods of data-driven and service-level constraint optimization are making further development of multi-echelon inventory systems possible. Specifically, Liu and Nishi [30] optimized a service-level-constrained inventory policy using machine learning, digital twin technology, and evolutionary computing. The developed ensemble-based differential evolution algorithm not only provided more efficient policies compared to traditional policies but also significantly improved the accuracy of surrogate modeling.
The guaranteed service approach for inventory control and service optimization
The guaranteed service approach has gained prominence in the context of inventory management as well as service-level optimization in SCs through multi-echelon due to the strategic allocation of safety stock with pre-defined service levels in mind. While the traditional stochastic-service model presents certain complexities in terms of computational efficiency and integration between different echelons, the guaranteed service approach addresses this problem by allocating guaranteed replenishment times.
Early research mainly centered around the theoretical development and performance measurement of GSMs. In this respect, a comparison of stochastic-service and GSMs for safety stock optimization was conducted, and GSM was found useful for the reliable provision of predefined service levels while mitigating risks associated with stockouts in multi-echelon SCs [31]. Furthermore, the extension of the GSM for use in safety stock optimization problems including stochastic lead times showed superior performance compared to heuristics neglecting lead time uncertainty [32].
To improve the computational efficiency and applicability of GSM optimization algorithms, a number of additional studies have been carried out. Based on stochastic demand scenarios, Eruguz [33] created ideal models of order-up-to policies and reorder intervals for multi-echelon systems. With average gaps of only 0.46%, near-optimal solutions could be obtained. In the context of MEIO, Achkar et al. [14] expanded the GSM algorithm to include facilities, hybrid nodes, review cycles, minimum order sizes, and service level metrics. The study shows significant improvements in computational efficiency using piecewise-linear approximations and QCP reformulations.
Furthermore, in the context of guaranteed-service SCs, research has focused on coordination issues and service-level errors. Eruguz et al. [34] investigated the discrepancies between the defined and successfully attained cycle-service levels in GSM-oriented SCs and found that in certain instances, these errors could be as high as 4.76%. The same author’s other study discovered that in real-world scenarios, assumptions about bounded demand, guaranteed service times, and uniform review periods could result in higher safety stock costs and erroneous service level achievement [33].
Also, studies on the coordination of decentralized multi-level SCs can be based on guaranteed service. Through service time-based contracts that do not require information exchange, Schoenmeyr and Graves [35] investigated and argued that the use of GSMs is an effective way to coordinate SC stakeholders operating in a decentralized manner. It was observed that safety stocks could be impacted by supplier margins and that new contract types were required to guaranty systemic coordination.
There are still a number of crucial research gaps despite the notable advancements documented in the literature. First, most studies concentrate on increasing prediction accuracy without explicitly connecting forecasting outputs to inventory optimization decisions [15,21], despite the fact that machine learning techniques have shown superior forecasting performance when compared with traditional statistical approaches [36]. Second, while deep learning, reinforcement learning, and data-driven optimization techniques have been used more frequently in recent research on multi-echelon inventory systems, the integration of machine learning-based demand forecasts into safety stock optimization frameworks has received less attention than inventory control policies, replenishment strategies, and cost reduction [24,26,30]. Third, current GSM-based studies typically rely on predefined or static demand parameters and do not fully utilize advanced machine learning techniques to capture dynamic demand uncertainty, despite the fact that the GSM has undergone several methodological extensions and has proven effective for multi-echelon safety stock optimization [14,32].
For proactive safety stock planning in uncertain and disruptive SC environments, an integrated framework that integrates GSM-based MEIO and machine learning-driven demand forecasting is still lacking. Lastly, there is little proof that demand forecasts produced by machine learning can result in inventory choices that are comparable to those made using actual demand data while maintaining the required level of customer service and lowering holding costs. In order to fill in these gaps, this study suggests a machine-learning integrated GSM framework that uses MEIO and XGBoost-based demand forecasting to determine the best safety-stock allocation in situations with uncertain demand and lead times.
Study positioning and novelty
This study’s contribution is not a new theoretical formulation of the GSM, but rather an empirical integration and evaluation. It uses a standard chronological test plan to evaluate four forecasting methods. It examines retailer-specific forecast-error distributions. It provides forecast-based demand parameters as inputs to a stochastic-lead-time GSM-QCP and compares the inventory decisions with those based on actual-demand inputs. In addition, it tests the computational performance of the QCP on large synthetic networks. This combination makes it clearer how multi-echelon safety-stock decisions in the case study are impacted by forecasting results.
Problem description
The allocation of safety stock in a multi-echelon SC with irregular replenishment lead times and uncertain demand is the subject of this study. The goal is to minimize the overall cost of inventory holding while maintaining the necessary level of customer service by determining the safety-stock quantities and guaranteed service times at various supply-chain locations.
Three echelons make up the case-study network: two distribution centers, six retailers, and one production facility. It takes into account two raw materials sourced from various locations and one completed stock-keeping unit. While the demands seen at the plant and distribution centers are produced by downstream replenishment requirements, independent external demand takes place at the retailer nodes. As a result, demand requirements propagated from downstream locations determine upstream demand.
The demand series at the retailer level show seasonal patterns, structural shifts, temporal variation, and varying degrees of variability. Instead of assuming that all retailer series are either stationary or non-stationary, their stationarity and trend properties are assessed empirically. The mean demand and related uncertainty at the retailer nodes are estimated using forecasting models. The GSM then receives these forecast-derived parameters.
Location-specific mean lead times, lead-time variability, regular inventory reviews, holding-cost coefficients, customer service-level requirements, and guaranteed service-time decisions are all included in the problem. The model sets no limits on production, transportation or storage capacity. What it decides is where safety stock is held and which service times are promised, and it says nothing about how capacity is allocated.
Modeling assumptions
The formulation rests on the following assumptions:
- Fixed network. The SC locations, products, and relationships, including the bills of materials, are known in advance and remain unchanged throughout the planning phase. The network has no cycles, and each location receives each product from upstream location.
- Periodic-review base-stock policy. Each location checks its inventory at regular intervals and replenishes it to a target level. The review interval is known and stays unchanged during each optimization run.
- Guaranteed-service commitment. Each location guarantees that an order will be fulfilled within its specified outbound service time. The outbound service time of an upstream location determines the inbound service-time requirement of its immediate downstream successor.
- Independent and dependent demand. Independent external demand occurs at the retailer nodes belonging to . Demand generated through downstream replenishment orders is treated as dependent demand at locations belonging to . A location may belong to both sets, in which case it is treated as a hybrid location.
- Forecast-derived demand parameters. The retailer-specific means and standard deviations of external demand are estimated using out-of-sample forecasts. These parameters are assumed to be representative of demand during the corresponding inventory-planning horizon. Upstream dependent-demand parameters are obtained by propagating downstream demand through the supply-chain structure.
- Distributional assumptions. Normality is not assumed automatically for the demand observations, model predictions, or forecast errors. The adequacy of the normal approximation and the independence of forecast errors are evaluated separately for each retailer using the diagnostic procedure described. Where the diagnostic assumptions are supported, the normal-theory safety factor is used. Where normality or independence is rejected, an empirical service-level quantile obtained from the out-of-sample forecast errors is used instead.
- Temporal dependence. Observable temporal, seasonal, and trend components are represented in the forecasting stage. The remaining out-of-sample forecast errors are treated as approximately uncorrelated only where this assumption is supported by the retailer-specific residual-autocorrelation analysis and Ljung–Box test.
- Stochastic lead time. The replenishment lead time for each product-location pair is characterized by a known mean and standard deviation . Demand and replenishment lead time are assumed to be independent.
- Treatment of dependent-demand lead time. For dependent demand, lead-time uncertainty is represented through the conservative deterministic equivalent Eq. (1).
(1)
where represents the selected lead-time service factor. - Treatment of independent-demand lead time. For independent demand, lead-time uncertainty is incorporated directly into the protection-period variance. Demand accumulated during the random replenishment period is assumed to have variance as expressed in Eq. (2).
(2)
where is the mean protection period. This relationship requires demand and lead time to be independent. - Nonnegative protection periods. The matching inbound service time plus the relevant replenishment and review periods cannot be exceeded by the guarantyd outbound service time. As a result, all protection periods for both independent and dependent demands must be nonnegative.
- Service-time bounds. Only locations with independent customer demand are subject to maximum external service-time commitments. Only in cases where a distinct contractual, production, or operational requirement has been established is an internal service-time bound enforced.
- Safety stock at hybrid locations. At locations with both types of demand, we calculate safety stock for each separately and add the amounts. This gives a conservative estimate of the total safety stock needed.
- Linear holding cost. Inventory holding costs rise with the amount of safety stock. Quantity discounts, transportation costs, shortage penalties and fixed ordering costs are left out of the model.
- No capacity constraints. Production, storage and transportation capacity are taken to be sufficient, and the model makes no decision about how capacity is allocated.
- Product coverage. The case study has a single finished product and two raw materials, and p is used as the index for the product and the materials alike.
- Parameter availability. For each optimization run, the model uses known values for holding costs, review periods, lead times, service targets, and external service commitments.
The problem is challenging because decisions made at one echelon affect the service times, replenishment exposure, and safety-stock requirements of downstream locations. So if each location were optimized on its own, the total network holding cost would not necessarily be at its minimum.
The original GSM safety-stock expressions contain square roots of the net protection periods. To represent these relationships computationally, nonnegative auxiliary variables and are introduced. The resulting squared terms do not represent physically squared lead times. They form a mathematical reformulation of the original square-root safety-stock relationships. Because the auxiliary variables have positive coefficients in the minimization objective, the associated quadratic inequalities are binding at an optimal solution.
The resulting model is expressed as a QCP and solved using Gurobi. The QCP formulation preserves the square-root safety-stock relationships while providing a structured computational representation of the stochastic-lead-time GSM.
Practical implications and limitations of the assumptions.
The assumptions establish the scope of the optimization model and help interpret the outcomes of the optimization.The assumption of the constant SC structure within the entire planning period means that the number of facilities and their connections are constant. Hence, the model only focuses on the effect of forecast-based demand on the inventory allocation in the fixed network. Nevertheless, the model does not account for changes to the network structure, so the results do not indicate the implications of such modifications.
A single-SKU assumption implies that when optimizing, the process will only evaluate one item at a time. This means that the model cannot account for products being substituted for each other nor can it account for the relationship among items which may use the same storage area, production resource, or budget. As such, while the results may help guide decisions regarding the evaluated product, they do not produce an optimal inventory strategy for a multi-product assortment.
The no limit to capacity assumption implies that there are no upper limits on how much can be produced, stored, or transported. This means that if a model allocates a safety stock level that is larger than the actual amount of space/capacity in a real-world facility or transportation system, it will simply assign that larger quantity. However, since the model does not include costs associated with capacity (and other factors) and does not limit the model to assigning levels within those capacities, the holding-cost estimates that result from this analysis must be viewed as if they were conditioned upon having sufficient capacity to store/move the assigned quantities.
Overall, these assumptions enable research on forecast-driven or forecast-based inventory allocation in a specific network context, but they limit the immediate applicability of the results to situations with multiple products, constraints on capacity, or changes in the network structure itself. Extending the model to incorporate these elements would allow for a detailed analysis of the feasibility of operations while possibly transforming the final safety stock and cost requirements.
Mathematical model
In this study, a MEIO problem is created on the basis of the guaranteed-service concept. It suggests calculating both the guaranteed service time and allocating enough buffering for the products without exceeding the total holding cost of the inventory. The structure used in this formulation takes into account the significant aspects of a typical GSM, where the outgoing service time of the supplier forms the incoming service time of the consumer [37].
This formulation also takes into consideration random lead times, distinct dependent and independent demands, periodic inventory checks, and forecasts. Thus, we refer to it as a stochastic lead-time adaptation and a data-driven implementation of the GSM rather than as a new formal development of the classical theory.
Sets and indices
- J: Set of all supply-chain locations.
- : Set of products stored or processed at location j.
- J0: Set of source locations.
- : Set of locations facing internally generated dependent demand.
- : Set of locations facing independent external demand.
- : Set of internal locations subject to an explicitly specified service-time bound.
- A: Set of valid directed arcs (i,j,p), indicating that location i supplies product p to location j.
- i,j: Indices of supply-chain locations.
- p: Index of products.
A location may belong to both and . Such a location is referred to as a hybrid location because it faces both downstream replenishment demand and independent external demand.
Parameters
- : Mean dependent demand for product p at location j.
- : Standard deviation of dependent demand for product p at location j.
- : Mean independent demand for product p at location j.
- : Standard deviation of independent demand for product p at location j.
- : Mean replenishment lead time for product p at location j.
- : Standard deviation of replenishment lead time for product p at location j.
- : Review period for product p at location j.
- : Inventory holding cost per unit of product p at location j.
- : Standard-normal safety factor corresponding to the target cycle service level for product p at location j.
- : Safety factor used to obtain a conservative deterministic equivalent of stochastic lead time.
- : Exogenous inbound service time at source location .
- : Maximum internal service time at a location with an explicit operational or contractual bound.
- : Maximum service time promised to external customers at demand-facing location .
The value of is determined by Eq. (3).
(3)where is the inverse cumulative distribution function of the standard-normal distribution.
Decision variables
- : Guaranteed service time for product p at location j
- : Guaranteed service time for external demand of product p at location j
- : Net lead time for product p at location j
- : Net lead time associated with dependent demand for product p at location j
- : Net lead time associated with independent demand for product p at location j
Relationship with the standard safety-stock formula
Under the normal approximation, Eq. (4) expresses the standard safety-stock.
(4)where is the standard deviation of demand accumulated during the relevant net replenishment or protection period. The present formulation preserves this relationship separately for dependent and independent demand.
Dependent demand.
For dependent demand, stochastic lead time is represented by the conservative deterministic equivalent given in Eq (5).
(5)The net protection period for dependent demand is expressed in Eq. (6).
(6)Therefore, the standard deviation of dependent demand accumulated during the protection period is presented in Eq. (7).
(7)Substitution into Eq. (4) gives the standard safety-stock expressed in Eq. (8).
(8)Eq. (9) introduces the net lead time associated with dependent demand for product p at location j.
(9)Eq. (10) calculates the dependent-demand safety stock.
(10)Thus, Eq. (10) is exactly the standard relationship , with Eq. (11).
(11)Independent demand.
For independent demand, the mean protection period is presented in Eq. (12).
(12)Assuming that replenishment lead time is independent of weekly demand, the variance of independent demand accumulated during stochastic replenishment is represented by Eq. (13).
(13)The first term in Eq. (13) represents demand variability accumulated during the mean protection period. The second term represents the additional demand uncertainty caused by stochastic lead time. Therefore, as expressed in Eq. (14), the standard deviation of independent demand accumulated during the protection period is calculated.
(14)Eq. (15) introduces the auxiliary net lead time variable .
(15)the independent-demand safety stock is defined by Eq. (16).
(16)Thus, Eq. (16) also has the standard form , with
At a hybrid location, separate safety-stock components are maintained for dependent and independent demand. The total safety stock is therefore conservatively calculated using Eq. (17).
(17)Objective function
The objective is formulated in Eq. (18) to minimize the total holding cost associated with dependent-demand and independent-demand safety stocks:
(18)The first term represents the holding cost of safety stock maintained against dependent demand. The second term represents the holding cost of safety stock maintained against independent external demand. If a location belongs to both and , both components are included.
Unlike the previous formulation, Eq. (18) contains the physical safety-stock quantities rather than their squared values. Consequently, the units of each objective-function term are inventory holding cost.
Constraints
Inbound service-time constraints.
At each source location, inbound service time is specified exogenously according to Eq. (19):
(19)For each non-source location, inbound service time must be at least as large as the guaranteed outbound service time of every immediate upstream supplier, as specified in Eq. (20):
(20)Eq. (20) restores the central GSM relationship through which service-time decisions are propagated across successive supply-chain stages.
Customer-facing service-time bound.
The maximum customer-service-time requirement applies only to demand-facing locations, as bounded by Eq. (21):
(21)The constraint applies to some intermediate nodes, but not all. It reflects the service level promised to external customers.
Optional internal service-time bound.
An internal service-time bound is imposed only where an explicit contractual, production, or operational requirement exists, as expressed in Eq. (22):
(22)Here, contains only the locations with an independently specified internal service-time commitment. If the case study contains no such internal commitment, and Eq. (22) is omitted.
Nonnegative protection-period constraints.
For dependent demand, the guaranteed service time cannot exceed the inbound service time plus the conservative replenishment lead time and review-period adjustment, as constrained by Eq. (23):
(23)This constraint ensures that the dependent-demand protection period satisfies . For independent demand, the outbound service time is constrained by Eq. (24):
(24)which ensures that the independent-demand protection period satisfies
Quadratic reformulation constraints.
For dependent demand, the square-root reformulation variable satisfies Eq. (25).
(25)Because the objective function minimizes , Eq. (25) is tight at optimality. Thus, .
For independent demand, the corresponding quadratic reformulation constraint is given by Eq. (26):
(26)Because the objective minimizes , this constraint is also tight at optimality, giving
Safety-stock and holding-cost calculations
After solving the QCP, the dependent-demand safety stock is calculated using Eq. (32).
(32)and the independent-demand safety stock is calculated using Eq. (33).
(33)Their respective holding costs are expressed as Eq. (34) and Eq. (35).
(34)and
(35)For a hybrid location, the total safety stock and holding cost are calculated using Eq. (36).
(36)and the total inventory holding cost is calculated using Eq. (37).
(37)Interpretation of the formulation
The modified formulation preserves three essential properties of the classical GSM. First, service times are dependent throughout different periods, thanks to Eq. (20) which is the inbound service time propagation constraint. Second, the safety stock at per location compensates the unreliability in the demand amounts relevant to its net replenishment time. Finally, there are explicit limits on service, for locations dealing with external demand only, not universally at all intermediate nodes.
Stochastic lead time has different impacts on both dependent and independent demands. While dependent demand utilizes conservative deterministic equivalent to account for lead time uncertainty, independent demand takes a direct approach by factoring in lead time uncertainty into the variance of demand in the replenishment period. In both cases, the resulting safety-stock expressions map directly to the standard relationship, as presented in Eq. (4).
(38)The formulation should therefore be interpreted as a stochastic-lead-time adaptation and data-driven application of the GSM. Its contribution is the integration of forecast-derived demand parameters and stochastic lead-time information with a GSM-based multi-echelon safety-stock optimization framework. It is not claimed as a new formal theoretical extension of the canonical GSM.
Solution methodology
In this study, a hybrid solution methodology based on a demand forecasting model using machine learning and an optimization approach to solve the MEIO problem is proposed. The hybrid framework combines the prediction ability of machine learning with the accuracy and optimality of mathematical programming. The methodology to solve the problem has two main parts: (i) a preprocessing step that estimates uncertain demand using machine learning, and (ii) an exact optimization step that solves the reformulated Quadratically Constrained Programming problem using a commercial software package. The proposed hybrid methodology is important to estimate demand accurately for better inventory planning and minimize costs when considering the required service level.
The methodological framework designed in this paper is shown in Fig 1 which represents an integrated approach. It includes disruption modeling, demand forecasting using machine learning, optimization, and robust validation.
Phase 1: Inputs and disruption modeling
In this phase the problem is identified in a systematic way and this involves the simultaneous collection and processing of two separate streams of input data. The SC characteristics and associated parameters such as lead time, inventory holding cost and CSL are identified in the first flow. The second flow then consists of inputs related to disruption modeling including probability of global events and geopolitical issues. The disruption probability is computed at this upstream stage, before demand forecasting, as it is used to describe the scenario context (operating environment) of the case study, and not as an input to the forecasting models themselves; the forecasting and optimization stages in Phases 2 and 3 are not dependent on the disruption-probability output. Combining the two input flows gives the disruption probability for each scenario, which shows how likely disruptions are under different scenarios [38]. After that, historical weekly demand data from Walmart retail stores are collected and prepared for forecasting with two supervised learning algorithms.
The prepared historical demand and the extracted features are then used to train two machine learning models, Linear Regression and XGBoost, which produce the demand predictions. The forecasting side of the work is heuristic in nature. Demand is probabilistic and non-stationary, so assumptions that fix its behavior in advance tend to be wrong. For that reason, retailer demand at different time points is represented through the supervised learning techniques of Linear Regression and XGBoost.
Phase 2: Forecasting and optimization
In the second phase, four forecasting methods were tested: seasonal naïve forecasting, exponential smoothing, Linear Regression, and eXtreme Gradient Boosting (XGBoost). Classical short-term forecasting benchmarks included seasonal naive forecasts and exponential smoothing. We tested feature based regression methods, namely Linear Regression and XGBoost. The comparison was performed to empirically determine whether the increased complexity of XGBoost was warranted for the given application.
The forecasting problem was defined as one-week-ahead prediction of weekly retailer demand. The chronological test period comprised 43 weeks for each of the six retailers, resulting in a total of 258 retailer-week out-of-sample forecasts. All four models were evaluated using the same forecast origins and test observations. Random splitting was avoided to prevent future observations from influencing predictions for earlier periods.
In the feature-based models, the predictor variables were the retailer identifier, the sequential time index, cyclical calendar features, lagged demand observations, and rolling demand averages. The lagged and rolling features were calculated separately for each retailer, using only observations available before the respective forecast date. We did not use target derived averages from the full dataset, as these could lead to look ahead bias.
As less than two full 52-week seasonal cycles were available prior to the test period, a traditional seasonal Holt-Winters model could not be used to reliably estimate annual seasonality. Holt’s trend exponential smoothing method was thus used as the exponential smoothing benchmark. An explicit benchmark for annual seasonality was added as a separate 52-week seasonal naive method.
Forecasting performance was evaluated using Root Mean Square Error (RMSE), Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE), and Mean Absolute Scaled Error (MASE). RMSE was calculated using Eq. (39).
(39)where denotes observed demand, denotes forecasted demand, and n denotes the number of out-of-sample observations. MAE was calculated using Eq. (40).
(40)MAPE was calculated using Eq. (41).
(41)Eq. (42) gives the MASE.
(42)where T is the number of observations in the model-development period and m = 52 is the seasonal period of the weekly demand series. We included MASE because it has no scale, which allows a comparison across retailers whose demand levels are very different. For all four measures, a lower value means better forecasting performance. Table 1 reports the out-of-sample results.
XGBoost performed substantially better than the two classical benchmarks. However, Linear Regression had the lowest overall out-of-sample errors, with an RMSE of 7540.35, an MAE of 5215.95, a MAPE of 4.589%, and a MASE of 0.736. XGBoost’s corresponding values were 7869.15, 5352.37, 4.647%, and 0.755. These results show that XGBoost was not more accurate than Linear Regression for every measure in this dataset and forecasting horizon. Nevertheless, XGBoost was retained for the downstream GSM analysis because the central methodological objective of this study is to examine the integration of a nonlinear tree-based forecasting model with multi-echelon safety-stock optimization. XGBoost can represent nonlinearities and interactions among lagged-demand, retailer, trend, and calendar features without imposing a linear functional form. Therefore, the downstream analysis should be interpreted as an XGBoost-based nonlinear demand scenario, rather than as an optimization scenario based on the statistically best-performing aggregate forecasting model. Linear Regression is retained as the strongest parsimonious forecasting benchmark. The percentage improvement of XGBoost relative to exponential smoothing was calculated using Eq. (43).
(43)where EETS and EXGB represent the respective error values obtained from exponential smoothing and XGBoost. For RMSE, the improvement was
For MAE, the improvement was
For MAPE, the improvement was
For MASE, the improvement was
Compared with exponential smoothing, XGBoost reduced RMSE by 37.75%, MAE by 33.03%, MAPE by 24.90%, and MASE by 33.03%. It also performed better than the seasonal naive method on all four measures. Past demand and calendar information, in other words, seem to give better forecasts than the single-series methods we tried.
Linear Regression had the lowest test errors of all the models: an RMSE of 7540.35, an MAE of 5215.95, a MAPE of 4.589%, and a MASE of 0.736. XGBoost was a little behind, with errors higher by 4.36% for RMSE, 2.62% for MAE, 1.27% for MAPE, and 2.62% for MASE. Therefore, the results do not demonstrate that XGBoost is universally necessary or superior. Instead, they demonstrate that both feature-based regression methods outperform the classical forecasting benchmarks, while Linear Regression provides the most accurate and parsimonious forecasting choice for the present dataset and one-week-ahead horizon.
After the comparison of the forecasts, the retailer-specific means and standard deviations of the XGBoost forecasts were calculated and used as demand parameters in the downstream GSM scenario. The parameters obtained from the forecast were combined with the replenishment lead-time, review-period, customer-service-level and inventory-holding-cost parameters. The use of XGBoost in this stage reflects the nonlinear machine-learning scenario of the study, and it does not mean that the lowest aggregate forecast errors were made by XGBoost here.
For the optimization step the nonlinear GSM was recast as a QCP and coded in Python with the Gurobi solver. The solution gives the safety-stock allocation and guaranteed service times that minimize total holding cost under the model’s constraints.
After each run we read Gurobi’s status and accepted a result only if the solver reported a feasible solution and the safety stock and service times stayed inside their bounds. When a model came back infeasible, we went back to the inputs, parameter definitions and constraints to find the cause. We never altered the formulation just to get a feasible answer.
Phase 3: Validation and robustness analysis
The last step is the validation and robustness analysis of the proposed framework. The validation of the forecast demand is performed by comparing the predicted demand and actual demand. Then, the sensitivity analysis is carried out to prove the robustness of the optimized solution for various cases of demand forecast. Performance prediction and optimization performance are two steps of performance assessment process. In the first phase, a few performance metrics (e.g., R2, MAPE, MAE, RMSE, MSE etc. for prediction performance) are used to measure the performance. In the second phase, the difference of costs between the expected and actual demand-based solutions, the obtained service level and computation time to solve are analyzed for the so called performance phrase. At last, managerial-decisions are taken for the optimal safety stock policy, on the basis of the obtained results. Apart from the evaluation of forecasting performance, the statistical properties of the demand series at the level of the retailer and the out-of-sample forecasting errors were analysed. The properties of the demand series were inspected by means of time series plots, the Augmented Dickey-Fuller test, the KPSS test and the linear trend test. The normality of the forecasting errors was analysed with the normal Q-Q plot, the Shapiro-Wilk test, the Jarque-Bera test, skewness and excess-kurtosis. The randomness of the residual was inspected with the autocorrelation function plots and the Ljung-Box (lag 10) test. All tests were performed at the 5% level for each retailer.
Computational experiments
This section describes the experiments used to evaluate the proposed hybrid method. It tests whether combining machine learning demand forecasts with the GSM can improve multi echelon inventory optimization (MEIO).
Dataset description
Retailer-level data is from Walmart Recruiting–Store Sales Forecasting dataset. Weekly_Sales field in the source provides information of weekly sales at store-department combination. We use department [department ID] at stores [list six store IDs] as six retailer series of one modeled product. We collect total 858 observations which consists of 143 weekly observations for each retailer from 5 Feb 2010–26 Oct 2012 data. The development period ends on 31 December 2011; the remaining 43 weeks per retailer form the chronological test period. The sales measure is treated as [state its unit/currency, or explain how it was converted to physical units].
The dataset consists of 858 observations, with 143 consecutive weeks of data for each of the six retailers, from 5 February 2010 to 26 October 2012. In order to preserve temporal ordering, observations before 2012/01/01 were used for model development, while observations between 2012/01/01 and 2012/10/26 were reserved as an untouched test period. We did not use random splitting. Calendar variables, a sequential time index and cyclical week and month features were constructed with information available at the forecasting date. Average values calculated over the whole dataset were excluded to avoid biasing. The important hyper parameters such as learning rate, number of estimators, maximum depth and subsample are optimized while applying XGBoost. As explained in solution methodology section, the designed approach is performed in two sequential steps: demand forecasting and optimization.
Computational environment
All optimization experiments were run in Python 3.12.14 using gurobipy and Gurobi Optimizer 13.0.3 on a 64 bit Linux system with an Intel Xeon Platinum 8370C CPU running at 2.80 GHz. It contain nine logical processors and 15.64 GB of RAM. We set Gurobi to use four threads fixed the seed at zero and limited each run to 3,600 seconds. Each instance was solved ten times.
Experimental design and assumptions
In this study, whether the proposed hybrid method could reduce the cost under uncertainty while meeting the required service levels is examined. The computational experiments are carried out under realistic assumptions. The demand is treated as a stochastic variable, which is described by the forecast mean and variability regarding its expected value and uncertainty. XGBoost predictions and errors are not assumed to follow a normal distribution. The approximation value is then tested by examining the out-of-sample forecast errors of individual retailers in the real world. The mean and standard deviation are inputs for the GSM model after examining the distributional and residual assumptions of data. The parameters are lead time and holding cost and are constant over time. The structure of the SC network is not changed so the differences of the results are due to the changes of demand. The experiments are aimed at checking and validating the idea given.
The purposes of the comparative forecasting experiment and the downstream optimization scenario are related but distinct. The forecasting experiment compares the relative prediction performance of the four models, while the optimization experiment assesses the proposed XGBoost-GSM integration. Thus, the use of XGBoost for the GSM case should not be considered as a contradiction to the overall forecasting comparison, where Linear Regression yields slightly lower errors.
Time-series and distributional diagnostic procedure.
The weekly demand observations were ordered chronologically for each retailer. For retailer j in week t, the out-of-sample forecast error was defined by Eq. (44).
(44)where and denote the observed and predicted weekly demand, respectively. Demand-series properties were evaluated using graphical analysis of the weekly demand series (Fig 2), the Augmented Dickey–Fuller (ADF) test, the Kwiatkowski–Phillips–Schmidt–Shin (KPSS) test, and a linear-trend test. Forecast-error normality was examined using normal Q–Q plots (Fig 3), the Shapiro–Wilk test, the Jarque–Bera test, skewness, and excess kurtosis. Error randomness was evaluated using residual autocorrelation function (ACF) plots (Fig 4) and the Ljung–Box test at lag 10.
Fig 2 shows the weekly demand of each of the six retailers from 5 February 2010 to 26 October 2012, with one panel per retailer. Because the panels have their own vertical scales, they are best compared by their shape rather than by their height. The figure shows that the retailers differ greatly in size. Average forecast demand ranges from about 30,529 units per week for Retailer 5–206,716 units per week for Retailer 4. It indicates each retailer needs a safety stock rule suitable to its demand.
The figure shows that none of the demand series remains close to a constant mean. What they show instead is a recurring pattern. Demand rises sharply in the holiday weeks at the end of each year and wanders within a narrower range the rest of the time. To capture these cycles we supplied the models with a time index, week and month features, lagged demand and rolling averages. Without them, predictable swings would be read as noise and the estimated uncertainty would come out too large.
The series also drift in different ways. Table 2 shows that the ADF test rejects a unit root for every retailer, so none of the series wanders off without bound. A significant trend shows up for Retailers 1, 3, 4 and 5, but not for Retailers 2 and 6 (p = 0.4030 and p = 0.7559). In plain terms, demand at Retailers 2 and 6 hovers around a fairly constant level while the other four shift slowly. The last 43 weeks, from January 2012, were kept as the test period and no model was fitted to them. Because scale, seasonality and trend all differ across retailers, we ran the diagnostics and chose the safety factor for each retailer separately.
Fig 3 shows Q–Q plots of the XGBoost test errors, 43 per retailer, standardized and plotted against normal quantiles. Points on the reference line mean roughly normal errors. This matters here because leans on the upper tail of the error distribution, and a normal curve can describe that tail badly.
The plots agree with Table 2. For Retailers 1, 2, 3 and 5 the points stay near the line and neither the Shapiro–Wilk nor the Jarque–Bera test rejects normality. Retailer 4 is borderline: Shapiro–Wilk narrowly fails to reject (p = 0.0596) while Jarque–Bera rejects (p = 0.0170). Retailer 6 is the clearest departure, rejected by both tests (p = 0.0009 and p = 0.0003). With only 43 points, some wobble appears even in perfectly normal data, so we read each plot together with its tests rather than alone.
Fig 4 asks whether one week’s error tells us anything about later errors. Each bar gives the correlation at one lag, and the shaded band is what we would expect from purely random errors. Bars inside the band suggest the model has absorbed trend, seasonality and the effect of past demand. Bars outside it would mean something was missed and neighboring errors move together. The GSM safety stock calculation adds weekly errors over the protection period as though they were independent, so this plot checks that assumption directly.
For Retailers 1, 2, 3, 4 and 6, the ACF plots and the Ljung–Box test at lag 10 show no clear leftover autocorrelation (p between 0.1433 and 0.3319). Retailer 5 is the exception (p = 0.0383), which hints at some remaining structure. It sits just under the 5% line and rests on 43 observations, so we read it as a warning and not as firm evidence. Putting this together with the normality tests, Retailers 1, 2 and 3 get the normal-theory factor and Retailers 4, 5 and 6 get the empirical one, following the rule in Uncertainty Representation and Scope.
Demand series that differ in scale and variance can mislead when pooled, which is why each retailer was tested on its own. All tests used a significance level of .
Time-series and forecast-error diagnostic results.
The diagnostics in Table 2 differ from retailer to retailer. Retailer 4 is a split case, with Shapiro–Wilk not rejecting normality (p = 0.0596) and Jarque–Bera rejecting it (p = 0.0170). Since our rule switches to the empirical factor as soon as either test rejects, Retailer 4 gets it. So does Retailer 5, because Ljung–Box finds leftover autocorrelation (p = 0.0383). Retailer 6 is the clearest case: both normality tests reject, and it too gets the empirical factor.
Every retailer rejects the unit root in the ADF test, but the KPSS and trend tests disagree with one another, so the series are not equally stationary. That is one more reason the models carry time and seasonal features.
Normality and independence were checked retailer by retailer. A test that fails to reject its null does not prove the assumption holds.
Uncertainty representation and scope.
Three sources of variation are considered here: movement in forecast demand over time, forecast errors, and uncertainty in replenishment lead times. Each is a separate factor.
For retailer j and product p, denotes the XGBoost forecast for test week t. The forecast mean and standard deviation used as GSM inputs, reported in the Case Study section, are computed from the 43 weekly forecasts taken in chronological order, through Eqs. (45) and (46).
(45)(46)Thus, describes the week-to-week dispersion of the 43 XGBoost point forecasts over the test period. It is the standard deviation of the forecast sequence and is used as the forecast-based demand-variation input to the GSM. By itself, it is not a measure of forecast accuracy or forecast error, and it is not a prediction interval.
Forecast error is evaluated separately. For retailer j in week t, the error is defined in Eq. (44) as the observed demand minus its forecast. The resulting residuals are used for forecast-performance and distributional diagnostics; they are distinct from the forecast-sequence standard deviation .
Lead-time uncertainty is represented separately by the specified parameters and . For dependent demand, it enters through the deterministic equivalent in Eq. (1); for independent demand, it enters the protection-period variance in Eq. (2). The formulation assumes demand and lead time are independent. Lead-time uncertainty is not estimated from the 43 forecast errors, and the experiments do not model disruption probabilities.
The normal-theory factor is used for a retailer only when both the Shapiro–Wilk and Jarque–Bera tests fail to reject normality at the 5% level and the Ljung–Box test finds no significant autocorrelation. If any of these checks fails, the retailer gets the empirical factor. That factor comes from just 43 test errors per retailer, so it is a small-sample estimate and not a robust or guaranteed 97% coverage level.
XGBoost training configuration and validation.
We trained XGBoost with xgb.train, using the reg:squarederror objective and mean absolute error (MAE) as the evaluation metric (Table 3). Training ran for at most 500 boosting rounds and stopped early if validation MAE did not improve for 20 rounds. In the code the evaluation set is labeled “test”, but it is really a validation subset and not the external test set.
The date split came first: data up to 30 December 2011 were used for model development, and observations from 6 January 2012 onward were held out as the external test set. We then split the development data with train_test_split, holding out 30% for validation with random_state = 42. We did not pass shuffle = False, so this split was shuffled, which is the default.
We did not run a grid, random or Bayesian search and set no parameter ranges. Learning rate, maximum depth, subsample and the other parameters stayed at their XGBoost defaults. The package version and the best iteration found by early stopping are not recorded in the materials we had.
Industrial case study description
The study merges weekly sales data for six store and department combinations and a given GSM network. Each sales series comprises 143 observations, for a total of 858 observations. The data are separated by date. All observations before 1 January 2012 are used for the development of the models, while observations from 1 January to 26 October 2012 are used for the test period. Each retailer has 43 observations. The forecasts obtained in this way are then used as demand inputs to the GSM.
The GSM network has three stages: one production plant, two distribution centres (DC1 and DC2), and six retailers (R1–R6). The plant uses Raw1 and Raw2 to produce SKU1. Each retailer is assigned to one distribution centre, and the assignment remains fixed during optimization (Fig 5). The model therefore represents a fixed network with one finished product, two raw materials, and unlimited capacity. Inventory is calculated at a 97% cycle service level.
The data from Walmart give weekly sales for each store and department but exclude plant, distribution centers or links between retailers and centers in the GSM network. The network details are to be reported separately. For each input to the GSM, e.g., network links, lead times, review periods, holding costs provide the value, unit and source. Also include which distribution center serves which retailer.
In conclusion, the discussed case study shows an example of a multi-echelon SC in which one factory produces goods from raw materials and then ships them to two separate distributors who deliver these products to two sets of different retailers for efficient decentralized distribution.
Case study
We applied the QCP formulation to a case-study SC with one production plant, two distribution centres, and six retailers. Table 1 compares the forecasting models on the aggregate data. Linear Regression gave the lowest out-of-sample errors overall. XGBoost came close, though, and did better than both the seasonal-naïve and exponential-smoothing benchmarks.
We still used the XGBoost forecasts in the case study, because the aim was to test an XGBoost–GSM scenario, that is, a GSM framework driven by a nonlinear machine-learning forecaster. This was a choice made for the research question. We are not claiming that XGBoost is better than Linear Regression in general, or that the difference between them is statistically significant.
Table 1 reports one-week-ahead results pooled over all six retailers, and there Linear Regression had slightly lower errors than XGBoost. Performance varied from one retailer–product series to another, so we ran a separate validation and test comparison on the series used in the GSM case study.
Table 4 shows that for these series XGBoost had lower RMSE, MAE, and MAPE, and a slightly higher R2, than Linear Regression. We therefore used XGBoost for the GSM case study. That result is limited to the selected series and should not be read as XGBoost always beating Linear Regression.
XGBoost had lower errors than Linear Regression in both validation and testing for the selected series. On the test data, RMSE fell from 8826.93 to 8539.47 and MAE from 6247.85 to 6238.14, and R2 edged up from 0.9844 to 0.9854. The gains are small, but they were enough for us to choose XGBoost as the nonlinear forecaster for the GSM case study.
Table 4 lists five observations from Retailer 1. XGBoost comes closer to actual demand in three of them and Linear Regression in the other two. Five points are a tiny slice of the test period, so they cannot say which model is better overall.
Over the full series, XGBoost tracked actual sales more closely, probably because it picked up nonlinear patterns and shifts that a linear model flattens. That made it a sensible forecaster for the inventory analysis.
Fig 6 plots actual demand against the XGBoost forecast from January to November 2012. The forecast follows the weekly movements well, though it runs a little low at the peaks in February and October.
Fig 7 adds the Linear Regression forecast for the same period. Both models follow the overall demand pattern and both drift from the actual values in some high-demand weeks. The figure illustrates the forecast scenario used in the GSM analysis; it does not show that XGBoost beat Linear Regression.
From Table 5, retailer 4 has the maximum mean demand of 206716 units, and retailer 3 the minimum demand of 39526 units among the six retailers. Also, retailer 6 has the maximum variation of demands with standard deviation of 11703 and retailer 5 the least with standard deviation of only 1448 units.
Integration of machine learning forecasting with the guaranteed service model.
For the downstream GSM case study, the XGBoost forecasts are retained as a nonlinear comparative demand scenario. This selection should not be interpreted as evidence that XGBoost is universally superior: Linear Regression produced the lowest aggregate out-of-sample errors reported in Table 1, while XGBoost more closely followed several nonlinear demand changes for the selected retailer–product series.
Fig 8 shows the mean and standard deviation of demand prediction for six SKU1–Retailer combinations. The mean of demand differs greatly between the retailers; for example, the highest mean demand is for SKU1-Retailer 4, which amounts to about 225000, while the lowest mean is observed in SKU1-Retailer 5, which is around 52000. The standard deviations differ across retailers and describe the dispersion of the predicted demand values. However, a relatively low standard deviation does not, by itself, demonstrate forecasting accuracy or normality. Forecasting accuracy is evaluated using the out-of-sample performance measures reported previously, while the adequacy of the distributional assumptions is assessed using the retailer-specific residual diagnostics presented in Time-Series and Forecast-Error Diagnostic Results Section. This shows that the prediction by the model is stable, and there is little error in predictions.
For retailer series satisfying the residual diagnostic criteria, the normal-theory safety factor may be retained in the safety-stock calculation. At a 97% cycle service level,
(47)For series where normality or independence is rejected, the empirical 97th percentile of the standardized out-of-sample forecast errors provides a distribution-free robustness alternative:
(48)Here is the empirical 97th percentile, is retailer j’s mean out-of-sample forecast error, and is the sample standard deviation of its errors. The retailer-specific factor takes the place of the normal critical value in the safety-stock formula, and everything else in the GSM stays as it was.
Table 6 reports the GSM results obtained with demand forecasts from the selected machine learning model, listing guaranteed service time, safety stock and holding cost for every node. Service time is zero at every node except Plant SKU1, where it is four weeks, so the remaining nodes handle uncertainty by holding safety stock. Safety stock varies widely across the network. Retailer 4 holds the most, 319765 units costing about $38,371 to hold, while Retailer 5 holds only 29025 units at a cost of $3,482. In general, retailers with higher demand need more safety stock.
To check the GSM against observed demand, we solved the model with actual historical demand over the same 11-node network. As Table 7 shows, the service time policy is unchanged, with four weeks at Plant SKU1 and zero weeks at every other node. Total holding cost came to $131,150.02, against $123,140.92 in the forecast-based scenario, an increase of about 6.5%.
Table 5 summarizes the 43 weekly XGBoost forecasts for each retailer. The average forecast ranges from 39,526 for Retailer 3–206,716 for Retailer 4, and the standard deviation of the weekly forecasts from 1,448 for Retailer 5–11,703 for Retailer 6. Those figures only show how much the forecasts move from week to week; they tell us nothing about accuracy. Accuracy comes from the test set metrics, and the forecast errors are examined through the diagnostics in Table 2.
When neither normality test rejects and the Ljung Box test finds no significant autocorrelation, the normal-theory safety factor is used, namely at a 97% cycle service level. If either normality test rejects, or Ljung–Box finds significant autocorrelation, we use instead the empirical factor computed from the standardized forecast errors, as defined above. The factor goes into the GSM safety stock calculation. It is estimated from only 43 test errors per retailer, so a handful of observations can move it noticeably and it should not be read as a guarantee of 97% coverage.
Demand peaks and extreme inventory outcomes.
In the graph where observed demand and predicted demand plotted, XGBoost obeys regular pattern.It is low at the month of February and summit at October. Maximum demand weeks less fitted well than simple ones. This is only a visual impression: we did not compute forecast errors for the peak weeks, so it is not a statistical test of accuracy under extreme demand.
Mean and weekly standard deviation of 43 forecasts per retailer has been shown on Table 5. They explain the mobility and hugeness of forecasts. It doesn’t say anything about accuracy.
Retailer 4 retains most safety stock in forecasting based GSM. it contains 319,765 units at the cost of $38,371. Retailer 5 holds 29,025 which is minimum. Costing is $3,482 here. In observing portion Retailer 4 again contains maximum unit, which is 334,820. The difference between them is 15,055. Safety stock follows demand scale and a node’s position in the network. The Retailer 4 result is specific here.
Computational performance and scalability analysis
Computational performance has been checked on two known cases. One is industrial benchmark which is published and contains six nodes [39] alongside our own eleven node case study. We run this twice. Firstly with forecast demand and secondly with actual demand. Deterministic three echelon networks of 25, 50 and 60 nodes has been generated to check how model scales. They match the case study parameter ranges, node types, customer service limits, lead-time uncertainty and objective. They only differ in containing retailers and distribution centers. They are not real datasets, only for scalability testing. Each of the instance was solved ten times in this enviroment.
In each run globally optimal solution was touched by Gurobi. This has been shown in Table 8. The benchmark objective for six-node was $161,842.96. This one was rounded to 161,843. Our case study provides $131,1510.02 with actual demand and $123,140.92 with forecast demand.
In all cases mean runtime remained below 0.02 seconds. Peak Gurobi memory rose from 0.0034 GB to 0.0041 GB. Runtime rise was initially 0.0113 s at 25 nodes. After that it becomes 0.0159 s at 60 nodes. On the same range deterministic work was done 0.0020 to 0.0050 units.
Our restricted Gurobi license allows at most 200 variables in a model with quadratic constraints. Among three variables 60-node model, at 180 variables was largest. Unrestricted license is needed for industrial networks beyond 60 nodes.
Comparative discussion
We evaluated the framework by comparing the GSM solution built on XGBoost forecasts with the one built on actual demand. Figs 9 and 10 show safety stock and holding cost at the retailers, distribution centres and plant. The service-time policy is identical in both cases: Plant SKU1 holds no safety stock and guarantees service in four weeks. In this case study the decisions were stable across the two demand scenarios.
Fig 9 shows slightly higher safety stock under actual demand, with small gaps. Retailer 4 holds the most, rising from about 319,765 units under forecast demand to 334,820 under actual demand, and the other retailers and both distribution centres show the same direction. The two solutions are close enough that XGBoost forecasts look adequate for safety stock planning here.
Fig 10 compares holding costs: about $123,141 under forecast demand and $131,150 under actual demand, a gap of roughly 6.5%. Retailer 4 has the highest holding cost in both cases, while the plant and Retailer 5 have the lowest. With totals this close, the forecast-based approach gave a cost estimate near the actual-demand result.
On the selected series XGBoost handled the nonlinear demand patterns better than Linear Regression, with lower RMSE, MAE and MAPE and a higher R2. That supports using its forecasts in a GSM that sets safety stock for a 97% cycle service target. Given how close the two optimization results are, the framework looks capable of supporting multi-echelon inventory planning under the uncertainty considered here.
The residual checks show that forecast errors do not meet the normality and independence assumptions for every retailer. The evidence supports normality for Retailers 1, 2 and 3, is mixed for Retailer 4, shows some serial dependence for Retailer 5, and fails both normality tests for Retailer 6. In the framework, normality is therefore an approximation to be checked retailer by retailer and not something assumed. Where a check raises concerns, safety stock can be set from empirical error quantiles or by simulation.
Managerial insights and discussion
Interpretation of forecasting and inventory results.
Our restricted Gurobi license caps models with quadratic constraints at 200 variables, and since the implementation creates three decision variables per node, the 60-node model (180 variables) was the largest we could run. Nothing here speaks to industrial networks with more than 60 nodes.
The GSM run with forecast demand had a total holding cost of $123,140.92, versus $131,150.02 with actual demand. The $8,009.10 gap is about 6.1% of the actual-demand result. It shows that the optimized holding cost depends on the demand inputs. It is not a saving that forecasting would deliver in practice, nor does it prove the forecasts are more accurate. Safety stock decisions should be judged together with the 97% customer service target and the holding cost objective.
The spread in holding costs also shows managers where to look first. The plant and Retailer 5 carry far lower costs than Retailer 4, so Retailer 4 is a sensible starting point: examine its forecast residuals, lead-time assumptions and service-time settings, then rerun the GSM to see whether a change lowers cost while still meeting the service target. Rather than relying on one forecast or one inventory plan, the results point toward regular review of forecasts and safety stocks, one retailer at a time.
Relation to earlier work on forecasting and decision support.
Recent studies use machine learning for inventory decisions in several ways. Punia et al. [40] solve a capacity-constrained multi-item newsvendor problem directly from data, without assuming a demand distribution. van der Haar et al. [41] train models to predict inventory decisions themselves, with a loss function built around those decisions, and test it with lost sales, perishable goods and two supply sources. Together they show that machine learning can help choose the inventory action and not just forecast demand.
Studies from renewable energy offer useful parallels in forecasting and model analysis, although their problems are not inventory problems. Sarıışık et al. [22] combined ensemble methods to forecast wind and solar power for street lighting, added SHAP analysis and robustness checks, and found the hybrid system varied less in output than photovoltaic power alone. Cakiroglu et al. [42] compared six machine learning methods for predicting wind turbine power and used SHAP to see how environmental factors shaped the predictions. Both support ensemble forecasting and model interpretation, but neither considers inventory across several SC stages.
There is a methodological link to our work all the same. We feed retailer-level demand forecasts into the GSM and look at safety-stock allocation, service level and holding cost; the energy studies ask how forecasts and robustness checks can inform a decision in their own setting. Results cannot be compared directly, since holding cost in a SC is a different quantity from power-output variability. Robustness in our study means two things: checking the forecast-error assumptions retailer by retailer, and comparing the GSM solution built on forecasts with the one built on actual demand. It is not evidence of resilience to disruptions, which we did not examine.
Our framework forecasts demand first and then hands the forecasts to a multi-echelon GSM. This separation lets the GSM represent service times and safety-stock placement across the network and keeps the forecasting and planning stages visible. The results are best read as a case-based evaluation of a forecast-to-GSM pipeline, not as a head-to-head comparison with methods that learn decisions directly. Datasets, networks, objectives and baselines differ across these studies, so their cost and error values cannot be set against ours.
Practical scope.
The recommendations hold only for the case studied: one SKU, a fixed network and unlimited capacity. They are a starting point for judging how demand forecasts affect holding cost and safety stock under these assumptions. Before applying the model to networks with several SKUs, capacity limits or changing connections, managers should adapt it and revisit the trade-off between service level and cost.
Conclusion
This study examined how retailer-level demand forecasts shape multi-echelon safety-stock decisions by linking machine-learning forecasting to a stochastic-lead-time Guaranteed Service Model (GSM) formulated as a quadratically constrained program (QCP). In chronological one-week-ahead forecasts for six retailer series, both feature-based models clearly beat the seasonal naïve and Holt’s exponential smoothing benchmarks. Linear regression had the lowest aggregate error (RMSE 7,540), just ahead of XGBoost (7,869). On the series used in the case study, however, XGBoost was slightly more accurate, so we adopted it as the demand input to the GSM. This does not show that XGBoost is generally better than linear regression.
When we applied the model to the network of one plant, two distribution centers, and six retailers, the total holding cost at a 97% cycle service level came to with forecast demand and $131,150 with observed demand. The two solutions had the same service-time policy and distributed safety stock in much the same way, with Retailer 4 holding the largest buffer in both. The gap between the totals tells us that optimized holding cost depends on the demand inputs. It is not a saving that forecasting would deliver in practice. Normality held up in the residual diagnostics for only some retailers, so for the others we set the safety factor from empirical error quantiles. These rest on just 43 errors per retailer and therefore cannot guarantee the target service level. On the computational side, Gurobi solved every instance to optimality, including synthetic networks of up to 60 nodes, in under 0.02 seconds on average, although the solver license capped the largest network we could test. In practice, we suggest reviewing safety stocks one retailer at a time, starting with those that hold the largest buffers. Their forecast residuals, lead-time assumptions, and service-time settings are the first things to check before re-running the model.
Several limitations apply. The model covers a single SKU in a fixed network and has no capacity or fill-rate constraints. The lead-time and cost parameters were specified for the case study rather than observed in the retail data. We relied on one 43-week test period and ran XGBoost with default hyperparameters. Future work could use rolling-origin validation on longer histories, together with probabilistic forecasting. For retailers whose errors are non-normal or autocorrelated, bootstrap or simulation-based safety stocks would be more suitable, and simulation could also check the service level actually achieved, including fill rate. Other extensions include multiple SKUs, capacity limits, explicit disruption modeling, and larger industrial networks.
References
- 1. Mashud AHM, Miah S, Daryanto Y, Chakrabortty RK, Hasan SMM, Tseng M-L. Inventory decisions on the transportation system and carbon emissions under COVID-19 effects: A sensitivity analysis. Comput Ind Eng. 2022;171:108393. pmid:35813970
- 2. Katangoori A. An empirical analysis of data-driven supply chain optimization in retail and logistics. Supply Chain Analytics. 2026;14:100206.
- 3. Hossain MS, Parvin F. A comparative study of various statistical and machine learning models for predicting restaurant demand in Bangladesh. PLoS One. 2025;20(6):e0325449. pmid:40465762
- 4. Deng G, Li K, Liang L. Robust optimization of pharmaceutical inventory under supply and demand uncertainty: a multi-period CVaR model based on the SPD framework. Industrial Management & Data Systems. 2026:1–27.
- 5. Goltsos TE, Syntetos AA, Glock CH, Ioannou G. Inventory – forecasting: Mind the gap. European Journal of Operational Research. 2022;299(2):397–419.
- 6. Tan ND, Kim H-S, Long LNB, Nguyen DA, You S-S. Optimization and inventory management under stochastic demand using metaheuristic algorithm. PLoS One. 2024;19(1):e0286433. pmid:38180984
- 7. Priyamvada , Kumar A. Modelling retail inventory pricing policies under service level and promotional efforts during COVID-19. J Clean Prod. 2022;381:134784. pmid:36348963
- 8. Tadayonrad Y, Ndiaye AB. A new key performance indicator model for demand forecasting in inventory management considering supply chain reliability and seasonality. Supply Chain Analytics. 2023;3:100026.
- 9. Inderfurth K. Safety stock optimization in multi-stage inventory systems. International Journal of Production Economics. 1991;24(1–2):103–13.
- 10. Clark AJ, Scarf H. Optimal Policies for a Multi-Echelon Inventory Problem. Management Science. 1960;6(4):475–90.
- 11. Ekanayake N, Joshi N, Thekdi SA. Comparison of single-echelon vs. multi-echelon inventory systems using multi-objective stochastic modelling. IJLSM. 2016;23(2):255.
- 12. Simpson KF. Jr. In-process inventories. Operations Research. 1958;6(6):863–73.
- 13. Eruguz AS, Sahin E, Jemai Z, Dallery Y. A comprehensive survey of guaranteed-service models for multi-echelon inventory optimization. International Journal of Production Economics. 2016;172:110–25.
- 14. Achkar VG, Brunaud BB, Pérez HD, Musa R, Méndez CA, Grossmann IE. Extensions to the guaranteed service model for industrial applications of multi-echelon inventory optimization. European Journal of Operational Research. 2024;313(1):192–206.
- 15. Douaioui K, Oucheikh R, Benmoussa O, Mabrouki C. Machine Learning and Deep Learning Models for Demand Forecasting in Supply Chain Management: A Critical Review. ASI. 2024;7(5):93.
- 16. Sanni JO. Artificial intelligence driven demand forecasting models addressing volatility in complex service organizations. Comput sci IT res j. 2026;7(1):1–26.
- 17. Zhang J, Yuyang W, Zidu W. Enhancing Supply Chain Forecasting with Machine Learning: A Data-Driven Approach to Demand Prediction, Risk Management, and Demand-Supply Optimization. JFBA. 2024;2(1):1–5.
- 18. Yang Y, Wang M, Wang J, Li P, Zhou M. Multi-Agent Deep Reinforcement Learning for Integrated Demand Forecasting and Inventory Optimization in Sensor-Enabled Retail Supply Chains. Sensors (Basel). 2025;25(8):2428. pmid:40285118
- 19. Zohdi M, Rafiee M, Kayvanfar V, Salamiraad A. Demand forecasting based machine learning algorithms on customer information: an applied approach. Int j inf tecnol. 2022;14(4):1937–47.
- 20. Khan MA, Saqib S, Alyas T, Ur Rehman A, Saeed Y, Zeb A, et al. Effective Demand Forecasting Model Using Business Intelligence Empowered With Machine Learning. IEEE Access. 2020;8:116013–23.
- 21. Spiliotis E, Makridakis S, Semenoglou A-A, Assimakopoulos V. Comparison of statistical and machine learning methods for daily SKU demand forecasting. Oper Res Int J. 2020;22(3):3037–61.
- 22. Sarıışık G, Öğütlü AS, Demir S, İlhan N, Abualigah L. Machine learning–driven forecasting and robustness analysis of hybrid wind–solar energy systems for urban street lighting applications. Engineering Applications of Artificial Intelligence. 2026;181:115755.
- 23. Zhang X, Sun T, Han X, Yang Y, Li P. Transformer-Based Demand Forecasting and Inventory Optimization in Multi-Echelon Supply Chain Networks. 2576-6821. 2025;9(12):1–9.
- 24.
Cheng L, Luo J, Fan W, Zhang Y, Li Y. A Deep Q-Network Based on Radial Basis Functions for Multi-Echelon Inventory Management. In: 2023 Winter Simulation Conference (WSC), 2023. 1581–92. https://doi.org/10.1109/wsc60868.2023.10407308
- 25.
Hammler P, Riesterer N, Mu G, Braun T. Multi-echelon inventory optimization using deep reinforcement learning. Quantitative models in life science business: from value creation to business processes. Springer. 2022. p. 73–93.
- 26.
Ziegner G, Choi M, Le HMC, Sakhuja S, Sarmadi A. Iterative Multi-Agent Reinforcement Learning: A Novel Approach Toward Real-World Multi-Echelon Inventory Optimization. In: 2025. https://doi.org/arXiv:250318201
- 27. Rizqi ZU, Chou S-Y. Neuroevolution reinforcement learning for multi-echelon inventory optimization with delivery options and uncertain discount. Engineering Applications of Artificial Intelligence. 2024;134:108670.
- 28.
Gu L, Zhou Y, Zhang Z. Multi-echelon Inventory Optimization of Spare Parts considering Cross-region Transshipment and Changing Demand. In: 2020 Global Reliability and Prognostics and Health Management (PHM-Shanghai), 2020. 1–6. https://doi.org/10.1109/phm-shanghai49105.2020.9281010
- 29. Wang J, Zhou S, Li M, Ren G, Ren X, Xiong X, et al. Multi-echelon inventory optimization of waste electrical and electronic equipment closed-loop supply chain based on reinforcement learning under carbon tax policy. Engineering Applications of Artificial Intelligence. 2025;154:110987.
- 30. Liu Z, Nishi T. Data-driven evolutionary computation for service constrained inventory optimization in multi-echelon supply chains. Complex Intell Syst. 2023;10(1):825–46.
- 31.
Klosterhalfen S, Minner S. Comparison of stochastic-and guaranteed-service approaches to safety stock optimization in supply chains. In: Operations Research Proceedings 2006: Selected Papers of the Annual International Conference of the German Operations Research Society (GOR), Jointly Organized with the Austrian Society of Operations Research (ÖGOR) and the Swiss Society of Operations Research (SVOR), Karlsruhe, 2007. 485–90.
- 32. Humair S, Ruark JD, Tomlin B, Willems SP. Incorporating Stochastic Lead Times Into the Guaranteed Service Model of Safety Stock Optimization. Interfaces. 2013;43(5):421–34.
- 33.
Eruguz AS. Contributions to the multi-echelon inventory optimisation problem using the guaranteed-service model approach. 2014.
- 34.
Eruguz AS, Jemai Z, Sahin E, Dallery Y. Cycle-Service-Level in Guaranteed-Service supply chains. In: 2013 5th International Conference on Modeling, Simulation and Applied Optimization (ICMSAO), 2013. 1–6. https://doi.org/10.1109/icmsao.2013.6552572
- 35. Schoenmeyr T, Graves SC. Coordination of Multiechelon Supply Chains Using the Guaranteed Service Framework. M&SOM. 2022;24(3):1859–71.
- 36. Abdullhadi S, Al-Qudah DA, Abu-Salih B. Time-aware forecasting of search volume categories and actual purchase. Heliyon. 2024;10(3):e25034. pmid:38317988
- 37. Graves SC, Willems SP. Optimizing Strategic Safety Stock Placement in Supply Chains. M&SOM. 2000;2(1):68–83.
- 38. Lin F, Shi J, Wu P, Zhuo X. Retailer’s Optimal Procurement Strategy under Supply Disruption and Stochastic Demand: Backup Sourcing or Simultaneous Sourcing. Complexity. 2020;2020:1–15.
- 39. Willems SP. Data Set—Real-World Multiechelon Supply Chains Used for Inventory Optimization. M&SOM. 2008;10(1):19–23.
- 40. Punia S, Singh SP, Madaan JK. From predictive to prescriptive analytics: A data-driven multi-item newsvendor model. Decision Support Systems. 2020;136:113340.
- 41. van der Haar JF, Wellens AP, Boute RN, Basten RJI. Supervised learning for integrated forecasting and inventory control. European Journal of Operational Research. 2024;319(2):573–86.
- 42. Cakiroglu C, Demir S, Hakan Ozdemir M, Latif Aylak B, Sariisik G, Abualigah L. Data-driven interpretable ensemble learning methods for the prediction of wind turbine power incorporating SHAP analysis. Expert Systems with Applications. 2024;237:121464.