Professional Documents
Culture Documents
RANDOMNESS IN DEMAND
To simulate randomness we use a random number generator and the
inverse of a cumulative probability distribution. Suppose you have a
spinner with three numbers on it, 0, 1, and 2, and suppose that 90 percent
of the area of the spinner is for the number 0, 7 percent is for the number 1,
and 3 percent for the number 2. Then the cumulative probability
distribution for this spinner is 0 has a 0.9 probability, 0 to 1 has a 0.97
probability, and 0, 1, or 2 has a 1.0 probability. The inverse of this
cumulative probability distribution takes a number between 0 and 1 and
maps it to the outcomes of the event. For example, 0.99 would be mapped
to 2; 0.92 would be mapped to 1; and 0.333 would be mapped to 0. In
general, it would map any number between 0 and 0.9 to 0, any number
between 0.90 and 0.97 to 1, and any number between 0.97 and 1 as 2. In
Excel you can generate random numbers between 0 and 1 using the
function =RAND(). If you put =RAND() in a cell you get a number between
0 and 1, and if you press CONTROL + F9, it gives you a different random
number. So, we could use these random numbers and the inverse of the
cumulative distribution of the spinner that was just described to simulate
spinning the spinner. For example, suppose we used =RAND() and it
returned a 0.453. Then the inverse of the cumulative distribution of the
spinner would return a 0.
The middle column in Table 5-1 is the number of units demand per day and
the last column is the probability of selling that many units in a given day.
The last column in Table 5-1 is what we are referring to as the cumulative
probability. Technically, in probability theory we would say that the
cumulative probability of selling zero units is 0.1, but here we have a zero in
that column. This is due to an idiosyncrasy of Excel in terms of how it reads
tables, as we see later in the chapter. In effect, the Cum Prob column is
shifted down one cell from what you would expect.
We would use this distribution in Excel with a random number generator
from 0 to 1, and then, based on the random number generated in Excel, we
would look at the cumulative probability column to pick out how many
units sold for that simulated day.
We can simulate a number from 0 to 1 in Excel using the function
=RAND(). Suppose we use that function and it returns a 0.15, then the
simulated number of units sold will be one unit for that day because 0.15
lies between 0.1 and 0.4, for a total of a 0.3 probability. If =RAND()
returned 0.05, then the simulated number of units sold for that day would
be zero units. In the cell where we want to simulate demand, we would use
the function =VLOOKUP(RAND(),TABLE RANGE, COLUMN NUMBER
OF UNITS OF DEMAND, COLUMN NUMBER TO LOOK UP THE
RANDOM NUMBER THAT WAS GENERATED). In this case, suppose the
cumulative probability of zero is in Cell A5. Then we would use
=VLOOKUP(RAND(),A5:C8,2,1). We could then create a column of
demand simply by copying =VLOOKUP(RAND(),$A$5:$C$8,2,1) in as
many cells as we want. Notice the “$” sign before the column and row
designations in the formula. This keeps them from changing when you copy
them to different cells.
Table 5-2 is an example of a discrete event simulation according to the
distribution in Table 5-1.
In the Quantity Demanded column you can use the Excel function
=ROUND(GAMMAINV(RAND(),ALPHA,BETA),0)
Inventory Measurement
Average Inventory is the next column and is calculated by summing the
beginning and ending inventory and dividing by 2. The eleventh column
may seem esoteric to some degree and is labeled (min I/C) SS. The part in
parentheses “min I/C” means minimum of inventory per replenishment
cycle and “SS” means safety stock. This column allows for the calculation of
historical safety stock, as discussed in Chapter 2, “Inventory Management
Fundamentals.” The formula in Excel is
=IF(Beginning Inventory this Period > Beginning Inventory Last Period,
Beginning Inventory Last Period,"")
In this discrete event simulation, replenishments are received at the
beginning of the period, so, the minimum on hand inventory in a
replenishment cycle is the beginning inventory.
The final column in the spreadsheet is Max I/C, which means the maximum
inventory per cycle. For a pure continuous review (Q,ROP) inventory
replenishment process the expected max I/C is safety stock plus the order
quantity. That is not what we are modeling here; we are modeling a
periodic review (Q,ROP) process with lost sales (no back orders).
In Figure 5-1, the vertical axis is average inventory over a day and the
horizontal axis is time in days. As you can see, it takes about 50 days to get
through the warm-up period to steady state. Consequently, if you included
the first 50 days in your metric calculations, such as average inventory over
the year, it would skew the metric to be too high. As a result, when you are
calculating your metrics, it is a good idea to set the calculations to begin
after the warm-up period. In this example, the warm-up period is an
artifact of how the beginning inventory was initialized.
Number of Replications
The other question is how many times you should replicate the discrete
event simulation. In Excel you can replicate a discrete event simulation
multiple times using the Table function. Before you run replications, you
need to decide which performance metrics you want to collect. For
example, you might want to collect fill rate, percentage of days in stock,
average inventory, historical safety stock, and others. To calculate fill rate,
sum the sales column and divide it by the sum of the demand column. To
calculate the percentage of days in stock, you could use the COUNTIF
function to count how many times ending inventory was positive and divide
that by 365 (since 365 days are simulated). When you use the Table
function in Excel, this is what you collect from the replications. In our
example, we replicated it 500 times, using a Poisson demand of 2 units per
day, a deterministic lead time of 2 days, a reorder point of 8, and an order
quantity of 10. Averaging more than 500 replications we have a fill rate of
0.97, the system is in stock 94 percent of the time, average inventory is 7,
and historical safety stock is 2. If we increase the Poisson demand to 4 units
per day, the fill rate drops to 0.75, the system is in stock 62 percent of the
time, average inventory is 3, and historical safety stock is almost 0. Now, if
you increase Q from 10 to 20, fill rate increases to 0.86, the system is in
stock 78 percent of the time, average inventory is 7.5, and historical safety
stock is still almost 0. Now, suppose the lead time goes from 2 days to 3
days, then the fill rate decreases to 0.74, the system is in stock 67 percent of
the time, average inventory is 6.4, and historical safety stock is even closer
to 0. The point of this is just to give you an idea of the types of issues you
can investigate with discrete event simulation.
Execution Errors
Now, let’s take this same inventory process and assume it is at the store
level. In this retail store, when an order is received it goes to the sales floor
to be put on the shelf. If it doesn’t all fit, the rest of it goes to the backroom.
Suppose you want to know how often orders received do not fit and must go
to the backroom. You can simply add a couple of columns to collect this
data. For example, to indicate when a replenishment will not fit on the
shelf, you could use =IF(Beginning Inventory + Replen Received >
Shelf_Cap,1,0). You could also calculate a new metric, the percentage of
time replenishments do not fit on the shelf. You could also create another
column to calculate how many units do not fit on average and the
maximum overage. In our example, suppose the demand is Poisson and 2
units per day, lead time is deterministic and 2 days, ROP = 8, Q = 10, and
Shelf Capacity = 15. Averaging more than 500 replications we have a fill
rate of 0.97, the system is in stock 94 percent of the time, average inventory
is 7, historical safety stock is 2, and the replenishment exceeds shelf
capacity only 1 percent of the time. Suppose that the company has a policy
of being in stock 99 percent of the time so the ROP is increased to 12.
Averaging more than 500 replications we have a fill rate of 0.99, the system
is in stock 99 percent of the time, average inventory is 10, historical safety
stock is 6, and the replenishment exceeds shelf capacity only 22 percent of
the time.
This gets to an important point: Discrete event simulations can ignore
important costs or ignore problems that can arise when metrics change.
Let’s take the previous example where the ROP went from 8 to 12 so as to
increase the percentage of time in stock from 94 percent to 99 percent. It
worked, but it caused the percentage of time replenishments that didn’t fit
on the shelf to increase from 1 percent to 22 percent. One obvious problem
is that this creates additional labor costs because the store associates have
to go to the shelf and then to the backroom. This would be an easy cost
metric to add to the analysis as long as we knew how much extra labor it
costs every time a replenishment didn’t fit on the shelf.4 But this creates an
additional problem, namely, product goes to the backroom more often.
Product in the backroom is difficult to find, gets damaged, stolen, and lost.
So, this increase in the amount of units going to the backroom may also
reduce fill rate at the shelf. This could also be added but would require a
study to determine the relationship between the level of backroom
inventory and shelf fill rate.
Continuing with this example, suppose the demand now increased to 4
units per day. This results in the percentage of days in stock decreasing to
87 percent and the percentage of time replenishments that don’t fit on the
shelf to 8 percent. Now, suppose we could reduce the lead time to one day.
That would decrease the percentage of days in stock to 94 percent and the
percentage of time replenishments that don’t fit on the shelf to 17 percent.
That might surprise you. The reason is that the shorter lead time effectively
increased the safety stock.
Calibration
It is a good idea to calibrate your simulation model. To calibrate your
model, you attempt to model the existing process as closely as possible and
then run the model, capture performance measures of the model, and
compare them to the actual performance metrics from the inventory
process. If they differ significantly, there are a number of aspects of the
model to check, but one of the most important first checks is the inner
workings of the spreadsheet model per se. You need to make sure there are
not any calculation errors, which are easy to make. One tool in Excel that is
useful for making sure that the calculations are referring to the correct cells
is the Trace Precedents and Trace Dependents tool. If you put your cursor
in a cell and then click Trace Precedents, it shows arrows emanating from
the cells used by the cell your cursor is in. If you put your cursor in a cell
and then click Trace Dependents, it shows arrows emanating from that cell
and pointing to the cells that use that number for calculations. It is tedious
to go through the spreadsheet and carefully check for errors, but it is worth
the investment of time and will keep you from making poor decisions based
on erroneous analysis. For the part of the spreadsheet containing the
simulation run, you only need to check the first cell that you copied down
the spreadsheet, so you will have one cell per column. You then need to
check the metric calculations based on this simulation run.
If the discrepancy is not a result of a calculation error, it is worthwhile
revisiting the process documentation created from the questions at the
beginning of this chapter. Perhaps promotions are not incorporated into
the simulation or some other ongoing demand stimulating event. Perhaps
there are more execution errors than you are aware of. Finding that the
model varies from reality is common and can simply point to execution
errors that are not being taken into account in the simulation model.
The metrics discussed in this chapter have not included cost metrics, but
cost metrics should usually be included, such as inventory holding costs,
labor costs, transportation costs, and so on. In addition, common measures
such as inventory turns, days of supply, and similar metrics would be
beneficial. It would be important to clearly understand which metrics are
most important for the study to begin with, as we discussed at the
beginning of the chapter.
Once you have made simple discrete event simulation models in Excel, you
might want to consider more elaborate models, use more elaborate discrete
event simulation tools such as Arena,6, 7 or have a discrete event simulation
expert work with you. Your prototype helps you explain the specific details
of the inventory replenishment process you are modeling. What you
learned in this chapter should help you communicate about subtle, but
important, nuances in the design and working of the process as well as how
they are modeled. In addition, as anyone who has modeled a process with
discrete event simulation knows, the effort to model the process improves
your understanding of the process per se.
ENDNOTES
1. An excellent discussion of this and other uses can be found in Ragsdale,
C. T. Spreadsheet Modeling and Decision Analysis. Cincinnati, OH: South-
Western, 1998.
2. You don’t want negative demand.
3. Integers.
4. This could be discovered with an industrial engineering study,
specifically, a time motion study.
5. The specifics of this calculation have already been discussed in Chapter
3, “Inventory Control.”
6. Rossetti, Manuel D. Discrete Event Simulation Modeling and Arena.
New York: Wiley Publishing, 2009.
7. Arena and other discrete event simulation tools can model other
processes well beyond inventory processes. It can be used to model material
handling, scheduling, routing, queues, and many other processes.