The newsvendor problem is a simple model of stochastic optimization problem where a decision has to be made when there is uncertainty about the outcome. It also shows that for some stochastic optimization problems it is possible to obtain the qualitative properties of the nature of optimal solution.
Each morning, a newsvendor has to decide how many newspapers to buy before knowing the demand during the day. The newsvendor purchases a newspaper at a cost of per newspaper and sells them at a cost of per newspaper, where . Any unsold newspapers at the end of the day have no salvage value.
Let denote the number of newspapers bought and denotes the demand. If , then the newsvendor will sell newspapers and receive a total earnings of . If , then the newsvendor will sell newspapers and receive a total earning of . Thus, the reward is , where
2.1 Interlude with continuous version
The problem above has discrete action and discrete demand. To build intuition, we first consider the case where both the actions and demand are continuous. Let denote the probability density of the demand and denote the cumulative probability density. Then, the expected reward is
To fix ideas, we consider an example where , , and the demand is a Kumaraswamy distribution with parameters and support . The performance of a function of action is shown below.
p =0.5q =1r =function(w,a){ if(w<=a) { return q*w - p*a } else { return q*a - p*a } }a_opt =inverseCDF( (q-p)/q )config = ({// Kumaraswamy Distribution: https://en.wikipedia.org/wiki/Kumaraswamy_distributiona:2,b:5,max:100})pdf = {const a = config.aconst b = config.breturnfunction(x) {var normalized = x/config.maxreturn a*b*normalized**(a-1)*(1- normalized**a)**(b-1) }}inverseCDF= {const a = config.aconst b = config.breturnfunction(y) {// Closed form expression for inverse CDF of Kumaraswamy distribution return config.max* (1- (1-y)**(1/b))**(1/a) }}points = { const n =1000var points =newArray(n)var cdf =0;for (var i =0; i < n; i++) {var x = config.max* i/n cdf = cdf +pdf(x) *1/n points[i] = {demand: x,pdf:pdf(x),CDF: cdf,reward:r(x,action) } }return points}cost_values = {const n =1000var points =newArray(n)for (var i =0; i < n; i++) {var x = config.max* i/n points[i] = {action: x,performance:J(x)} }return points}J = {const a = config.aconst b = config.breturnfunction(action) {const n =1000var cost =0var w =0for (var i =0; i < n; i++) { w = config.max*i/nif (w <= action) { cost += (q*w - p*action)*pdf(w)/n } else { cost += (q*action - p*action)*pdf(w)/n } }return cost }}
Figure 2.1: An example to illustrate the results. Plot (a) shows the performance as a function of action; the blue dot shows the value of chosen action and the red dot shows the value of optimal action. Plot (b) shows the PDF of the demand where the blue shaded region shows the probability of getting a demand less than ordered goods and the red shaded region shows the probability of getting a demand greater than ordered goods. Plot (c) shows the reward function , which depends on the values of and .
In Figure 2.1(a), the plot of is concave. We can verify that this is true in general.
Verify that is concave
To verify that the function is concave, we compute the second derivative:
This suggests that we can use calculus to find the optimal value. In particular, to find the optimal action, we need to compute the such that .
Proposition 2.1 For the newsvendor problem with continuous demand, the optimal action is In the literature, the quantity is called the critical fractile.
Proof
Leibniz integral rule
Using the Leibniz integral rule, the derivative of the first term of is
Similarly, the derivative of the second term of is
Combining the two, we get that
Equating this to , we get
Graphical interpretation of the result
The result of Proposition 2.1 has a nice graphical interpretation. Draw the CDF of the demand. The optimal action is the point where the CDF intersects the horizontal line .
Now, we come back to the problem with discrete actions and discrete demand. Suppose takes the values (where ) with probabilities . It is easy to see that in this case the action should be in the set .
To fix ideas, we repeat the above numerical example when .
pointsD = { const n =100var points =newArray(n)var cdf =0for (var i =0; i < n; i++) {var x = config.max* i/n cdf = cdf +pdf(x) *1/n points[i] = {demand: x,pdf:pdf(x) *1/n,CDF: cdf,reward:r(x,actionD) } }return points}cost_valuesD = {const n =100var points =newArray(n)for (var i =0; i < n; i++) {var x = config.max* i/n points[i] = {action: x,performance:J(x)} }return points}a_optD =Math.round(a_opt*100)/100
Figure 2.2: An example to illustrate the results. Plot (a) shows the performance as a function of action; the blue dot shows the value of chosen action and the red dot shows the value of optimal action. Plot (b) shows the PDF of the demand where the blue shaded region shows the probability of getting a demand less than ordered goods and the red shaded region shows the probability of getting a demand greater than ordered goods. Plot (c) shows the reward function , which depends on the values of and .
In the discrete case, the brute force search is easier (because there are a finite rather than continuous number of values). We cannot directly use the ideas from calculus because functions over discrete domain are not differentiable. But we can use a very similar idea. Instead of checking if , we check the sign of .
Proposition 2.2 Let denote the cumulative mass function of the demand. Then, the optimal action is the largest value of such that
Proof
The expected reward for choice is
Thus, Note that Thus, for all such that , we have . On the other hand, for all such that , we have . Thus, the optimal amount to order is the largest such that .
Graphical interpretation of the result
The structure of the optimal solution is the same for continuous and discrete demand distributions. In particular, the result of Proposition 2.2 has the same graphical interpretation as that of Proposition 2.1:
Draw the CDF of the demand. The optimal action is the point where the CDF intersects the horizontal line .
Exercise 2.1 (Qualitative properties of optimal solution) Intuitively, we expect that if the purchase price of the newspaper increases but the selling price remains the same, then the newsvendor should buy less newspapers. Formally prove this statement.
Hint: The CDF of a distribution is a weakly increasing function.
Exercise 2.2 (Monotonicity of optimal action) Consider two scenarios for the case with continuous demand and actions. In scenario 1, the demand is distributed according to PDF . In scenario 2, it is distributed according to PDF . Suppose for all . Show that the optimal action for scenario 1 is greater than the optimal action for scenario 2.
Hint: Plot the two CDFs and try to interpret the optimal decision rule graphically.
Exercise 2.3 (Selling random wind) The amount of power generated by the wind turbine is a positive real-valued random variable with probability density function . The operator of the wind turbine has to commit to provide a certain amount of power in the day-ahead market. The price of power is per MW.
If the operator commits to provide MWs of power and the wind generation is less than , then he has to buy the balance from a reserves market at the cost of per unit, where . Thus, the reward of the operator is where
Find the value of commitment that maximizes the expected reward.
Notes
Perhaps the earliest model of the newsvendor problem appeared in Edgeworth (1888) in the context of a bank setting the level of cash reserves to cover demands from its customers. The solution to the basic model presented above and some of its variants was provided in Morse and Kimball (1951); Arrow et al. (1952); Whitin (1953). See Porteus (2008) for an accessible introduction.
The example of selling random wind in Exercise 2.3 is taken from Bitar et al. (2012).
Arrow, K.J., Harris, T., and Marschak, J. 1952. Optimal inventory policy. Econometrica20, 1, 250–272. DOI: 10.2307/1907830.
Bitar, E., Poolla, K., Khargonekar, P., Rajagopal, R., Varaiya, P., and Wu, F. 2012. Selling random wind. Hawaii international conference on system sciences, IEEE, 1931–1937.
Edgeworth, F.Y. 1888. The mathematical theory of banking. Journal of the Royal Statistical Society51, 1, 113–127. Available at: https://www.jstor.org/stable/2979084.
Morse, P. and Kimball, G. 1951. Methods of operations research. Technology Press of MIT.
Porteus, E.L. 2008. Building intuition: Insights from basic operations management models and principles. In: D. Chhajed and T.J. Lowe, eds., Springer, 115–134. DOI: 10.1007/978-0-387-73699-0.
Whitin, S. 1953. The theory of inventory management. Princeton University Press.