Optimal stock and purchase policy with stochastic external deliveries

Optimal stock and purchase
policy with stochastic external
deliveries in different markets
12th Symposium for Systems Analysis in Forest Resources,
Burlington, Vermont, USA, September 5-8, 2006
Peter Lohmander
Professor of Forest Management and Economic Optimization,
Swedish University of Agricultural Sciences, Faculty of
Forestry, Dept. of Forest Economics, 901 83 Umea, Sweden,
http://www.lohmander.com/
Version 060830
Abstract:
•
•
•
•
•
Forest industry companies with mills producing pulp, paper and sawn
wood often obtain the roundwood from many different sources. These
are different with respect to delays and degrees of variation. Private
forest owners deliver pulpwood and timber at a stochastic rate.
Imported pulpwood and timber may or may not arrive in large
quantities a particular day.
The losses may be considerable if mill production has to stop. If the
stochastic supply falls, you may instantly reduce the stock level or
buy more from the local market.
Large stock level variations are only possible if the average stock is
large. Stock holding costs may be considerable. If you control a
monopsony and let the amount you buy per period from the local
market change over time, this increases the expected cost, since the
purchase cost function is strictly convex. In a market with many
buyers, the purchase cost function appears almost linear to the
individual firm and variations are less expensive.
Hence, the optimal average stock level is higher if we have a
monopsony than if we have a market with many independent buyers.
The analysis is based on stochastic dynamic programming in Markov
chains via linear programming.
Question:
What is the optimal way to control a raw material stock
in this typical situation:
You have to deliver a constant flow of raw material to a mill. Otherwise, the mill can
not run at full capacity utilization, which decreases the revenues very much.
Some parts of the deliveries to the raw material stock can not be exactly controlled
in the short run. These deliveries are different with respect to delays and degrees of
variation.
Imported pulpwood and timber may or may not arrive in large quantities a particular
day.
Some private forest owners deliver pulpwood and timber at a stochastic rate.
Some parts of the input to the raw material stock can be rather exactly controlled in
the short run. The cost of rapidly changing such input may however be
considerable. The costs of such changes are typically a function of the properties of
the local raw material market.
Q
K
C  cm  h 
2 (Q / m)
12
Stock Level
10
8
6
4
2
0
0
1
2
3
Time
4
5
h
C  cm  Q  KmQ 1
2
The first order optimum condition is:
.
dC h
2
  KmQ  0
dQ 2
The second order condition of a unique maximum is satisfied since
2
d C
3

2
KmQ
0
2
dQ
K  0; M  0; Q  0
The first order optimum condition can be rewritten this way
and give us the optimal order quantity as an explicitQ
function of the parameters:
h
2
 KmQ
2
2Km
Q
h
Deterministic multi period linear (and quadratic) programming (LP
and QP) models
In most cases, such models are based on deterministic assumptions.
The degree of detail is high but the solutions can not explicitly take
stochastic events into account
Adaptive multi period linear (and quadratic) programming
models
Adaptive optimization is necessary. Compare Lohmander (2002)
and Lohmander and Olsson (2004).
The round wood sources and properties
Forest industry companies with mills producing pulp, paper and sawn
wood often obtain the round wood from many different sources.
These are different with respect to delays and degrees of variation.
Private forest owners deliver pulpwood and timber at a stochastic rate.
Imported pulpwood and timber may or may not arrive in large quantities
a particular day.
The losses may be considerable if mill production has to stop.
If the stochastic supply falls, you may instantly reduce the stock level or
buy more from the local market.
450
400
350
Price
300
250
200
150
100
50
0
0
2
4
6
Quantity
Figure
The local supply (price) function in the monopsony case.
p0  300 p1  10
8
10
12
c  pu
c  ( p0  p1u )u
c  p0u  p1u
2
4500
4000
3500
Cost
3000
2500
C(u)
line
2000
1500
1000
500
0
0
2
4
6
Quantity = u
8
10
12
C (0) C (10)

 2000
2
2
C  5  1750
.
C (0) C (10)

 C  5
2
2




E  C (u )   C  E (u ) 




350
300
250
Price
200
p
150
100
50
0
0
2
4
6
Quantity
8
10
12
3500
3000
2500
Cost
2000
C(u)
1500
1000
500
0
0
2
4
6
Quantity = u
8
10
12
C (0) C (10)

 C  5
2
2




E  C (u )   C  E (u ) 




Now, we will compare two strategies, A and B.
In both cases, we have to make sure that the mill
can run at full capacity utilization during the
following three periods 0, 1 and 2.
In strategy A, we try to keep the stock level as low
as possible.
In strategy B, we buy more wood locally than we
instantly need in period 1 in case the entering
stock level in period 1 is higher than zero.
Strategy A
12
Stock Level
10
8
Low
High
6
4
2
0
0
2
6
4
Stage
8
10
The expected present value of strategy A can be
illustrated this way, period by period:
1
1
YA  c(6)   c(2)  4h  c(6)    c(2)  4h  c(6) 
2
2
We can simplify the expression this way:
YA  4h  c(2)  2c(6)
Strategy B
12
Stock Level
10
#1
#2
#3
#4
8
6
4
2
0
0
2
6
4
Stage
8
10
The expected present value of strategy
B can be illustrated this way, period by
period:
1
1
YB  c(6)   c(3)  4h  c(6)    c(1)  5h  c(2)  4h  c(5)  1h  c(6) 
2
4
1
YB  18h  c(1)  c(2)  2c(3)  c(5)  7c(6) 
4
Let us investigate the difference between the
expected present values (costs) of
strategies A and B!
  YB  YA
4YA  16h  4c(2)  8c(6)
4YB  18h  c(1)  c(2)  2c(3)  c(5)  7c(6)
4  2h  c(1)  3c(2)  2c(3)  c(5)  c(6)
4  2h  p0 1*1  3* 2  2*3  1*5  1*6   p1 1*12  3* 2 2  2*32  1*52  1*6 2 
4  2h  p0 1  6  6  5  6  p1 1 12  18  25  36 
4  2h  4 p1
1
  h  p1
2
• Observation 1.
• In case the wood market is perfect, no
buyer can affect the market price.
• This means that it is not economically
rational to increase the stock level
(strategy B). Strategy A is a better
alternative.
Observation 2.
In case the wood market is a monopsony, the
buyer can affect the market price.
This means that Strategy A or strategy B can
be the best choice. It is also possible that
they are equally good.
If the derivative of price with respect to
volume (in the local supply), is sufficiently
high in relation to the marginal storage
cost, then it is optimal to increase the
stock level.
Strategy B is better than Strategy A if:
h
p1 
2
Case 1.
Parameters:
n=2
p=½
x1
x2
x1+x2
0
0
0
0
1
1
1
0
1
1
1
2
x1+x2
f(x)
0
0,25
1
0,5
2
0,25
f(x) = Probability
0,6
0,5
0,4
0,3
0,2
0,1
0
0
0,5
1
1,5
2
x = Total delivery (volume units)
2,5
The Binomial distribution of exogenous wood
deliveries
The theory of the Binomial distribution can be found in
many textbooks, such as Anderson et al. (2002). The
original work on this distribution was made by Jakob
Bernoulli (1654-1705).
n x
f ( x)    p (1  p)( n  x )
 x
f ( x)  the probability that x harvest units are delivered from n sources.
n  the number of sources
p  the probability that a particular harvest unit delivery occurs
n
n!
 
 x  x !(n  x)!
Case 2.
Parameters:
n=6
p=½
x
f(x)
x!
n!
(n-x)!
n!/x!/(n-x)!
0
0,015625
1
720
720
1
1
0,09375
1
720
120
6
2
0,234375
2
720
24
15
3
0,3125
6
720
6
20
4
0,234375
24
720
2
15
5
0,09375
120
720
1
6
6
0,015625
720
720
1
1
f(x) = Probability
0,35
0,3
0,25
0,2
0,15
0,1
0,05
0
0
2
4
6
x = Total delivery (volume units)
8
Case 3.
Parameters:
n=6
p=¼
X
f(x)
x!
n!
(n-x)!
n!/x!/(n-x)!
0
0,177979
1
720
720
1
1
0,355957
1
720
120
6
2
0,296631
2
720
24
15
3
0,131836
6
720
6
20
4
0,032959
24
720
2
15
5
0,004395
120
720
1
6
6
0,000244
720
720
1
1
0,4
f(x) = Probability
0,35
0,3
0,25
0,2
0,15
0,1
0,05
0
0
2
4
6
x = Total delivery (volume units)
8
The optimization problem at a
general level
We want to maximize the expected
present value of the profit, all revenues
minus costs, over an infinite horizon.
This is solved via stochastic dynamic
programming. Compare Howard (1960),
Wagner (1975), Ross (1983) and Winston
(2004).
Min
w
i
i
s.t.
wi    ( j i, u ) w j  Ri ,u
j
 i, u uU (i )
s max 10
Z

i 1
w(i )
The mill
In each period, the pulp production
volume, prod, is constrained by the
capacity of the mill and by the amount of
raw material (wood) in the stock.
@FOR( s_set(i):
@FOR( u_set(j):
prod(i,j) = @SMIN( millcap, (s(i)+ u(j)))
));
The cost function contains a setup cost,
csetup. The marginal profit in the mill,
margprof, is defined as the product price
minus variable production costs other than
the raw material costs.
@FOR( q_set(i): q(i) = i-1);
@FOR( q_set(i)|q(i)#LT#1 : Rev(i) = 0);
@FOR( q_set(i)|q(i)#GE#1 : Rev(i) = -csetup
+ margprof*q(i));
The stochastic exogenous deliveries
The exogenous deliveries are assumed to have a
probability function of the type defined s “Case 2”.
The probabilities, pdev, of different deviations, dev,
from the expected value are defined in this way:
@FOR( b_set(i): dev(i) = i-4 );
@for( b_set(i):@free(dev(i)));
pdev(1) = 1/64;
pdev(2) = 6/64;
pdev(3) = 15/64;
pdev(4) = 20/64;
pdev(5) = 15/64;
pdev(6) = 6/64;
pdev(7) = 1/64;
The control function:
The company purchase from the local
market is the adaptive control, u, in this
optimization problem.
The instant cost of the control can be
calculated via the price function:
c  pu
c  ( p0  p1u )u
c  p0u  p1u
2
dc
 p0  2 p1u
du
2
d c

2
p
1
2
du
The constraints:
@FOR( s_set(i):
@FOR( u_set(j)| prod(i,j)#LE# millcap #AND# (i+u(j)-prod(i,j))#LE#(smax-10):
[w_] w(i) >= Rev(1+prod(i,j)) - c(j) - mcstock*(s(i)+u(j)-prod(i,j))
+ d*(pdev(1)*w(i+u(j)-prod(i,j) + 0) +
pdev(2)*w(i+u(j)-prod(i,j) + 1) +
pdev(3)*w(i+u(j)-prod(i,j) + 2) +
pdev(4)*w(i+u(j)-prod(i,j) + 3) +
pdev(5)*w(i+u(j)-prod(i,j) + 4) +
pdev(6)*w(i+u(j)-prod(i,j) + 5) +
pdev(7)*w(i+u(j)-prod(i,j) + 6) )
));
The parameters:
Parameter
Explanation
d (=
Case “Perfect raw
material market”
Case “Monopsony
raw material
market”
Smax
The number of states.
21
21
millcap
The mill production capacity.
6
6
Csetup
The mill set up cost.
0
0
margprof
The “marginal profit” in the
mill, the product price minus
variable costs other than the
raw material costs.
1000
1000
mcstock
The marginal cost per stored
united and period.
2
2
R
Rate of interest (per year).
10%
10%
Dyear
Discounting factor per year.
1/(1+r)
1/(1+r)
d
Discounting factor per day.
dyear^(1/365)
dyear^(1/365)
P0
Wood price parameter 0
330
300
p1
Wood price parameter 1
0
10
Entering stock level
Optimal control
(local purchase)
volume in the perfect
market case
Optimal control
(local purchase)
volume in the
monopsony case
10
0
2
9
0
2
8
0
2
7
0
2
6
0
3
5
1
3
4
2
3
3
3
3
2
4
4
1
5
5
0
6
6
Optimally controlled stochastic stock path under monopsony or
perfect raw material market when the entering stock level state is 0.
14
12
x=0
x=1
x=2
x=3
x=4
x=5
x=6
Stock Level
10
8
6
4
2
0
0
1
2
Stage
3
4
Optimally controlled stochastic stock path under monopsony or
perfect raw material market when the entering stock level state is 1.
14
12
x=0
x=1
x=2
x=3
x=4
x=5
x=6
Stock Level
10
8
6
4
2
0
0
1
2
Stage
3
4
Optimally controlled stochastic stock path under monopsony
when the entering stock level state is 6.
16
14
x=0
x=1
x=2
x=3
x=4
x=5
x=6
Stock Level
12
10
8
6
4
2
0
0
1
2
Stage
3
4
Optimally controlled stochastic stock path under
perfect raw material market when the entering stock level state is 6.
14
12
x=0
x=1
x=2
x=3
x=4
x=5
x=6
Stock Level
10
8
6
4
2
0
0
1
2
Stage
3
4
Determination of the steady state probabilities of entering stock states
under optimal control and monopsony (with state constraints)
•
•
•
•
•
•
•
•
p0 = 1/64*(1*p0 +1*p1 +1*p2 +1*p3);
p1 = 1/64*(6*p0 +6*p1 +6*p2 +6*p3 +1*p4);
p2 = 1/64*(15*p0 +15*p1 +15*p2 +15*p3 +6*p4 +1*p5);
p3 = 1/64*(20*p0 +20*p1 +20*p2 +20*p3 +15*p4 +6*p5 +1*p6 + 1*p7);
p4 = 1/64*(15*p0 +15*p1 +15*p2 +15*p3 +20*p4 +15*p5 +6*p6 +6*p7 +
1*p8);
p5 = 1/64*(6*p0 +6*p1 +6*p2 +6*p3 +15*p4 +20*p5 +15*p6 +15*p7 +6*p8
+1*p9);
p6 = 1/64*(1*p0 +1*p1 +1*p2 +1*p3 +6*p4 +15*p5 +20*p6 +20*p7 +15*p8
+6*p9 +1*p10);
p7 = 1/64*(1*p4 +6*p5 +15*p6 +15*p7 +20*p8 +15*p9 +6*p10);
p8 = 1/64*(1*p5 + 6*p6 + 6*p7 + 15*p8 + 20*p9 +15*p10);
p9 = 1/64*(1*p6 +1*p7 +6*p8 +15*p9 + 20*p10);
•
p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10 = 1;
•
•
Probability
Probability distributions of the optimal entering
stock levels
0,35
0,3
0,25
0,2
0,15
0,1
0,05
0
Prob PM
Prob MO
0
2
4
6
Stock level
8
10
12
Conclusions
•
Forest industry companies with mills producing pulp, paper and sawn wood
often obtain the roundwood from many different sources. These are different
with respect to delays and degrees of variation. Private forest owners deliver
pulpwood and timber at a stochastic rate. Imported pulpwood and timber may
or may not arrive in large quantities a particular day.
•
The losses may be considerable if mill production has to stop. If the stochastic
supply falls, you may instantly reduce the stock level or buy more from the
local market.
•
Large stock level variations are only possible if the average stock is large.
Stock holding costs may be considerable. If you control a monopsony and let
the amount you buy per period from the local market change over time, this
increases the expected cost, since the purchase cost function is strictly
convex. In a market with many buyers, the purchase cost function appears
almost linear to the individual firm and variations are less expensive.
•
Hence, the optimal average stock level is higher if we have a monopsony than
if we have a market with many independent buyers.
•
The analysis is based on stochastic dynamic programming in Markov chains
via linear programming.
References
•
•
•
•
•
•
•
•
•
Anderson D.R., Sweeney D.J. and Williams T.A., Statistics for Business and
Economics, Thomson, 8th edition, 2002
Baumol, W.J., Economic theory and operations analysis, Prentice Hall, 4 ed.,
1977
Howard, R., Dynamic Programming and Markov Processes, MIT Press, 1960
Lohmander, P., On risk and uncertainty in forest management planning
systems, in: Heikkinen, J., Korhonen, K. T., Siitonen, M., Strandström, M and
Tomppo, E. (eds). 2002. Nordic trends in forest inventory, management
planning and modelling. Proceedings of SNS Meeting in Solvalla, Finland, April
17-19, 2001. Finnish Forest Research Institute, Research Papers 860, p 155-162,
ISBN 951-40-1840-0, ISSN 0385-4283
Lohmander, P., Olsson, L., Adaptive optimisation in the roundwood supply
chain, accepted for publication in SYSTEMS ANALYSIS - MODELLING SIMULATION and in Olsson Leif 2004, Optimisation of forest road investments
and the roundwood supply chain Acta Universitatis agriculturae Sueciae.
Silvestria nr 310
Markland, R.E., Topics in Management Science, Wiley, 3 ed., 1989
Ross, S., Introduction to Stochastic Dynamic Programming, Academic Press,
1983
Wagner, H., Principles of Operations Research, 2nd ed., Prentice Hall, 1975
Winston, W., Introduction to Probability Models, Operations Research: Vol. 2,
Thomson, 2004