Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 276 Source: Financial Models Using Simulation and Optimization by Wayne Winston
CHAPTER 27 : Introduction to UNCERTAINTY ANALYSIS
UNCERTAINTY ANALYSIS VERSUS SENSITIVITY ANALYSIS
MODEL =F(X,Y,Z)
0.00
0.50
1.00
1.50
2.00
2.50
3.00
3.50
0.00 0.20 0.40 0.60 0.80 1.00
0.00
0.50
1.00
1.50
2.00
2.50
3.00
3.50
0.00 0.20 0.40 0.60 0.80 1.00
0.00
0.20
0.40
0.60
0.80
1.00
1.20
1.40
0.00 0.20 0.40 0.60 0.80 1.00
INPUT UNCERTAINTY
OUTPUT
0.00
0.50
1.00
1.50
2.00
2.50
0.00 0.20 0.40 0.60 0.80 1.00
L UM
UM
UML
L
Uncertainty Analysis = Quantificationof Output Uncertainty given Modeland Input Uncertainty
Sensitivity Analysis = Sensitivity ofOutput Parameter to change in oneparameter keeping others constant.
MS1
X
Y
Z
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 277 Source: Financial Models Using Simulation and Optimization by Wayne Winston
MONTE CARLO SIMULATION/INTEGRATION
MODEL =F(X,Y,Z)
0.00
0.50
1.00
1.50
2.00
2.50
3.00
3.50
0.00 0.20 0.40 0.60 0.80 1.00
0.00
0.50
1.00
1.50
2.00
2.50
3.00
3.50
0.00 0.20 0.40 0.60 0.80 1.00
0.00
0.20
0.40
0.60
0.80
1.00
1.20
1.40
0.00 0.20 0.40 0.60 0.80 1.00
INPUT UNCERTAINTY
OUTPUT
0.00
0.50
1.00
1.50
2.00
2.50
0.00 0.20 0.40 0.60 0.80 1.00
X
Y
Z
Sample X1,Y1,Z1 O1
O
Calculate
Sample X2,Y2,Z2 O2Calculate
Sample X3,Y3,Z3 O3Calculate
STATIS
T ICS
ETC ...
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 278 Source: Financial Models Using Simulation and Optimization by Wayne Winston
Description Case Study:
You need to determine how many Year 2006 Calendars you need to order in August 2005. It costs $2.00 to order each calendar and you can sell a calendar for $4.50. After January 1, 2006 left over calendars are returned for $0.75. Suppose you decide to order X calendars in August and the actual Demand equals D. What would be your profit?
Total Cost = X·$2.00 Full Price Revenue = Min(X,D)·$4.50
Salvage Revenue = 1[D,∞](X) ·(X-D)·$0.75
Total Revenue = Full Price Revenue – Salvage Revenue Total Profit = Total Revenue – Total Cost.
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 279 Source: Financial Models Using Simulation and Optimization by Wayne Winston
EXAMPLE CALCULATION:
Quantity Ordered 100 Total Cost $200.00Quantity demanded 200 Full Price Revenue $450.00Sales price $4.50 Salvage Revenue $0.00Salvage value $0.75 Total Revenue $450.00Purchase price $2.00 Total Profit $250.00
Using DataTable we can graph profit as function of
Order Quantity X with a given Demand D.
$0.00
$100.00
$200.00
$300.00
$400.00
$500.00
$600.00
0 100 200 300 400 500
Order Quantity
Prof
it
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 280 Source: Financial Models Using Simulation and Optimization by Wayne Winston
CONCLUSION: PROFIT is maximized when Order Quantity exactly equals the demand!
Thus, if you know the demand you would order the same amount (NO SURPRISE)
BUT!
The demand is uncertain and can only take the values 100,150, 200, 250, 300
AS A RESULT:
For any given Order Quantity X, the Profit is Uncertain as well.
• Input Parameter: Demand • Output Parameter: Profit • Model: Profit Calculation with given demand D and Order Quantity X
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 281 Source: Financial Models Using Simulation and Optimization by Wayne Winston
The demand for the calendar up to start of the new year calendar is uncertain and follows a discrete distribution.
Suppose you order 200 Calendars. What is the uncertainty distribution of the Profit?
Demand
100
150
200
250
300
(0.30)
(0.20)
(0.30)
(0.15)
(0.05)0
0.05
0.1
0.15
0.2
0.25
0.3
0.35
100 150 200 250 300
Demand
Prob
abili
ty
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 282 Source: Financial Models Using Simulation and Optimization by Wayne Winston
0
0.1
0.2
0.3
0.4
0.5
0.6
$125.00 $312.50 $500.00
Profit
Prob
abili
ty
Demand
100
150
200
250
300
(0.30)
(0.20)
(0.30)
(0.15)
(0.05)
Order Quantity = 200
$125.00
$312.50
$500.00
$500.00
$500.00
EMV=$350.00
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 283 Source: Financial Models Using Simulation and Optimization by Wayne Winston
The decision problem at hand is to select that order quantity that maximizes the expected profit. It only makes sense to only consider ordering 100, 150, 200, 250 or 300 Calendars.
WHY?
CONCLUSION: Our input uncertainty model greatly simplified our problem
Demand 100 150 200 250 300 Expected Profit
100 $250.00 $250.00 $250.00 $250.00 $250.00 $250.00150 $187.50 $375.00 $375.00 $375.00 $375.00 $318.75200 $125.00 $312.50 $500.00 $500.00 $500.00 $350.00250 $62.50 $250.00 $437.50 $625.00 $625.00 $325.00300 $0.00 $187.50 $375.00 $562.50 $750.00 $271.88
Order Quantity
CONCLUSION: ORDER 200 Calendars!
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 284 Source: Financial Models Using Simulation and Optimization by Wayne Winston
CONTINUOUS DEMAND The assumption of discrete demand is somewhat unrealistic. Suppose for example demand is Normal Distributed with a mean of 200 and a standard deviation of 30.
INTERMEZZO: THE NORMAL DISTRIBUTION • D∼ Ν(µ, σ):
2
2
2)(
21),|( σ
πσσµ
ud
Y edf−
−⋅
⋅=
• E[Y] = µ
• Var(Y) = 2σ • Some handy rules of thumb:
68.0)Pr( ≈+<<− σµσµ D 95.0)22Pr( ≈+<<− σµσµ D 99.0)33Pr( ≈+<<− σµσµ D
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 285 Source: Financial Models Using Simulation and Optimization by Wayne Winston
Probability Density Function - N(2,0.5)
00.10.20.30.40.50.60.70.80.9
0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00
≈ 68%≈ 95%
≈ 99%
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 286 Source: Financial Models Using Simulation and Optimization by Wayne Winston
• 68 % Credibility Interval for Demand: [170,230] • 95 % Credibility Interval for Demand: [140,260] • 99 % Credibility Interval for Demand: [110,290]
• Due to out INPUT UNCERTAINTY MODEL, we need to consider all possible
values for ORDER QUANTITY and not just the five values we had before.
CONTINUOUS RANDOM NUMBER GENERATION
Suppose X is a CONTINUOUS random
variable with cumulative distribution function F
)()Pr( xFxX =≤
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 287 Source: Financial Models Using Simulation and Optimization by Wayne Winston
A random Variable Z would also have cumulative distribution function F if: Pr( ) ( )Z z F z≤ =
0.000.100.200.300.400.500.600.700.800.901.00
100 150 200 250 300
x
y=F(x)
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 288 Source: Financial Models Using Simulation and Optimization by Wayne Winston
CONCLUSION: CDF is Continuous Strictly Increasing Function. Therefore
F(x) has a well defined inverse function: F-1(y)=x
THEOREM :
Let X be a continuous random variable with cdf F(x). Let U be a uniform random variable on [0,1].
Let Z be the random variable, such that: Z= F-1(U)
Z is a continuous random variable with cdf F(z).
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 289 Source: Financial Models Using Simulation and Optimization by Wayne Winston
PROOF: Pr{Z ≤ z}= Pr{ F-1(U) ≤ z }
Because F is a strictly increasing function we now have
Pr{Z ≤ z}= Pr{ F[F-1(U)] ≤ F[z] }
But F[F-1(U)]=U, hence
Pr{Z ≤ z}= Pr{ U ≤ F[z] } = F(z),
Because for a uniform U on [0,1] we know that Pr{U≤ u}=u.
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 290 Source: Financial Models Using Simulation and Optimization by Wayne Winston
0.000.100.200.300.400.500.600.700.800.901.00
100 150 200 250 300
x=F-1(u)
STEP 1: SampleRealization u fromUniform RandomVariable U
1
0
STEP 2: Calculaterealization x=F-1(u) from RandomVariable
SAMPLING ALGORITHM
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 291 Source: Financial Models Using Simulation and Optimization by Wayne Winston
HOMEWORK: PROVE THE FOLLOWING THEOREM
THEOREM :
Let X be a continuous random variable with cdf F(x).
Let Z be the random variable, such that: Z= F(X)
Prove that Z is a uniform random variable on [0,1].
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 292 Source: Financial Models Using Simulation and Optimization by Wayne Winston
MACRO CODE IN EXCEL
Sub CreateSample() ' ' CreateSample Macro ' Macro recorded 4/4/2005 by . '
' For i = 1 To 500 Sheets("Profit Sample").Cells(1, 5).Value = i Sheets("Profit Sample").Cells(i, 2).Value =
Sheets("Profit Model Normal").Cells(12, 6).Value Calculate Next i
End Sub
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 293 Source: Financial Models Using Simulation and Optimization by Wayne Winston
ESTIMATION OF EMPIRICAL CONTINUOUS CDF
Y = PROFIT 1. Given data: iy , i = 1,…,n. 2. Order data such that
(1) (2) ( 1) ( )n ny y y y−< < < < 3. Set:
nyYyF 1)Pr()( )1()1( =≤=
nyYyF 2)Pr()( )2()2( =≤= ; …; n
nyYyF nn1)Pr()( )1()1(
−=≤= −−
( ) ( )( ) Pr( ) 1n nnF y Y yn
= ≤ = =
4. Plot the points (1) (1) ( ) ( )( , ( )), , ( , ( ))n ny F y y F y in a graph. 5. Connect these points by a straight line.
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 294 Source: Financial Models Using Simulation and Optimization by Wayne Winston
ESTIMATION OF M-POINT EMPIRICAL PROBABILITY MASS FUNCTION (or HISTOGRAM)
APPROACH: Develop a DISCRETE APPROXIMATION of CONTINUOUS PDF by assigning probability mass on the interval [a,b] to the midpoint of this interval i.e. (a+b)/2. NOTE: Pr(Y ∈ [a,b]) = F(b)-F(b)
M-point approximation method of PDF 1. Given data: iy , i = 1,…,n. 2. Order data such that
(1) (2) ( 1) ( )n ny y y y−< < < < 3. Calculate
( ) (1)(1)
nj
y yz y j
m−
= + ⋅ , j=1,…,m
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 295 Source: Financial Models Using Simulation and Optimization by Wayne Winston
4. For every jz determine )(iy such that
( ) ( 1)i j iy z y +< <
5. Set for j=0,1, …, m
( )jiF zn
=
6. Set for j=1, …, m
11Pr( ) ( ) ( ), 1, ,
2j j
j j
z zY F z F z j m−
−
+= = − =
STEPS 4, 5 and 6 can be executed in EXCEL using the FREQUENCY FUNCTION.
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 296 Source: Financial Models Using Simulation and Optimization by Wayne Winston
PROFIT DISTRIBUTION: You are 90% sure that your Profit will be larger than $356 (see Spreadsheet)
Distribution appears to have a SPIKE WHY?
Profit Distribution (after simulation of 500 replications)
0.00
0.10
0.20
0.30
0.40
0.50
0.60
$212
$241
$271
$301
$330
$360
$389
$419
$448
$478
Profit
Prob
abili
ty
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 297 Source: Financial Models Using Simulation and Optimization by Wayne Winston
MODEL
Total Cost = X·$2.00 Full Price Revenue = Min(X,D)·$4.50 Salvage Revenue = 1[D, ∞](X) ·(X-D)·$0.75 or Salvage Revenue = 1[0,X](D) ·(X-D)·$0.75 Total Revenue = Full Price Revenue – Salvage Revenue Total Profit = Total Revenue – Total Cost.
Setting ORDER QUANTITY X=200 it follows that
SALVAGE REVENUE = 0 when D>200
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 298 Source: Financial Models Using Simulation and Optimization by Wayne Winston
X Pr(D<=X) Pr(D>X)200 50% 50%
PROFIT when D>200:
Quantity Ordered 200 Total Cost $400.00Quantity demanded 250 Full Price Revenue $900.00Sales price $4.50 Salvage Revenue $0.00Salvage value $0.75 Total Revenue $900.00Purchase price $2.00 Total Profit $500.00
HENCE :
Pr(Profit=$500.00)=50.00%
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 299 Source: Financial Models Using Simulation and Optimization by Wayne Winston
Calculating Mean Profit and Uncertainty for
a number of different order quantities
$0.00
$100.00
$200.00
$300.00
$400.00
$500.00
$600.00
$700.00
150 170 190 210 230 250
Order Quantity
Pro
fit
5 % Bound Mean Profit 95% Bound
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization
Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 300 Source: Financial Models Using Simulation and Optimization by Wayne Winston
Order Quantity 5% Bound Expected Profit 95% Bound
150 $330.82 $372.45 $375.00
160 $339.70 $396.34 $400.00
170 $312.83 $415.10 $425.00
180 $303.25 $431.59 $450.00
190 $259.06 $439.54 $475.00
200 $273.81 $452.57 $500.00
210 $254.89 $459.41 $525.00
220 $252.73 $462.75 $550.00
230 $240.43 $452.70 $575.00
240 $231.94 $443.16 $600.00
250 $187.48 $432.00 $625.00
Conclusion: Set order quantity at 220.