Skip to Content

The use of simulations in inventory management

September 2, 2026 by
The use of simulations in inventory management
Leandro Santos

Anyone working in operations planning has likely heard the phrase "we need to optimize our inventory." It is a common phrase, yet it targets a goal that is difficult to achieve through deterministic methods. In this article, we will first examine the concept of safety stock and subsequently the concept of cycle stock, demonstrating that the formulas used for them rely on assumptions that often fail to reflect reality.

Indeed, there are countless publications explaining how to calculate these stocks; however, we will show that simulations are far more suitable techniques for determining inventory levels within companies.

 

Limitations on the formula for safety stock

Safety stock can be considered a “buffer” inventory intended to absorb unexpected fluctuations in demand and supply. Virtually the entire supply chain planning system relies (or should rely) on its formulation. One of the most comprehensive articles on its calculation can be found in “Crack the Code” by Peter L. King, CSCP (APICS Magazine, 2011), available at:

 https://web.mit.edu/2.810/www/files/readings/King_SafetyStock.pdf

The formula presented by the author , is based on the standard deviation derived from the sum of demand and supply variances, multiplied by a factor that determines the service level. Why the sum of variances? Because, in this formula, the events are considered independent. Let us recall how to calculate the sum of variances:

VAR(A+B) = VAR(A) + COV(A,B) + VAR(B)

Since, in theory, there is no correlation between demand and supply variances, the COV(A,B) factor is zero; therefore, VAR(A+B) = VAR(A) + VAR(B).

Issues with the assumptions underlying the safety stock formula.

The first assumption is that these deviations follow a normal distribution, represented by the Z-factor. A common mistake many professionals make is calculating deviations using historical averages for sales and supply lead times. Many use Excel's VAR() or STDEV() functions—which calculate variance and deviation relative to the average. This error tends to bias the results, inflating the calculated value. Note the difference between deviations calculated against a model that captures, for instance, sales seasonality, versus those calculated against the historical average:

               

Notice that the standard deviation of historical data relative to the model is lower than the deviation relative to the average. Furthermore, in the first case, the variance remains constant across the n periods — a condition known in classical statistics as homoscedasticity. This is a rule that must not be violated, as it ensures the model's estimators remain unbiased.

To adapt the safety stock formula, some authors suggest replacing the demand standard deviation with the Root Mean Square Error (RMSE). Since many companies already calculate historical demand errors, this alternative offers a simple adjustment solution, as it calculates the error relative to the estimate (ӯ) rather than the historical average.

Does this guarantee a normal distribution of residuals? Unfortunately, it is not that simple. For this to hold true, the demand planner would need to conduct a residual analysis to confirm the correct distribution of the residuals.

Is it possible for the residuals of a time-series model, for instance, to be independent and identically distributed (i.i.d.) yet non-normally distributed? Yes. In such cases, using the Z-factor is simply incorrect. Adapting this term to other distributions (log-normal, gamma, etc.) is essential to ensure the service level aligns with the safety stock level. Similarly, residual analysis should also be applied to lead-time deviations (σLT).

An important question arises: are these the only two types of unexpected fluctuations that safety stock should absorb? Clearly not. Consider the following scenarios:

- A company receives a batch from a supplier and rejects it after a physical product strength test.

- A company produces a batch and determines, through physical testing, that the product fails to meet specifications.

- Sometimes, the physical stock does not match the stock in the system.

Safety stock does not account for inventory record inaccuracies and yield losses (e.g., supplier scrap rates, QA holds). In the cited examples, the loss of a batch may be unavoidable, requiring the company to factor this type of unexpected event into its safety stock.

The final point to analyze in our safety stock formula is the term PC/T. According to the author, this term refers to the ratio of the total lead time (performance cycle) to the time period used to calculate demand standard deviation. This term is intrinsically linked to the concept of cycle stock, which we will examine next.

Limitations of the cycle stock concept

Cycle stock can be understood as the quantity of products required to meet regular demand over a specific period and is directly related to the term "performance cycle."

The author defines "performance cycle" (PC) as follows: “The performance cycle includes the time needed to perform functions such as deciding what to order or produce, communicating orders to the supplier, manufacturing and processing, and delivery and storage, as well as any additional time required to return to the start of the next cycle.”

He establishes a relationship between this time and the time used to calculate demand deviation (), including the following example: “...if the standard deviation of demand is calculated from weekly demand data and the total lead time including review period is three weeks, the standard deviation of demand is the weekly standard deviation times the square root of the ratio of the time units, or √3.”

Note, therefore, that the term PC could easily be replaced by the economic order quantity (EOQ) and the term T could be replaced by the quantity demanded during the reference period. The new term would then be: EOQ / Qperiod, where:

EOQ = economic lot

Qperiod = quantity demanded per period

In other words, if a company calculates the EOQ for a specific SKU as 3,000 units and the weekly demand for that SKU is 1,000 units, the value of the new term will be 3, since the planner will reschedule orders every 3 weeks.

Although EOQ is used by many companies, the concept is also open to criticism. One such criticism concerns the assumption of linear SKU consumption or sales throughout each period. The EOQ represents the quantity that minimizes the product's total ordering cost—the sum of holding costs (for keeping material in stock) and ordering costs (for producing or purchasing it). However, for highly seasonal items, this quantity might be consumed rapidly during high-demand periods, driving ordering costs higher than expected, or consumed slowly during low-demand periods, driving holding costs higher than expected.

Conclusion

Many variables impact a company's safety stock. Calculating it deterministically while accounting for all variables, including quality metrics or inventory accuracy, remains a major challenge. Stochastic simulations offer an interesting alternative, providing valuable insight into the correlations among the company's metrics:

·  Given forecast accuracy + inventory accuracy + estimation error distribution + rejection rate of the supplier, what would be the probability of a stockout?

·  Given the costs of replenishment and inventory holding, what would be the economic order quantity (EOQ)? And assuming this quantity, what is the impact on the probability of a stockout?

·   By how much would I reduce my average inventory if I improved my forecast accuracy?


Simulation file

Attached to this article is a suggested simulation file I created in 2014. Initially it may seem complex at first but notice how it gives you a good idea of how the variables correlate.

On the “FIELDS” sheet, you will find a brief description of the input variables (white cells) and output variables (blue or yellow cells). You should update the input variables/cells on the “SIMULATION” sheet by entering the demand over a range of periods (monthly or annual), the standard deviation for each period, the error distribution (only two available: normal or lognormal), the desired service level, inventory error, adjusted EOQ (if there are constraints), lead time and lead time deviations, quality index and, most interestingly, the safety time (rather than safety stock). The stockout probability is displayed (as an output), along with other outputs (blue cells).

Seasonality for each group of periods must be updated on the “PERIODS” sheet, following a naming convention where the prefix indicates whether the analysis is D (Daily), W (Weekly), or M (Monthly), and the suffix indicates the seasonality distribution: 0 (no seasonality / evenly distributed) or S (with seasonality). The percentages for each period should be updated according to the seasonality of the item being analyzed. To make updating faster, recalculation is manual; that is, to update the outputs, you must press <F9>.


PLANNING SIMULATION.xlsx

Linear regression
In problem formulation