Stochastic Process: the News Vendor Problem

Introduction

Many scenarios can be described as a stochastic process. Such as Go, DiDi, Inventory, Patient Wards, and Portfolio of Stocks. In this semester, we are going to talk about Markov Chains.

To begin with, let’s look at a simple yet interesting problem: News Vendor Problem. Its setting is very natural, suppose you are a vendor selling New York paper, you could easily observe that for each day the demand is not the same. For example, if recently there will be an election, perhaps more people would buy papers. As a vendor, you want to figure out the best quantity to order, such that you could earn the largest amount of money (in expectation). You may cleverly record each day’s demand and observe a demand distribution. Congrats! If you make use of the data you have, you can get more money!

Setting

To be more rigorous, the setting is usually as follows:

the product is perishable (say, after today it’s valueless)

You can sell it with price c p c_p cp, you buy in with c v c_v cv. If you are left with unselled items, you may get c s c_s cs per item.

Each day’s demand follows a d i s t r i b u t i o n   D distribution \, D distributionD

Clearly, to make sense, c p > c v > c s c_p > c_v > c_s cp>cv>cs, otherwise, the vendor has no motive to do the business. Also, in some casesm c s c_s cs may be negative, if we take environmental issues into consideration.

[There could also be fixed cost c f c_f cf to order. Or some “holding cost” h h h . But they shall not affect the optimal quantity. ]

Strategies

To be a clever vendor, there are clearly many strategies you could follow, to make the most fortune. Here, we suppose you are lazy and want to find out the best fixed quantity to order every day.

Say, you are ordering q q q product. Then, if today’s demand is D D D, then you will make c p min ⁡ ( D , q ) − c v q + c s max ⁡ ( 0 , D − q ) c_p\min (D, q) - c_v q + c_s \max(0, D-q) cpmin(D,q)cvq+csmax(0,Dq). That is, you could sell at most the minimum of demand and the number you ordered (which cost you c v q c_v q cvq). If there is some remaining terms, you can sell them to get c s max ⁡ ( 0 , D − q ) c_s \max(0, D-q) csmax(0,Dq).

That is,
p r o f i t ( q , D ) = c p min ⁡ ( q , D ) − c v q + c s max ⁡ ( 0 , q − D ) = c p ( q ∧ D ) − c v q + c p ( q − D ) + profit(q, D) = c_p \min(q,D) - c_v q + c_s \max(0, q-D) \\ = c_p (q\wedge D) - c_v q + c_p (q-D)^+ profit(q,D)=cpmin(q,D)cvq+csmax(0,qD)=cp(qD)cvq+cp(qD)+
Since the demand is really a random thing, we care about the expected profit, that is,
max ⁡ q   h ( q ) = E [ p r o f i t ( q , D ) ] = c p E [ q ∧ D ] − c v q + c s E [ ( q − D ) + ] \max _q \, h(q) = \mathbb{E} [profit(q, D)] \\ = c_p \mathbb{E}[q\wedge D] - c_v q + c_s \mathbb{E}[(q-D)^+] qmaxh(q)=E[profit(q,D)]=cpE[qD]cvq+csE[(qD)+]
Oops, here is a small trick, ( q − D ) + + ( q ∧ D ) ≡ q (q-D)^+ + (q\wedge D) \equiv q (qD)++(qD)q . To solve this optimization problem, it’s natural to think about “taking derivative”, right? OK, let’s start with assuming the distribution D D D is continuous. We shall get some insights from there, then we do the discrete case.

Continuous Case

h ( y ) = E [ p r o f i t ( y , D ) ] = c p E [ y ∧ D ] − c v y + c s E [ ( y − D ) + ] = c p E [ y ∧ D ] − c v y + c s E [ y − ( y ∧ D ) ] = ( c p − c s ) E [ y ∧ D ] + ( c s − c v ) y = ( c p − c s ) ( ∫ 0 y x f ( x ) d x + ∫ y ∞ y f ( x ) d x ) − c v y + c s y = ( c p − c s ) ( ∫ 0 y x f ( x ) d x + y ( 1 − F ( y ) ) ) − c v y + c s y = ( c p − c s ) [ ∫ 0 y x f ( x ) d x − y F ( y ) ] + ( c p − c v ) y h(y) = \mathbb{E} [profit(y, D)] = c_p \mathbb{E}[y \wedge D] - c_v y + c_s \mathbb{E}[(y-D)^+] \\ = c_p \mathbb{E}[y \wedge D] - c_v y + c_s \mathbb{E}[y - (y\wedge D)] \\ = (c_p - c_s) \mathbb{E}[y \wedge D] + (c_s - c_v) y\\ = (c_p-c_s) (\int_0^y x f(x)dx + \int_y^\infty y f(x)dx) - c_v y + c_s y \\ = (c_p-c_s) (\int_0^y x f(x)dx + y (1-F(y) )) - c_v y + c_s y \\ = (c_p - c_s)[\int_0^y xf(x)dx - yF(y)] + (c_p - c_v) y h(y)=E[profit(y,D)]=cpE[yD]cvy+csE[(yD)+]=cpE[yD]cvy+csE[y(yD)]=(cpcs)E[yD]+(cscv)y=(cpcs)(0yxf(x)dx+yyf(x)dx)cvy+csy=(cpcs)(0yxf(x)dx+y(1F(y)))cvy+csy=(cpcs)[0yxf(x)dxyF(y)]+(cpcv)y

To find the maximum, we take derivative wrt y y y, h ′ ( y ) = ( c p − c s ) [ y f ( y ) − F ( y ) − y f ( y ) ] + ( c p − c v ) = ( c p − c v ) − ( c p − c s ) F ( y ) h'(y) = (c_p - c_s)[ yf(y) - F(y)-y f(y) ] + (c_p - c_v) \\ = (c_p - c_v) - (c_p - c_s) F(y) h(y)=(cpcs)[yf(y)F(y)yf(y)]+(cpcv)=(cpcv)(cpcs)F(y), let it equal 0, we get F ( y ) = c p − c v c p − c s F(y) = \frac{c_p - c_v} {c_p - c_s} F(y)=cpcscpcv, that is, the maximum of h h h shall be obtained when y = F − 1 [ ( c p − c v ) / ( c p − c s ) ] y = F^{-1} [(c_p-c_v) / (c_p - c_s)] y=F1[(cpcv)/(cpcs)]. And this would be the optimal quantity to order. This number has certain interpretation in terms of economy: c p − c v c_p - c_v cpcv is the amount you will gain by ordering one more if the demand is less than you ordered, c v − c s c_v - c_s cvcs is the amount you will gain by ordering one less if the demand is more than you ordered. The ratio ( c p − c v ) / ( c p − c s ) = ( c p − c v ) / ( c p − c v + c v − c s ) (c_p - c_v) / (c_p - c_s) = (c_p - c_v) / (c_p - c_v + c_v- c_s) (cpcv)/(cpcs)=(cpcv)/(cpcv+cvcs) measures certain tradeoff.

But wait! How can we order a “fraction” number of papers? Like 10.3 papers? That’s certainly absurd, and the demand is also discrete. We will see in a moment that the conclusion for the discrete case is quite similar, with optimal ordering quantity y ∗ y* y is the least number such that F ( y ∗ ) ≥ c p − c v c p − c s F(y*) \ge \frac{c_p - c_v} {c_p - c_s} F(y)cpcscpcv

Discrete Case

All right, let’s turn our attention to the case when demand is a discrete distribution, which is more realistic. We want to pick y to maximize h ( y ) h(y) h(y), so we must have $ h(y+1) \le h(y), h(y)\ge h(y-1) $. By considering the increment h ( y + 1 ) − h ( y ) = E [ p r o f i t ( y + 1 , D ) − p r o f i t ( y , D ) ] = E [ r e v e n u e ( y + 1 , D ) − r e v e n u e ( y , D ) ] − c v h(y+1) - h(y) = \mathbb{E}[ profit(y+1, D) - profit(y, D) ] = \mathbb{E} [ revenue(y+1, D)- revenue(y, D) ] - c_v h(y+1)h(y)=E[profit(y+1,D)profit(y,D)]=E[revenue(y+1,D)revenue(y,D)]cv.

If D ≥ y + 1 , r e v e n u e ( y + 1 , D ) − r e v e n u e ( y , D ) = c p D \ge y+1 , revenue(y+1, D)- revenue(y, D) = c_p Dy+1,revenue(y+1,D)revenue(y,D)=cp

If D ≤ y , r e v e n u e ( y + 1 , D ) − r e v e n u e ( y , D ) = c s D \le y, revenue(y+1, D)- revenue(y, D) = c_s Dy,revenue(y+1,D)revenue(y,D)=cs

Thus, h ( y + 1 ) − h ( y ) = c p P ( D ≥ y + 1 ) + c s P ( D ≤ y ) − c v = c p [ 1 − P ( D ≤ y ) ] + c s P ( D ≤ y ) − c v = ( c p − c v ) − ( c p − c s ) P ( D ≤ y ) h(y+1) - h(y) = c_p P(D\ge y+1) + c_s P(D\le y) - c_v = c_p [1 - P(D\le y)] + c_s P(D\le y) - c_v = (c_p - c_v) - (c_p - c_s) P(D\le y) h(y+1)h(y)=cpP(Dy+1)+csP(Dy)cv=cp[1P(Dy)]+csP(Dy)cv=(cpcv)(cpcs)P(Dy)

Suppose y ∗ y* y is the optimal quantity, we must have h ( y ∗ + 1 ) − h ( y ∗ ) ≤ 0 , h ( y ∗ ) − h ( y ∗ − 1 ) ≥ 0 h(y*+1) - h(y*) \le 0, h(y*) - h(y*-1) \ge 0 h(y+1)h(y)0,h(y)h(y1)0

They contribute to F ( y ) ≥ ( c p − c v ) / ( c p − c s ) F(y) \ge (c_p - c_v) / (c_p - c_s) F(y)(cpcv)/(cpcs) and F ( y − 1 ) ≤ ( c p − c v ) / ( c p − c s ) F(y-1) \le (c_p - c_v) / (c_p - c_s) F(y1)(cpcv)/(cpcs) , that is, F − 1 [ ( c p − c v ) / ( c p − c s ) ] ≤ y ≤ 1 + F − 1 [ ( c p − c v ) / ( c p − c s ) ] F^{-1}[ (c_p - c_v) / (c_p - c_s) ] \le y \le 1 + F^{-1}[ (c_p - c_v) / (c_p - c_s) ] F1[(cpcv)/(cpcs)]y1+F1[(cpcv)/(cpcs)]

Therefore, we should pick y such that $y $ equals the ceiling of F − 1 [ ( c p − c v ) / ( c p − c s ) ] F^{-1}[ (c_p - c_v) / (c_p - c_s) ] F1[(cpcv)/(cpcs)] , i.e. y is the least number such that F ( y ) ≥ ( c p − c v ) / ( c p − c s ) F(y) \ge (c_p - c_v) / (c_p - c_s) F(y)(cpcv)/(cpcs). In particular case, if F ( y ∗ ) = ( c p − c v ) / ( c p − c s ) F(y*) = (c_p - c_v) / (c_p - c_s) F(y)=(cpcv)/(cpcs), then both y ∗ , y ∗ + 1 y*, y*+1 y,y+1 are optimal solutions.

A Bit Extension

Number to Report

In this section, let’s extend the news vendor problem a bit. Say you are an amazing news vendor, and you have to report your expecte profit in the future 3 months, what number should you report?

It’s tempting to just say 90 h ( q ∗ ) 90 h(q*) 90h(q), where q ∗ q* q is the optimal quantity. However, your may want to report a number such that 90% chance the future profit is higher than it. This is where confidence interval steps in. Let P [ 90 Y ≥ x ] = 1 − 0.05 P[ 90Y\ge x ] = 1-0.05 P[90Yx]=10.05, where Y Y Y follows m e a n = h ( q ∗ ) , v a r = σ 2 mean = h(q*), var = \sigma ^2 mean=h(q),var=σ2, this will give x ≤ 90 q ∗ − z 0.05 σ 90 x\le 90 q* - z_{0.05}\sigma \sqrt{90} x90qz0.05σ90 .

In reality, to report this number is complex. It may depend on the risk strategy of your company.

Perishable Items with 2 life period

In the following blog, we shall talk about how to make optimal ordering if we are selling not that easy to perish product, for example bananas. And it’s in here we shall introduce the very basics of stochastic process: DTMC (discrete time markov chain).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值