Safety stock is an important component of your overall inventory strategy. Cycle stock is, too. In this article, we'll go through how to calculate safety stock. Although we won't go through the steps of calculating your cycle stock (aka EOQ - economic order quantity), it is an important component to consider when calculating your safety stock.
Note: If you are looking for our Safety Stock Calculator (a free resource), jump to it right here ›
Safety stock is the amount of inventory that will minimize stockouts. You are most vulnerable of stocking out within your replenishment order lead time (which is a function of your cycle stock).
There are some core ingredients when it comes to calculating safety stock:
- Forecast error or demand variability - We will dive into how you should calculate forecast errors. Side benefit: some of the calculations we use here are what you should already be using to monitor your forecasting process. You are doing that, right?
- Order size (e.g., cycle stock) - As I mentioned, we'll just take what you currently use for order size (or lot size) when replenishing your supply. We won't go through the process of calculating this order size.
- Desired service level - This is the service level that you want to have for your particular product. This single little input is probably the most intra-company political one. The Sales team would want a 100% service level, but Finance would tell you that you can't afford it! This will become a little more obvious as we go. I know everyone wants 100% service level, but you probably don't want to really invest in that.
Let's walk through calculating some statistics on your demand history and demand forecasting error. Here are the steps that we will go through:
- Gather the forecast and history data
- Calculate statistics
- Determine the Z value
- Calculate the Safety Stock
If you want to follow along at home, you can download a copy of the Excel spreadsheet and see how we are doing some of the calculations live.
Gather the forecast and history data
During each forecasting cycle, once you publish your forecast for the rest of the supply chain, you should also store that forecast. You will then analyze this stored-off forecast vs history once that time comes. Your forecast lag should be used when calculating your forecasting statistics. If you are forecasting in months, a forecast of 0 is the current month, a lag of 1 is what you forecasted a month out, a lag of 2 is what you forecasted two months out, etc. A good proxy to know which lag to use when calculating your forecasting statistics is a lag of 2. When the rest of the supply chain is reacting to the forecast, they order materials, book line time, etc. That usually falls right on a two-month lead time. If your supply chain lead time is longer, then increase the lags you are using to measure your statistics.
Calculate statistics
Now that we have our data let's calculate the following per each forecasting period:
- Error: $$\text{Forecast} - \text{History}$$
- % Error: $$\frac{\text{Forecast} - \text{History}}{\text{History}}$$
- Absolute Error: $$[\text{Forecast} - \text{History}]$$
- Absolute % Error: $$\frac{[\text{Forecast} - \text{History}]}{\text{History}}$$
- Squared Error: $$(\text{Forecast} - \text{History})^2$$
The next step is to calculate summary statistics:
- Total Forecast: $$\sum \text{Forecast}_t$$
- Total History: $$\sum \text{History}_t$$
- Cumulative Error: $$\sum (\text{Forecast}_t - \text{History}_t)$$
- Cumulative Error %: $$\sum \left(\frac{\text{Forecast}_t - \text{History}_t}{\text{History}_t}\right)$$
- Mean Absolute Percent Error (MAPE): $$\text{Average} \left(\frac{[\text{Forecast}_t - \text{History}_t]}{\text{History}_t}\right)$$
- Mean History: $$\text{Average} (\text{History}_t)$$
- Standard Deviation of History: $$\text{Standard Deviation} (\text{History}_t)$$
- Coefficient of Variation: $$\frac{\text{Standard Deviation} (\text{History}_t)}{\text{Average} (\text{History}_t)}$$
- Mean Squared Error: $$\text{Average} \left((\text{Forecast}_t - \text{History}_t)^2\right)$$
- Mean Absolute Deviation (MAD): $$\text{Average} \left([\text{Forecast}_t - \text{History}_t]\right)$$
- Tracking Signal: $$\frac{\sum (\text{Forecast}_t - \text{History}_t)}{\text{MAD}}$$
Awesome, now what? Let's pluck out a few of these that are key for evaluating forecast:
- MAPE tells you how well the forecasting process is working. A number greater than 30% may indicate that the process is out of control. The real benefit in the number comes when compared to the Coefficient of Variation.
- Tracking Signal tells you how much bias is in the forecast process. If the value is not between +6 and -6, then this would be a point of discussion with the appropriate demand planner (or salesperson) because there is too much bias in your forecast.
- Coefficient of Variation identifies the amount of uncertainty in historical demand. More importantly, comparing the MAPE with the Coefficient of Variation will help identify whether an SKU should use the forecast or the average history for its independent demand when planning your supply requirements. If the MAPE is significantly lower than the Coefficient of Variation, the forecast should be considered.
Determine the Z value
Before discussing the Z value or Z factor, I want to show you where this fits in the safety stock formula. Actually, there are two formulas: one for when you will use the forecast to drive your supply plan and another for when you will use average history (see blurb on "Coefficient of Variation"):
- If you're using the forecast as your demand: $$Z \times \sqrt{\text{LT}} \times \sqrt{\text{MSE}}$$
- If you're using the average history as your demand: $$Z \times \sqrt{\text{LT}} \times \text{Standard Deviation}(\text{History})$$
Both calculations determine the amount of variation over the lead time.
Why is lead time important?
As you can see in the illustration below, the only time you are at risk of stocking out is during the lead time. Since you won't be receiving any other supply within the order lead time, the inventory you have must cover any demand during this time. So, determining the amount of demand variability during the lead time is critical when calculating the safety stock.
What about that Z factor?
The Z factor is the number of standard deviations. Within both safety stock calculations (forecast or average history), this is based on a couple of items:
- The number of replenishment cycles in a year or the size of the order quantity (Q).
- The desired service level is also used to determine the correct Z factor.
Let’s take a closer look at the impact that the order quantity has on the safety stock value.
Again, if the whole purpose of our safety stock is to cover us during our replenishment order lead time, then every time we are ordering, we are at risk. The more times you order per your planning horizon, the more times you are at risk. So, order size, which determines your order frequency, is a big part of the safety stock calculation.
We will use the order quantity and the service level to back into a Z factor. To do that, we must calculate something called E(z), the expected number of units short in a year.
- E(z) (using forecast): $$E(z) = \frac{(1 - \text{SL}) \times Q}{\sqrt{\text{MSE} \times \text{LT}}}$$
- E(z) (using average history): $$E(z) = \frac{(1-\text{SL}) \times Q}{\text{Standard Deviation}(\text{History}) \times \sqrt{\text{LT}}}$$
Once you have the E(z), all you need to do is look up the calculated value in the below table to find the right Z value.
Now that you have the Z value, you can plug it into the correct safety stock calculation and the summary statistics created earlier and voila… you have your suggested safety stock.
- If you're using the forecast as your demand: $$Z \times \sqrt{\text{LT}} \times \sqrt{\text{MSE}}$$
- If you're using the average history as your demand: $$Z \times \sqrt{\text{LT}} \times \text{Standard Deviation}(\text{History})$$
Safety stock calculator
We created an Excel spreadsheet for you to experiment with. I would recommend trying it out and then building on from it to incorporate it into your normal supply chain planning process. It can help you improve your service levels and overall inventory strategy.
Conclusion
Balancing your customer service levels with the right amount of inventory doesn't have to be a daunting task. In this article, we have explained how you can come up with the right safety stock given the realities of your forecasting process, desired service levels and your order sizes.
The people behind Claret are dedicated to making "the complex" as easy as possible. This blog post is an example of us trying to make something a bit heady and turn it into something that will add value to you and your company.
This blog post just scratches the surface of how our software and team can help you and your company improve your supply chain by reducing costs and increasing service levels.