STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice...

28
Revealing The Mystery of Safety Stock Calculations 1 v REVEALING THE MYSTERY OF SAFETY STOCK CALCUTLATIONS SOME BASICS AND THE ROLE OF THE “NORMAL” DISTRIBUTION

Transcript of STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice...

Page 1: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 1

v

REVEALING THE MYSTERY OF SAFETY

STOCK CALCUTLATIONS –

SOME BASICS AND THE ROLE OF THE

“NORMAL” DISTRIBUTION

Page 2: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 2

v

PART 1

Revealing the Mystery of Safety Stock Calculations - Some Basics

and the Role of the “Normal” Distribution By Ken Fordyce

1.0 Introduction

All of us experience the challenge of inventory every day – whether at home -how many cans of tuna to keep in the

cupboard- or as a critical component of effective management of your demand supply network. Although being a critical

component is constant, the amount attention among the trade press and vendors occurs in a cyclical fashion and 2015 is

certainly a high point in the cycle. A high level supply chain manager I knew referred to inventory policy as the Good, Bad,

and the Ugly – referring to the ability to meet client demand immediately; costs to hold inventory and potential

obsolescence; and un-coordinated hording. This is the first in a series of articles to reveal some of the mystery behind the

safety stock calculation – today we cover some basics and explain role of “normal” distribution.

Most of us use equations or formulas without a full understanding of why they work or more importantly when they work

well and when they do not? Not that we aren’t interested or do not consider it important, but the information is difficult to

find and typically written in a way only certain members of the “math tribe” can understand. There are members of this

tribe that are bilingual, the purpose of this blog is to reveal part of the mystery of the safety stock calculations with strange

symbols including when the “normal distribution” (figure 1) also called Z, bell, Gauss and other names students have

called this that cannot be said in polite company. This knowledge puts you in a better position to evaluate consultants and

software vendors; sadly, many (but not all) are using the equations without a full understanding.

0.00

0.05

0.10

0.15

0.20

0.25

0.30

0.35

0.40

0.45

de

ns

ity

z values

Fiigure 1: Graph of Standard Normal Distribution has mean of 0 and standard deivation of 1

Page 3: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 3

v

2.0 Start Of An Adventure – Ice Cream Store – Rules Of Replacing Inventory & Daily Demand

The best way to take the mystery out of the “math” is to use a simple example. In fact the often the members of the “math

tribe” start with some examples on a white board and later create the equations with the strange symbols; erasing the

white board to eliminate the incriminating evidence.

Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs

to refill its supply of vanilla ice cream (in inventory speak - replenishment), the order can placed at night after the store

closes and the new supply is delivered well before the store opens the next day without fail. The store can, if it wants to,

reorder or replenish every night, every two nights … every 10 nights. In terms of quantity, the store can reorder between 1

and 9,999 units each time it places a replenishment decision. In inventory terminology:

The owner believes the probability of a certain demand on any day is as given in Table 1. For this article, we will accept is

as given. The complexity of generating this information is a topic for another time.

The “index” column is the identifier for each of the six possible demands. The “demand” column is the possible demand for

a specific day, which is 14 to 19. Probability is the probability of exactly that demand on a given day. For example, the

probability that daily demand is 16 is 0.08. Cumulative probability is the probability of demand for a specific day is the

value for that row or less. The probability that the demand is 15 or less is 0.45(=0.30 + 0.15) which equals the probability

the demand for the day is 15 (p=0.15). The “sum” row has the value 1 the sum of the probabilities for each possible

demand must be 1. Figure 2 is graph of the “PDF” – the probability distribution function – the probability of each demand.

index demand

probability

(PDF)

cumulative

probability

(CDF)

1 14 0.30 0.30

2 15 0.15 0.45

3 16 0.08 0.53

4 17 0.07 0.60

5 18 0.30 0.90

6 19 0.10 1.00

sum 1.00

Table 01: Probability of Each Demand

The replenishment lead time (time between an order is placed and the order arrives) is 0. Why? The order is placed

after the store closes and before it opens – 0 time in terms of meeting the needs of customers

The variability (uncertainty) of the lead time is also ZERO.

Page 4: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 4

v

Two natural questions are:

1. What is the average daily demand (called expected value in statistics)?

2. What is the average variation in demand (called standard deviation in statistics)?

Table 2 shows the calculation for average demand or expected demand. The value is 16.22. That is if the demand for each

day was independent of the demand from the previous day and the probability of demand did not change over time, then

if we collected demand for many days (say 100,000), added them up and divided by 100,000), the value would be 16.22 (or

very close). Here we have snuck in two other inventory terms:

Table 3 has the calculation for the average variation of demand from the “average demand” (16.22 in this case) – called the

standard deviation. This calculation is a bit tricky, so let’s take a look in detail. The first three columns are the same

columns as Table 1 and Table 2. The fourth column (demand – average) is the heart of the calculation of average variation.

Simply, for each demand, we subtract the average demand (16.22 for this example). We see the value for row 1 is -

2.22(=14-16.22). Perfectly logical, if we want to know the variation around the average – find each difference. Why not just

multiply each difference by the probability and add them? Not so fast, that value is ZERO. Observe we have negative and

positive values, we are interested in the size of the variation and therefore we need to make them all “positive’. We have

two options:

0.00

0.05

0.10

0.15

0.20

0.25

0.30

0.35

14 15 16 17 18 19

Figure 02: Probability for Each Possible Demand

average daily demand is 16.22average variation or standard deviation is 1.86

IID – independent and identically distributed

Stationary – the probability of demand does not change with time

Page 5: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 5

v

Long ago the math tribe decided to square the value. So we square each difference (the fifth column) and then multiply

each of these values with the probability (sixth column). This sum (3.47) is called the variance. We need one more step to

“undo” the squaring; we take the square root of the variation to get the standard deviation (1.86). Now you might ask –

why not just use the absolute value? There is logic in this. Later we will find the standard deviation has magical properties

when we want to know the distribution of total demand over “n” (2, 4, 10, …) days.

Table 02: Calculation of Average or Expected Demand

index demand probability

demand x

probability

1 14 0.30 4.20 = 14 x 0.30

2 15 0.15 2.25 = 15 x 0.15

3 16 0.08 1.28 = 16 x 0.08

4 17 0.07 1.19 = 17 x 0.07

5 18 0.30 5.40 = 18 x 0.30

6 19 0.10 1.90 = 19 x 0.10

sum 1.00 16.22

index demand probability demand - average

(demand -

average) 2

probability x

(demand -

average) 2

1 14 0.30 -2.22 = 14 - 16.22 4.93 1.48

2 15 0.15 -1.22 = 15 - 16.22 1.49 0.22

3 16 0.08 -0.22 = 16 - 16.22 0.05 0.00

4 17 0.07 0.78 = 17 - 16.22 0.61 0.04

5 18 0.30 1.78 = 18 - 16.22 3.17 0.95

6 19 0.10 2.78 = 19 - 16.22 7.73 0.77

sum 1.00 3.47

3.47

1.86 (= √3.47)

variance (σ2)

standard deviation (σ)

or average variation

Table 03: Calculation of Average Variation - Standard Deviation

Use absolute value to convert negative to positive

Square each value

Page 6: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 6

v

3.0 How Much Inventory To Have At The Start Of The Day If We Reorder Every Might?

In the previous sections we established the basic information about daily demand for vanilla ice cream and the rules

governing replenishment of inventory. Now we want to examine how much inventory to have on hand at the start of a

replenishment period – which is the number of days between reordering. We will start our examination with the simplest

case we reorder every night, which requires us to identify how vanilla ice cream to have on hand at the start of the day?

Options are the values 14 to 19. To decide which one, we need a definition of success & failure?

1. Success occurs when the amount of inventory on hand at the start of the day is sufficient to cover the demand for

the day

2. Failure occurs when the demand for the day exceeds the amount of inventory on hand at the start of the day

We now need the probability of success and failure for each inventory level option? The cumulative probability function

(CDF) provides this information. If we set the inventory level at the start of each day at 15, then success occurs when the

actual demand for the day is 15 or less (demand of 14 or 15). Failure occurs when demand for the day is more than 15

(demand of 16, 17, 18, or 19). The probability of success is the probability that demand less than or equal to 15, which is the

CDF for 15 which is 0.45(=0.30 + 0.15). The probability of failure is {1 – CDF for 15} = 1-0.45 = 0.55 = 0.08 + 0.07 + 0.30 +

0.10.

The term success and failure are intuitive and commonly used in probability and statistics. Alas, the inventory folks do not

use the terms success and failure, but the terms:

The fill rate and backorder rate for each option (14 to 19) is given in table04. This captures the risk for each option the

probability of having more ice cream in stock than needed to meet demand or not enough. . If start the day with 17 units

the chances of meeting all demand is 0.60 (fill rate) and not meeting all demand is 0.40 (backorder rate). What is the right

inventory level? That depends on other factors such as the cost to hold inventory, real cost of lost sales, scrap policy (can

left over ice cream be used tomorrow), etc. A topic for another time.

index

inventory

level at at

state of day

success or fill rate

= CDF

falure or back order

rate = (1-CDF)

1 14 0.30 0.70

2 15 0.45 0.55

3 16 0.53 0.47

4 17 0.60 0.40

5 18 0.90 0.10

6 19 1.00 0.00

Table 04: Fill rate and Backorder Rate for each Inventory level

option at start of day when replenishment occurs daily

Fill rate – probability of success, the probability all demand for the day is met from inventory

Back order rate – failure - probability demand for day cannot be met from inventory

Page 7: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 7

v

4.0 Going From Desired Inventory Level At Start Of Day To Safety Stock

In the previous section we reviewed the basics of deciding how much inventory to have on hand at the start of the day

(replenishment period) including the concept of fill rate and backorder rate. There was no mention of safety stock!

Safety stock is defined as the quantity of inventory (in this case five gallon containers of vanilla ice cream) a firm decides to

hold in inventory above the level of average demand. In our current example, it is the quantity in inventory at the start of

the day. Table 05 extends table 04 with the safety stock value with each option for inventory at the start of the day.

5.0 What-If We Replenish Every Other Day (Once Every Two Days)

Initially being able to replenish every day for the ice cream store seemed ideal, however having to be a the store a few

hours before opening to unload the inventory from the truck quickly became a tiring. The store owner decided to replenish

every other (every two days). This immediately generated a cascade of questions:

They key to answering these questions is creating the equivalent to Table 01 for two days. We need to know all possible

total demands on the ice cream show for a two day period and what is the probability of each of these values?

6.0 Finding The Total Demand On The Ice Cream Shop For Two Days

With the convenient “IID” assumption that:

1. Probability of demand for any given is the same and follows Table 01

index

inventory

level at at

state of day

success or fill

rate = CDF

falure or back

order rate =

(1-CDF) safety stock

1 14 0.30 0.70 -2.22 = 14 - 16.22

2 15 0.45 0.55 -1.22 = 15 - 16.22

3 16 0.53 0.47 -0.22 = 16 - 16.22

4 17 0.60 0.40 0.78 = 17 - 16.22

5 18 0.90 0.10 1.78 = 18 - 16.22

6 19 1.00 0.00 2.78 = 19 - 16.22

average

demand16.22

Table 05: Fill rate, Backorder Rate, and Safety stock level for each

Inventory level option at start of day when replenishment occurs daily

How much inventory should be in the store at the start of the replenishment period (that is when the truck makes

it delivery)?

For a given inventory level at the start of the replenishment period what is the risk?

o What is the fill rate – probability at the end of the replenishment period (two days) the total demand can

be met from inventory?

o What is the back order rate – probability at the end of the day demand cannot be met from inventory?

Page 8: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 8

v

2. Demand for each day is independent of the demand on others days

This is an easy question to answer – which is why the math guys make this assumption and hide in the fine print.

Let’s start with identifying the possible demand options. On day 1 the demand might be 14 and day 2 it might any of the

values 14-19. We could write these as a pair, where the first member of the pair is demand for day 1 and the second

member of the pair is the demand for day 2. The pair (14/ 16) says the demand for day 1 is 14 and demand for day 2 is 16.

The same pattern applies if the demand for day 1 is 15. There are 36 possible pairs. There are 6 options for day 1 (values

14-19) and the same six options for day 2. 36 = 6 x 6 =62, where 2 is the number of days in the replenishment period. The

fancy math term for pairs is “tuble”.

Table06 lists all of the 36 pairs. The row refers to demand for day and column for day 2

Observe the pairs (14/16) and (15/15) each have the same total demand across two days. We only care about total demand

for two days, how it is split between the two days is not important to us (right now). Table07 provides the total for demand

for each cell.

The second part of our quest is finding the probability for each demand pair. Again the “IID” fine print makes this easier.

The probability for each pair is the probability of the demand on day 1 times the probability of demand on day2. For

example the probability of a demand of 16 is 0.08 (from table01) and the probability of a demand for 15 is 0.15. The

probability of the demand pair (16 / 15) is 0.0120 = 0.08 x 0.15. Table08 has all 36 probabilities.

014 015 016 017 018 019

014 14/14 15/14 16/14 17/14 18/14 19/14

015 14/15 15/15 16/15 17/15 18/15 19/15

016 14/16 15/16 16/16 17/16 18/16 19/16

017 14/17 15/17 16/17 17/17 18/17 19/17

018 14/18 15/18 16/18 17/18 18/18 19/18

019 14/19 15/19 16/19 17/19 18/19 19/19

De

man

d fo

r day 1

Demand for Day 2

Table06: All Possible Demand Pairs (day1/day2) for total demand for two days

Day1/Day2

014 015 016 017 018 019

014 28 29 30 31 32 33

015 29 30 31 32 33 34

016 30 31 32 33 34 35

017 31 32 33 34 35 36

018 32 33 34 35 36 37

019 33 34 35 36 37 38

Table07: Total Demand for Two Days for All Possible Demand Pairs

Tot =

Day1+Day2

Demand for Day 2

De

man

d fo

r day 1

Page 9: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 9

v

The last step to create the equivalent of table01 for the two day replenishment period is to aggregate the probabilities for

demand pairs with the same total. For example, the demand total 29 occurs twice (pairs 14/15 and 15/14). Therefore the

probability of total demand of 29 across two day is PRB (14/15) + PRB (15/14) = 0.0450 + 0.0450 = 0.0900. Table09 has all

unique total demand options for two days along with the associated probability for each possible total demand across the

replenishment period of two days. Figure03 plots the options and their probabilities.

Table09 and Figure03 have the probability distribution function for total demand on the ice cream store for the two day

replenishment period. Additionally it has the average “total demand” for two days and the standard deviation for “total

demand” for two days. Observe we have the term average and total next to each other – which can get confusing. From

table09 on any given two day period the possible total demand at the store has 11 options the values 28 to 38. If we

collected 100,000 observations on total demand for two days replenishment periods and calculate their average, the value

would be 32.44 (or close). 32.44 is the average total demand for a two day replenishment period. The average variation or

standard deviation for this total is 2.635.

014 015 016 017 018 019

0.30 0.15 0.08 0.07 0.30 0.10

014 0.30

0.0900 =

0.30 x 0.30

0.0450 =

0.30 x 0.15

0.0240 =

0.30 x 0.08

0.0210 =

0.30 x 0.07

0.0900 =

0.30 x 0.30

0.0300 =

0.30 x 0.10

015 0.15

0.0450 =

0.15 x 0.30

0.0225 =

0.15 x 0.15

0.0120 =

0.15 x 0.08

0.0105 =

0.15 x 0.07

0.0450 =

0.15 x 0.30

0.0150 =

0.15 x 0.10

016 0.08

0.0240 =

0.08 x 0.30

0.0120 =

0.08 x 0.15

0.0064 =

0.08 x 0.08

0.0056 =

0.08 x 0.07

0.0240 =

0.08 x 0.30

0.0080 =

0.08 x 0.10

017 0.07

0.0210 =

0.07 x 0.30

0.0105 =

0.07 x 0.15

0.0056 =

0.07 x 0.08

0.0049 =

0.07 x 0.07

0.0210 =

0.07 x 0.30

0.0070 =

0.07 x 0.10

018 0.30

0.0900 =

0.30 x 0.30

0.0450 =

0.30 x 0.15

0.0240 =

0.30 x 0.08

0.0210 =

0.30 x 0.07

0.0900 =

0.30 x 0.30

0.0300 =

0.30 x 0.10

019 0.10

0.0300 =

0.10 x 0.30

0.0150 =

0.10 x 0.15

0.0080 =

0.10 x 0.08

0.0070 =

0.10 x 0.07

0.0300 =

0.10 x 0.30

0.0100 =

0.10 x 0.10

Table08: The probability of each demand pair (Day 1 / Day 2)

PRB =

Prb1xPRb2

Demand for Day 2 with probability

De

man

d fo

r day 1

with

pro

bab

ility

Page 10: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 10

v

index demand

probability

(PDF)

cumulative probability

(CDF)

aka fill rate or success

001 28 0.0900 0.0900

002 29 0.0900 0.1800

003 30 0.0705 0.2505

004 31 0.0660 0.3165

005 32 0.2074 0.5239

006 33 0.1612 0.6851

007 34 0.0829 0.7680

008 35 0.0580 0.8260

009 36 0.1040 0.9300

010 37 0.0600 0.9900

011 38 0.0100 1.0000

mean total demand for 2 days 32.440

variance total demand for 2 days 6.943

standard deviation total demand for 2 days 2.635

Table09: All Possible Options for Total Demand for Two Days with Probabilty

where demand for one day is specificed in Table01

0.0000

0.0500

0.1000

0.1500

0.2000

0.2500

28 29 30 31 32 33 34 35 36 37 38

Figure 03: Probability for each posssible total demand across 2 days

average daily demand is 32.44average variation or standard deviation is 2.635

Page 11: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 11

v

7.0 How Might The Store Owner Use The Information In Table09?

Remember fill rate is the probability of success that is the probability all demand during a replenishment period can be met

from inventory in stock. The fill rate is the cumulative probability.

If the owner wants a fill rate of 0.90, then we select the demand value with the smallest cumulative probability value greater

than or equal to 0.90. Table09 tells us this value is 36 with a cumulative probability value of 0.93. If the owner has 36 units

of vanilla ice cream in inventory at the start of the two day replenishment period, the chances of meeting all demand from

inventory is 0.93. If the owner goes with 35 units, the fill rate drops to 0.826.

What is the safety for a fill rate of 0.90? Safety stock is the amount in inventory at the start of the replenishment period

minus the average demand for this period. The average demand is 32.44, therefore safety stock is 3.56= (36-32.44).

Sometimes safety stock is stated in per day level. For this example safety stock per day for a fill rate of 0.90 is 1.78.

8.0 Gift 1 From Statistics God: Relationship Between Demand For 1 Day & Demand For 2 Days

The following fun facts from the statistics god will be helpful in the next few sections. They are provided without formal

proof, but a computation example is provided.

1. The expected total demand over “n” (in this case 2 days) is n x mean or average demand for a single day.

In section 6 we observe 32.44 = 2 x 16.22

2. The standard deviation of the distribution of total demand for n days is the square root of n times the standard

deviation of the distribution of demand for a single day

in section 6 we observe 2.635 = √2 x 1.8632 = 1.4142 x 1.8632

Remember the measure for average variation is the standard deviation. The critical observation is the average total

demand grows directly as n (number of days) grows. BUT, the average variation grows proportional to the square root of n.

A common measure to relate average variation to average value is the co-efficient of variation (CV) which is the standard

deviation divided by the average. Specific to the relationship between demand for 1 day and total demand for n days, the

following equations captures this relationship.

𝐶𝑉 = √𝑛 × 1.863

𝑛 × 16.22

As n gets larger this value continues to get smaller. For this example when n=1, CV is 0.1149. When n=10, CV is 0.0363.

CV is sometimes used to “measure” risk, we risk declines as n increases. We will also see as n increases the safety stock per

day declines for the same fill rate.

9.0 Finding The Total Demand On The Ice Cream Shop For Seven Days

Typically someone managing inventory is wants to know the following for a specified fill rate?

How demand do I need in inventory at the start of the replenishment period?

What is the safety stock required to meet this fill rate?

Page 12: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 12

v

Our ice shop owner has decided to take a full week off and wants to know the distribution of total demand for seven days

to support a decision on how much inventory to have on hand at the start of the replenishment period. Extending the same

logic as we did with two days, Table10 has distribution of total demand for 7 days. Figure04 graphs the distribution.

The average total demand for seven days is 113.540 and the standard deviation is 4.930. The CV value is 0.043. This table

provides the core risk information for the owner to make a decision about how much inventory to have on hand at the start

of the replenishment period.

Assume our owner still desires a replenishment rate of 0.90. Table10 informs the store needs 120 units of vanilla in stock at

the start of the 7 day replenishment period and will achieve a fill rate of 0.9192 92% of the time all demand for these

seven days will be met from stock.

What about safety stock. The average total demand for seven days is 113.54. The safety stock is 6.46(=120-113.54). The

safety stock per day is 0.923 = 6.46/7. This is lower than the safety stock per day for the two day replenishment period.

10.0 Gift 2 From Statistics God: As N Gets Large, All Paths Lead To Normal

If we compare the basic shape of Figure04 with the shape of Figure01, we see the irregular shape (called multi-modal,

multiple high peaks) found in figures 02 and 04, is beginning to morph into a “normal” shape.

This is an example of the Central Limit Theorem (CLT) at work – as n gets sufficiently large, the total demand over n days,

given the IID conditions, will morph to a normal distribution where the mean of this normal distribution is n times the

average daily demand and the standard deviation is the square root of n times the standard deviation of demand for a

single day. Figure 05 shows the normal distribution when the mean is 113.540 and the standard deviation is 4.930.

11.0 The magic question how large does n need to be to use the normal as a reasonable approximation of the

distribution of total demand over n days?

It depends on how “ugly” the daily distribution is, the level of precision required, and what fill rate is desired. Now you

might have heard the magic number “30”. If n is greater than 30, then then assuming the normal distribution is correct –

“TILT” – not correct. The value of 30 has to do whether one uses the student T distribution or normal distribution for

confidence intervals. That is not relevant to this discussion. Of course it sounds nice and the consultant or software

vendor might attempt to use this when you ask them. If so it might be time for a new source of support

In Part 2 we will incorporate variation of replenishment time into our analysis.

Page 13: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 13

v

index demand probability (PDF)

cumulative probability (CDF)

aka fill rate or success

001 98 0.0002 0.0002

002 99 0.0008 0.0010

003 100 0.0016 0.0025

004 101 0.0025 0.0051

005 102 0.0049 0.0100

006 103 0.0090 0.0190

007 104 0.0137 0.0327

008 105 0.0184 0.0510

009 106 0.0260 0.0771

010 107 0.0363 0.1134

011 108 0.0456 0.1590

012 109 0.0524 0.2114

013 110 0.0615 0.2729

014 111 0.0715 0.3445

015 112 0.0769 0.4213

016 113 0.0767 0.4980

017 114 0.0769 0.5749

018 115 0.0767 0.6516

019 116 0.0713 0.7229

020 117 0.0616 0.7845

021 118 0.0530 0.8375

022 119 0.0454 0.8829

023 120 0.0363 0.9192

024 121 0.0267 0.9459

025 122 0.0192 0.9652

026 123 0.0139 0.9790

027 124 0.0093 0.9883

028 125 0.0055 0.9938

029 126 0.0031 0.9969

030 127 0.0017 0.9986

031 128 0.0009 0.9995

032 129 0.0004 0.9999

033 130 0.0001 1.0000

034 131 0.0000 1.0000

035 132 0.0000 1.0000

036 133 0.0000 1.0000

mean total demand for 7 days 113.540

standard deviation total demand for 7 days 4.930

Table10: All Possible Options for Total Demand for Two Days with Probabilty

where demand for one day is specificed in Table01

Page 14: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 14

v

0.0000

0.0100

0.0200

0.0300

0.0400

0.0500

0.0600

0.0700

0.0800

0.0900

98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133

Figure 04: Probability for each posssible total demand across 7 days

average daily demand is 113.540average variation or standard deviation is 4.930

0.00

0.01

0.02

0.03

0.04

0.05

0.06

0.07

0.08

0.09

den

sit

y

z values

Fiigure 05: Graph of Normal Distribution has mean of 113.54 and standard deivation of 4.93

Page 15: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 15

v

11.0 How Do We Get To The Safety Stock Equation- 𝒔𝒂𝒇𝒆𝒕𝒚 𝒔𝒕𝒐𝒄𝒌 = 𝒁𝒇𝒓 × √𝒏 × 𝝈

Our ice cream store owner wants to investigate a replenishment period of 30 days and is willing to use the normal

distribution to approximate the distribution of total demand over the 30 day periods. From statistics gift 1, we calculate:

Figure05 has the normal approximation of the distribution of total demand for the replenishment period of 30 days with a

mean of 486.6 and standard deviation of 10.205.

The owner now asks how much inventory is needed to be in stock at the start of the replenishment period to have a fill rate

of 0.90. Hmmm – before we looked at the table to find the demand value with the smallest cumulative probability value

greater than 0.90. We have no such table. The normal is a continuous probability distribution, not a discrete distribution.

In a continuous distribution the list of options for demand is all values between a start and end value. To adjust for this, we

can only talk about the probability of demand occurring between a start value and end value and this probability is the area

under the curve. The total area under the curve is 1, so any subsection of area has a value between 0 and 1. The smaller the

area, the lower the probability.

To answer the owner’s question we need find the demand value so the area under the curve from left to this point is 0.90

and from this point to the right the area is 0.10. Figure07 identifies this value as 499.68. This is how much stock must be

on hand at the start of the replenishment period. The safety stock is 13.08(=499.68 – 486.6).

0.00

0.01

0.01

0.02

0.02

0.03

0.03

0.04

0.04

0.05

den

sit

y

z values

Fiigure 06: Graph of Normal Distribution has mean of 486.6 and standard deivation of 10.205

Average total demand for 30 days is 486.6 = 30 x 16.22

Standard deviation for 30 days is 10.205 = √30 x 1.863 = 5.477 x 1.863

Page 16: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 16

v

How did we get the value of 499.68?

For a given mean and standard deviation, the inventory level for a given refill rate (success probability) is: mean + {Z(for

refill rate)x standard_ deviation}. Where Z is the value for the standard normal (figure 01) which has 90% of the area to the

left of this value and 10% to the right. This value can be found in table or statistics software. In Excel the syntax is

norm.s.inv (0.90) and the Z value is 1.2816. We have:

Putting the math symbols back in we get 𝑠𝑎𝑓𝑒𝑡𝑦 𝑠𝑡𝑜𝑐𝑘 = 𝑍𝑓𝑟 × √𝑛 × 𝜎, where:

0.00

0.01

0.01

0.02

0.02

0.03

0.03

0.04

0.04

0.05

den

sit

y

z values

Fiigure 07: Graph Normal Dist mean 486.6,standard deivation10.205, repenishment rate 0.90

0.90

0.10

499.68

499.68 = 488.6 + 1.2815 x 10.205

o If we put back in the average daily demand and standard deviation we get

499.68 = (30 x 16.22) + 1.2815 x √30 x 1.863

o Since safety stock is the desired inventory level minus average demand, the safety stock is

13.08 = 1.2815 x √30 x 1.863

Z is the value of Z for the specified fill rate

n is the number of days in the replenishment period

σ is the standard deviation of the daily demand

Page 17: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 17

v

12.0 Final Comment

The material presented in the previous sections provides unravels the mystery of one part of inventory management -

managing the risk of not meeting demand even when there is no uncertainty in replenishment. It sets out the core

questions, defines terms, develops the core calculations, and identifies when the normal distribution will be work and how

it will work.

Part 2 will demonstrate how variability in replenishment lead time is incorporated into the mix of calculations. Part 3 will

look at a simple network of inventory points.

Inventory is a huge and critical area that cannot be treated separate from other areas of S&OP such as demand

management and supply planning – key areas include demand variability, demand classes, and smoothing or load leveling

production. In fact one director of manufacturing I know saw inventory management, especially the flexibility associated

with line side stocking and build to forecast, as key tools for smoothing production and absorbing variations in yields.

These are topics for later sections.

PART 2

Revealing the Mystery of Safety Stock Calculations – Incorporating

Variation in Replenishment Lead Time

1.0 Introduction

In part 1, using the ice cream store example as our primary vehicle, we provided insight into the basics of understanding

total inventory required to cover demand for a period n (1, 2, …30 …) days accounting for variability in the daily demand.

From this, we identified what portion of this demand would be classified as safety stock and how to use this information to

make an informed decision. Last, we demonstrated when n is sufficiently large, then the normal distribution is a good

approximation of total demand over n days independent of the distribution of daily demand applying the 8th wonder of the

world – Central Limit Theorem (CLT).

Throughout all of part 1, the assumption made was there was ZERO variation in replenishment lead time. The condition

was, a replenishment order was placed at the end of the day after the store was closed and the owner was certain the new

5 gallon cans of vanilla ice cream would be in the freezer before the first customer arrived the next day. The purpose of part

2 of the mystery tale is “how to handle uncertainty or variability in the lead time!

2.0 Quick Review Of Ice Cream Business – Rules Of Replacing Inventory & Daily Demand

Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs

to refill its supply of vanilla ice cream, the order can placed at night after the store closes and the new supply is delivered

well before the store opens the next day without fail. The store can, if it wants to, reorder or replenish every night, every

two nights … every 10 nights. In terms of quantity, the store can reorder between 1 and 9,999 units each time it places a

replenishment decision. The owner believes the probability of a certain demand on any day is as given in Table 1. For this

article, we will accept is as given. The complexity of generating this information is a topic for another time.

Page 18: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 18

v

The “index” column is the identifier for each of the six possible demands. The “demand” column is the possible

demand for a specific day, which is 14 to 19. Probability is the probability of exactly that demand on a given

day. For example, the probability that daily demand is 16 is 0.08. Cumulative probability is the probability of

demand for a specific day is the value for that row or less. The probability that the demand is 15 or less is

0.45(=0.30 + 0.15) which equals the probability the demand for the day is 15 (p=0.15). The “sum” row has the

value 1 the sum of the probabilities for each possible demand must be 1. Figure 2 is graph of the “PDF” – the

probability distribution function – the probability of each demand. The average daily demand is 16.22 and

average variation (standard deviation) is 1.86

3.0 Replenishing Inventory Every Three Days with 0.90 Fill Rate

index demand

probability

(PDF)

cumulative

probability

(CDF)

1 14 0.30 0.30

2 15 0.15 0.45

3 16 0.08 0.53

4 17 0.07 0.60

5 18 0.30 0.90

6 19 0.10 1.00

sum 1.00

Table 01: Probability of Each Demand

0.00

0.05

0.10

0.15

0.20

0.25

0.30

0.35

14 15 16 17 18 19

Figure 02: Probability for Each Possible Demand

average daily demand is 16.22average variation or standard deviation is 1.86

Page 19: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 19

v

After working the store’s analytics team, the owner had decided to replenish inventory every third day with a fill rate of

0.90. Table11 and figure08 have the distribution of total demand for three days using computational mechanism described

in part 1. This information, along with estimates for inventory holding cost, reorder costs (transport, people, etc.) shelve

life, cost for unmet demand, and others were analyzed with other models to support this decision.

index demand

probability

(PDF)

cumulative probability

(CDF)

aka fill rate or success

001 42 0.0270 0.0270

002 43 0.0405 0.0675

003 44 0.0419 0.1094

004 45 0.0439 0.1532

005 46 0.1111 0.2643

006 47 0.1257 0.3900

007 48 0.1004 0.4904

008 49 0.0841 0.5745

009 50 0.1266 0.7011

010 51 0.1131 0.8143

011 52 0.0654 0.8796

012 53 0.0393 0.9189

013 54 0.0420 0.9609

014 55 0.0291 0.9900

015 56 0.0090 0.9990

016 57 0.0010 1.0000

mean total demand for 3 days 48.660

variance total demand for 3 days 10.415

standard deviation total demand for 3 days 3.227

Table11: All Possible Options for Total Demand for Three Days with Probabilty

where demand for one day is specificed in Table01

Page 20: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 20

v

3.0 Replenishing Inventory Every Three Days Accounting for Uncertainty in Delivery

With the basic decisions in place for inventory and the establishment of a regular process for replenishing inventory in an

orderly fashion, the owner now asks the next logical question in the journey

What if the delivery of ice cream is delayed one day?

He goes to his ace analytics team, asks them to the analysis, and provide him a solution he can understand - no voodoo

equations and hand waving – all by Friday.

The lead of his analytics team, having read the great works of Gene Woolsey, comes up with the following solution.

1. In the vast majority of the time, when the order is placed at night, it arrives the next morning. Since an order is placed

one every three days, the key calculation is finding the probability distribution of total demand for 3 days.

2. If the truck is delayed one day, that is the equivalent of having to know the probability distribution of total demand for

four days. This can be calculated using the same method already established. Table12 and Figure09 have this

information in Appendix 1.

3. The question becomes how to combine this information in a way that can be understood and works (this is called

mixture problem in the literature – as well going under some other names).

0.0000

0.0200

0.0400

0.0600

0.0800

0.1000

0.1200

0.1400

42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57

Figure 08: Probability for each posssible total demand across 3 days

average total demand is 48.66average variation or standard deviation is 3.227

Page 21: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 21

v

4. The lead starts with the assumption the truck will arrive on time 80% (0.80) of the time. It will arrive one day late 20%

(0.20) of the time.

5. Step 1 – the lead multiplies the probability distribution of total demand for 3 days by 0.80 and the probability

distribution of total demand for four days by 0.20. This information is displayed in Tables 13 and 14. He quickly notices

the column total for the probability of each event multiplied by 0.80 in Table 13 is 0.80, similarly 0.20 in Table14.

6. After a bit of thought, the lead realizes whether the truck arrives on time or one day late is independent of the demand

on the store.

7. The lead reframes the question as follows: What is distribution of demand on the store just after the replenishment

delivery has arrived which brings the total inventory to target level until the next arrival of inventory, where the next

arrival is either in three days or four day where the probability of three days is 0.80 and four days is 0.20.

8. This distribution, that is the probability of different levels demand or this period with a variable end point (3 days or 4

days), is simply the weighted average of the probability distribution of total demand for three days with its equivalent

for 4 days.

9. Step 2 is simply noting all possible options is the unique set of demand values between Table13 and Tabl14 and

combining (adding) probabilities where a value is in both tables.

10. For example the values 42 to 55 can only be found in Table13. The values 58 to 76 can only be found in Table 14. The

value 56 and 57 are in both tables.

11. Table 15 and Figure 10 has the results of this combination or mixture work.

This story has a happy ending, the owner is happy and now trusts the analytics lead to finish the work – there some other

substantial complexities – coordinating safety stock decisions across the network, intermittent demand, impact of cycle

time and time between reordering, and others – future topics.

Page 22: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 22

v

index demand probability (PDF)

0.80 x

probability

001 42 0.0270 0.0216

002 43 0.0405 0.0324

003 44 0.0419 0.03348

004 45 0.0439 0.0351

005 46 0.1111 0.088848

006 47 0.1257 0.100548

007 48 0.1004 0.0803296

008 49 0.0841 0.0672792

009 50 0.1266 0.1013088

010 51 0.1131 0.0905144

011 52 0.0654 0.052296

012 53 0.0393 0.031416

013 54 0.0420 0.0336

014 55 0.0291 0.02328

015 56 0.0090 0.0072

016 57 0.0010 0.0008

SUM 1.0000 0.8000

Table13: All Possible Options for Total Demand for Three

Days with Probabilty where demand for one day is

specificed in Table01, then multiplied by 0.80

Page 23: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 23

v

index demand

probability

(PDF)

0.20 x

probability

001 56 0.0081 0.00162

002 57 0.0162 0.00324

003 58 0.0208 0.004158

004 59 0.0246 0.004914

005 60 0.0542 0.010836

006 61 0.0757 0.015131

007 62 0.0775 0.015507

008 63 0.0755 0.015094

009 64 0.1051 0.021028

010 65 0.1155 0.023101

011 66 0.0953 0.019058

012 67 0.0748 0.014955

013 68 0.0780 0.015608

014 69 0.0694 0.013871

015 70 0.0441 0.00882

016 71 0.0252 0.005047

017 72 0.0194 0.003887

018 73 0.0136 0.002728

019 74 0.0057 0.001136

020 75 0.0012 0.00024

021 76 0.0001 0.00002

SUM 1.0000 0.2000

Table14: All Possible Options for Total Demand for Four

Days with Probabilty where demand for one day is

specificed in Table01, then multiplied by 0.20

Page 24: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 24

v

index demand

probability

(PDF)

cumulative probability (CDF)

aka fill rate or success

001 42 0.0216 0.0216

002 43 0.0324 0.0540

003 44 0.0335 0.0875

004 45 0.0351 0.1226

005 46 0.0888 0.2114

006 47 0.1005 0.3120

007 48 0.0803 0.3923

008 49 0.0673 0.4596

009 50 0.1013 0.5609

010 51 0.0905 0.6514

011 52 0.0523 0.7037

012 53 0.0314 0.7351

013 54 0.0336 0.7687

014 55 0.0233 0.7920

015 56 0.0088 0.8008

016 57 0.0040 0.8049

017 58 0.0042 0.8090

018 59 0.0049 0.8139

019 60 0.0108 0.8248

020 61 0.0151 0.8399

021 62 0.0155 0.8554

022 63 0.0151 0.8705

023 64 0.0210 0.8915

024 65 0.0231 0.9146

025 66 0.0191 0.9337

026 67 0.0150 0.9486

027 68 0.0156 0.9643

028 69 0.0139 0.9781

029 70 0.0088 0.9869

030 71 0.0050 0.9920

031 72 0.0039 0.9959

032 73 0.0027 0.9986

033 74 0.0011 0.9997

034 75 0.0002 1.0000

035 76 0.0000 1.0000

mean total demand for replenisment period 51.904

standard deviation total demand replenishment 7.294

Table15: All Possible Options for Total Demand Between Replenishment, when the probabity it

is 3 days is 0.80 and 4 days is 0.20

Page 25: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 25

v

0.0000

0.0200

0.0400

0.0600

0.0800

0.1000

0.1200

42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76

Figure 10: Probability for each posssible total demand across 3 or 4 days

average total demand is 51.90average variation or standard deviation is 7.294probability of 3 days is 0.80, four days 0.20

Page 26: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 26

v

index demand

probability

(PDF)

cumulative probability

(CDF)

aka fill rate or success

001 56 0.0081 0.0081

002 57 0.0162 0.0243

003 58 0.0208 0.0451

004 59 0.0246 0.0697

005 60 0.0542 0.1238

006 61 0.0757 0.1995

007 62 0.0775 0.2770

008 63 0.0755 0.3525

009 64 0.1051 0.4576

010 65 0.1155 0.5732

011 66 0.0953 0.6684

012 67 0.0748 0.7432

013 68 0.0780 0.8213

014 69 0.0694 0.8906

015 70 0.0441 0.9347

016 71 0.0252 0.9599

017 72 0.0194 0.9794

018 73 0.0136 0.9930

019 74 0.0057 0.9987

020 75 0.0012 0.9999

021 76 0.0001 1.0000

mean total demand for 3 days 64.880

variance total demand for 3 days 13.886

standard deviation total demand for 3 days 3.726

Table12: All Possible Options for Total Demand for Four Days with Probabilty

where demand for one day is specificed in Table01

Page 27: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 27

v

0.0000

0.0200

0.0400

0.0600

0.0800

0.1000

0.1200

0.1400

56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76

Figure 09: Probability for each posssible total demand across 4 days

average total demand is 64.88average variation or standard deviation is 3.726

Page 28: STOCK CALCUTLATIONS · Our business is small ice cream store that only sells its famous vanilla ice cream in five gallon units. When the store needs to refill its supply of vanilla

Revealing The Mystery of Safety Stock Calculations 28

v

ABOUT US

Since 1993, Arkieva tools have been used in more than 200 unique

applications around the globe, and most of our clients leverage Arkieva

software to support collaborative planning teams in North America,

Europe, and in Asia