Type: | Package |
Title: | Functions for Planning and Managing Inventories in a Supply Chain |
Version: | 1.1.1 |
Author: | Marlene Marchena |
Maintainer: | Marlene Marchena <marchenamarlene@gmail.com> |
Description: | Implements different inventory models, the bullwhip effect and other supply chain performance variables. Marchena Marlene (2010) <doi:10.48550/arXiv.1009.3977>. |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
Imports: | stats |
RoxygenNote: | 6.0.1 |
NeedsCompilation: | no |
Packaged: | 2018-02-28 19:18:12 UTC; marlene |
Repository: | CRAN |
Date/Publication: | 2018-03-01 09:38:39 UTC |
Economic Order Quantity model
Description
This function finds the optimal order policy in the classical Economic Order Quantity (EOQ) model and the EOQ model with planned shortages.
Usage
EOQ(d, k, h, b = 0)
Arguments
d |
Demand per unit time. |
k |
Ordering or fixed cost per order. |
h |
Holding cost per unit of product. |
b |
Shortage penalty cost per unit (default:0) |
Details
The EOQ model, also called Lot-Sizing model, considers that demand is uniform and deterministic. Lead time, the time between the placement of an order and its receipt, is equal to zero.
The optimal order policy in the classical EOQ model minimizes the total cost associated with the ordering
and holding costs while meeting all demand (without shortage). When shortages are allowed (b>0
)
we have the EOQ model with backorders or planned shortages.
Value
A list containing:
T |
Time between orders (cycle length) |
S |
Maximum backorders in units. Displayed when b > 0 |
TVC |
Total variable cost. |
References
- Hillier, F. and Lieberman, G. (2001). Introduction to operational research. New York: McGraw-Hill, 7th.
See Also
EPQ, newsboy, WW
Examples
## Not run:
#Classical EOQ model
#Given demand d=8000 items per year; set up cost k=12000; and holding cost h=0.3
#per unit we find that the optimal solution is to order 25298 units every 3.2
#months with a total variable cost of $7589.5
## End(Not run)
EOQ(8000,12000,0.3)
## Not run:
#EOQ model with planned shortages
#Consider now that backorders are allowed with a backorder cost b=1.1 per
#unit and year. Then the optimal solution is to order 28540 units every 3.6 months.
#The total variable cost is $6727.3 and the maximum shortage is 6116 units.
## End(Not run)
EOQ(8000,12000,0.3,1.1)
Economic Production Quantity model
Description
Implements the Economic Production Quantity (EPQ) model.
Usage
EPQ(d, p, k, h, b = 0)
Arguments
d |
Deterministic demant per time unit |
p |
Production rate |
k |
Ordering or fixed cost per order. |
h |
Holding cost per unit of product. |
b |
Shortage penalty cost per unit (default:0). |
Details
The EPQ model is an extension of the EOQ
model. It considers
finite production rate, that is, the inventory is replenished
gradually as the order is produced. Note that this assumption
requires the production rate to be greater than the demand rate (p>d)
otherwise there would be no inventory at any time.
The model considers that a new order is produced incrementally when the
inventory reaches zero. During the time that production run,
t=Q/p
, inventory is accumulated at rate p-d
, which
implies that when the production of the batch Q is finished the
inventory will reach its maximum level I.
Value
EPQ()
returns a list containing:
Q |
Order quantity |
t |
Time required to produce the batch quantity |
T |
Time between orders (cycle length or time) |
I |
Maximum inventory level |
TC |
Total cost |
References
- Gallego, G. "IEOR4000: Production Management" (Lecture 2), Columbia (2004).
See Also
EOQ, newsboy, WW
Examples
## Not run:
#Suppose k = 100, h = 5, d = 200, p = 1000. Then the production run at
#t=0.1, the optimal order interval is T = 0.5, the optimal order quantity
#is Q = 100, the maximum inventory level is I=80 and the total cost is
#TC = $400.
## End(Not run)
EPQ(d=200,p=1000,k=100,h=5)
The newsboy model
Description
Implements the newsboy (or newsvendor) model with normal demand.
Usage
Newsboy(m, sd, p, c, s = 0)
Arguments
m |
Mean demand during the period |
sd |
Standard deviation of demand during the period |
p |
The selling price, where p > c |
c |
Uhe unit cost |
s |
The salvage value (default:0), where s < c |
Details
When the demand is a random variable with normal distribution,
the optimal stocking quantity that minimize the expected cost is:
Q=m+z*sd
, where z is known as the safety factor and
Q - m=z*sd
is known as the safety stock.
'Note that the newsboy problem is not formulated in terms of per unit holding cost h=c-s
and penalty cost b=p-c
.
Value
A list containing:
Q |
Optimal order-up-to quantity |
SS |
Safety stock |
ExpC |
Expected cost |
ExpP |
Expected profit |
CV |
Coefficient of variation of the demand |
FR |
Fill rate, the fraction of demand served from stock |
z |
Safety factor |
References
- Porteus E. L. (2002) Foundations of Stochastic Inventory Theory, Stanford University Press, Stanford, CA.
- Gallego G. (1995) Newsvendor Problem. IEOR 4000 Production Management.
- Ayhan, Hayriye, Dai, Jim, Foley, R. D., Wu, Joe, (2004): Newsvendor Notes, ISyE 3232 Stochastic Manufacturing & Service Systems.
See Also
EOQ, EPQ, WW, SS
Examples
## Not run:
# Example Porteus #
# Suppose demand is normally distributed with mean 100 and standard
# deviation 30. If p = 4 and c = 1, then CR = 0.75 and Q=120.23.
# Note that the order is for 20.23 units (safety stock) more than the
# mean. Note also that ExpC(120.23) = 38.13 and ExpP(120.23)=261.87,
# with FR=0.96.
## End(Not run)
Newsboy(100,30,4,1)
## Not run:
# Example Gallego #
# Suppose demand is normal with mean 100 and standard deviation 20. The
# unit cost is 5, the holding and penalty cost are 1 and 3
# respectively. From the definition of the holding and penalty
# cost we find that p=4, then CR = 0.75 and Q = 113.49. Notice that the
# order is for 13.49 units (safety stock) more than the mean,
# ExpC(113.49) = 25.42 and ExpP(113.49) = 274.58, with fill rate of
# 97 percent.
## End(Not run)
Newsboy(100,20,4,1)
Reorder Point
Description
ROP
computes the reorder point level of inventory. When inventory falls to this amount, a new order must be made.
Usage
ROP(SL, md, sd, L = 1)
Arguments
SL |
Service level, a value between 0 and 1 |
md |
Mean demand |
sd |
Standart deviation of the demand |
L |
A positive lead-time |
Value
Reorder point level
See Also
Examples
ROP(0.9,2500,500,6)
Deprecated functions in the SCperf package
Description
The functions listed below are provided for compatibility
with older version of the SCperf package. They have been deprecated
and will be defunct in the next version of this package.
Help pages for deprecated functions are available at
help("-deprecated")
Usage
SCperf(phi, theta, L = L, SL = 0.95)
SSL(method = c("MMSE", "SMA", "ES"), phi, L, p, alpha, SL)
bullwhip(method = c("MMSE", "SMA", "ES"), phi, L, p, alpha)
Details
The SCperf
function has been deprecated and will be made defunct; use
the bullwhipgame package.
The SSL
function has been deprecated and will be made defunct; use
the bullwhipgame package.
The bullwhip
function has been deprecated and will be made defunct; use
the bullwhipgame package.
Supply Chain Performance
Description
Computes the bullwhip effect for an stationary ARMA(p,q) demand process.
Usage
SCperf(phi, theta, L, SL)
Arguments
phi |
A vector of autoregressive parameters |
theta |
A vector of moving-average parameters |
L |
A positive lead-time |
SL |
Service level, (default:0.95) |
Details
The SCperf
function has been deprecated and will be made defunct; use
the bullwhipgame package.
Value
Analytical measure for the bullwhip effect
References
- Zhang, X. (2004b). Evolution of ARMA demand in supply chains. Manufacturing and Services Operations Management, 6 (2), 195-198.
- Silva Marchena, M. (2010) Measuring and implementing the bullwhip effect under a generalized demand process. http://arxiv.org/abs/1009.3977
See Also
Examples
## Not run:
#ARMA(1,1) case
SCperf(phi=0.95,theta=0.1,L=2,SL=0.99)
#AR(2) case
SCperf(phi=c(0.8,-0.2),theta=0,L=1)
## End(Not run)
Safety Stock
Description
SS
computes the safety stock level over lead-time
Usage
SS(SL, sd, L = 1)
Arguments
SL |
Service level, a value between 0 and 1 |
sd |
Standart deviation of the demand |
L |
A positive lead-time |
Value
Safety stock level over lead-time
Examples
SS(0.95,0.7,2)
Safety stock over lead-time
Description
SSL
computes the safety stock level over lead-time for three forecasting
methods: Minimum Mean Square Error (MMSE), Simple Moving Average (SMA) and
Exponential Smoothing (ES) when the demand follows a stationary AR(1) stochastic process.
Usage
SSL(method, phi, L, p, alpha, SL)
Arguments
method |
Character string specifing which method to use |
phi |
A vector of autoregressive parameters |
L |
A positive lead-time |
p |
Order to be used in the SMA method |
alpha |
Smoothing factor to be used in the ES method (0 < alpha < 1) |
SL |
Service level |
Details
The SSL
function has been deprecated and will be made defunct; use
the bullwhipgame package.
Value
Safety stock level over lead-time
See Also
Examples
## Not run:
SSL("MMSE",0.15,2,4,0.7,0.95)
SSL("SMA",0.15,2,4,0.7,0.95)
SSL("ES",0.15,2,4,0.7,0.95)
## End(Not run)
The Wagner-Whitin algorithm
Description
WW
implements the Wagner-Whitin algorithm. Considering time-varying demand, the algorithm builds production
plans that minimizes the total setup and holding costs in a finite horizon of time, assuming zero starting inventory
and no backlogging
Usage
WW(x, a, h, method = c("backward", "forward"))
Arguments
x |
A numeric vector containing the demand per unit time |
a |
A numeric number for the set-up cost per unit and period |
h |
A numeric number for the holding cost per unit and period |
method |
Character string specifing which algorithm to use: "backward" (default) or "forward" |
See Also
EOQ, EPQ, newsboy
Examples
## Not run:
# Example from Hiller, p.952, reproduced bellow:
# An airplane manufacturer specializes in producing small airplanes. It has just received
# an order from a major corporation for 10 customized executive jet airplanes for the use of
# the corporation's upper management. The order calls for three of the airplanes to be delivered
# (and paid for) during the upcoming winter months (period 1), two more to be delivered during
# the spring (period 2), three more during the summer (period 3), and the final two during the fall
# (period 4). Setting up the production facilities to meet the corporation's specifications for
# these airplanes requires a setup cost of $2 million.
# The manufacturer has the capacity to produce all 10 airplanes within a couple of months, when the
# winter season will be under way. However, this would necessitate holding seven of the airplanes in
# inventory, at a cost of $200,000 per airplane per period, until their scheduled delivery times
# (...) Management would like to determine theleast costly production schedule for filling
# this order.
## End(Not run)
x <- c(3,2,3,2)
a <- 2
h <- 0.2
WW(x,a,h,method="backward")
## Not run:
# The total variable cost is $4.8 million (minimum value in the first raw). Since we have two
# minimun values in the first raw (positions 2 and 4), we have the following solutions:
# Solution 1: Produce to cover demand until period 2, 5 airplanes. In period 3, new decision,
# minimun value 2.4 in period 4 (third raw). Then in period 3 produce to cover demand until
# period 4, 5 airplanes.
# Solution 2: Produce to cover demand until period 4, 10 airplanes.
## End(Not run)
WW(x,a,h,method="forward")
## Not run:
#The total variable cost is $4.8 million (minimum value in the last raw). Since we have two minimun
# values in columns 1 and 3, the solutions are:
# Solution 1: Produce in period 1 to cover demand until period 4, 10 airplanes.
# Solution 2: Produce in period 3 to cover demand until period 4, 5 airplanes.In period 2, new
# decision, minimun value 2.4 in raw 3. Then in period 1 produce to cover demand until
# period 2, 5 airplanes.
## End(Not run)
Bullwhip effect
Description
bullwhip
computes the increase of demand
variability for a simple two-stage supply chains
consisting of a single retailer and a single manufacturer using three
forcasting methods: Minimum Mean Square Error (MMSE), Simple Moving
Average (SMA) and Exponential Smoothing (ES) when the demand follows
a known stationary AR(1) stochastic process.
Usage
bullwhip(method, phi, L, p, alpha)
Arguments
method |
Character string specifing which method to use |
phi |
A vector of autoregressive parameters |
L |
A positive lead-time |
p |
Order to be used in the SMA method |
alpha |
Smoothing factor to be used in the ES method (0 < alpha < 1) |
Details
The bullwhip
function has been deprecated and will be made defunct; use
the bullwhipgame package.
Value
The measure for the bullwhip effect
See Also
Examples
## Not run:
bullwhip("SMA",0.9,2,4)
bullwhip("ES",0.9,2,0,0.6)
bullwhip("MMSE",0.9,2)
## End(Not run)