Implements the Newsboy (or Newsvendor) model with normal demand.
1 
m 
mean demand during the period, 
sd 
standard deviation of demand during the period, 
c 
the unit cost, 
p 
the selling price, where p > c 
s 
the salvage value (default:0), where s < c. 
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, the inverse of the standard normal cumulative density function of the demand, 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=cs and penalty cost b=pc.
Newsboy()
returns a list containing:
Q 
optimal orderupto quantity, 
SS 
safety stock, 
ExpC 
expected cost, 
ExpP 
expected profit, 
CV 
coefficient of variation of the demand, 
CR 
(pc)/(ps)=b/(b+h), critical ratio, 
FR 
fill rate, the fraction of demand served from stock, 
z 
safety factor. 
Marlene Silva Marchena marchenamarlene@gmail.com
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  # 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.
Newsboy(100,30,4,1)
# 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.
Newsboy(100,20,4,1)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.