VIEWS: 6 PAGES: 25 CATEGORY: Education POSTED ON: 2/20/2010
EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization CHAPTER 27 : Introduction to UNCERTAINTY ANALYSIS UNCERTAINTY ANALYSIS VERSUS SENSITIVITY ANALYSIS INPUT UNCERTAINTY Uncertainty Analysis = Quantification of Output Uncertainty given Model and Input Uncertainty 3 .5 0 3 .0 0 2 .5 0 2 .0 0 1.5 0 1.0 0 0 .5 0 0 .0 0 0 .0 0 LM 0 .2 0 0.4 0 0 .60 U 0 .8 0 1.00 X Sensitivity Analysis = Sensitivity of Output Parameter to change in one parameter keeping others constant. 3.50 3.00 2.50 2.00 1.50 1.00 0.50 0.00 0.00 L 0.20 0.40 M U 0.60 0.80 1.00 Y OUTPUT MODEL = 2 .5 0 1.4 0 2 .0 0 F(X,Y,Z) 1.2 0 1.5 0 1.0 0 1.0 0 0 .8 0 0 .5 0 0 .6 0 L MU 0 .4 0 0 .0 0 0 .0 0 0 .2 0 0 .4 0 0 .60 0 .8 0 1.00 0 .2 0 Z 0 .0 0 0 .0 0 S1 M 0 .2 0 0.4 0 0 .60 0 .8 0 1.0 0 Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 276 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization MONTE CARLO SIMULATION/INTEGRATION INPUT UNCERTAINTY Calculate Sample X1,Y1,Z1 O1 STATISTICS 3.50 3.00 2.50 Calculate 2.00 1.50 Sample X2,Y2,Z2 O2 1.00 0.50 X 0.00 Calculate 0.00 0.20 0.40 0 .60 0 .80 1.0 0 Sample X3,Y3,Z3 O3 3 .5 0 ETC ... 3 .0 0 2 .5 0 2 .0 0 1.5 0 1.0 0 0 .5 0 0 .0 0 0 .0 0 0 .2 0 0 .4 0 0 .6 0 0 .8 0 1.0 0 Y OUTPUT MODEL = 2 .50 1.4 0 2 .00 1.2 0 1.50 F(X,Y,Z) 1.0 0 1.00 0 .8 0 0 .6 0 0 .50 0 .4 0 0 .00 0.0 0 0 .2 0 0 .4 0 0 .60 0 .8 0 1.0 0 0 .2 0 Z 0 .0 0 O 0 .0 0 0 .2 0 0 .40 0 .6 0 0 .80 1.0 0 Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 277 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization 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. Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 278 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization EXAMPLE CALCULATION: Quantity Ordered 100 Total Cost $200.00 Quantity demanded 200 Full Price Revenue $450.00 Sales price $4.50 Salvage Revenue $0.00 Salvage value $0.75 Total Revenue $450.00 Purchase price $2.00 Total Profit $250.00 Using DataTable we can graph profit as function of Order Quantity X with a given Demand D. $600.00 $500.00 $400.00 Profit $300.00 $200.00 $100.00 $0.00 0 100 200 300 400 500 Order Quantity Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 279 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization 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 Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 280 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization The demand for the calendar up to start of the new year calendar is uncertain and follows a discrete distribution. (0.30) 100 0.35 0.3 (0.20) 150 0.25 Probability 0.2 Demand (0.30) 200 0.15 0.1 (0.15) 250 0.05 0 (0.05) 300 100 150 200 250 300 Demand Suppose you order 200 Calendars. What is the uncertainty distribution of the Profit? Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 281 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization (0.30) 100 $125.00 (0.20) 150 EMV=$350.00 $312.50 (0.30) 200 Order Quantity = 200 $500.00 (0.15) 250 Demand $500.00 (0.05) 300 $500.00 0.6 0.5 Probability 0.4 0.3 0.2 0.1 0 $125.00 $312.50 $500.00 Profit Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 282 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization 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.00 150 $187.50 $375.00 $375.00 $375.00 $375.00 $318.75 200 $125.00 $312.50 $500.00 $500.00 $500.00 $350.00 250 $62.50 $250.00 $437.50 $625.00 $625.00 $325.00 300 $0.00 $187.50 $375.00 $562.50 $750.00 $271.88 Order Quantity CONCLUSION: ORDER 200 Calendars! Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 283 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization 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∼ Ν(µ, σ): ( d −u ) 2 1 − fY (d | µ ,σ ) = ⋅e 2σ 2 σ 2 ⋅π • E[Y] = µ • Var(Y) = σ 2 • Some handy rules of thumb: Pr( µ − σ < D < µ + σ ) ≈ 0.68 Pr( µ − 2σ < D < µ + 2σ ) ≈ 0.95 Pr( µ − 3σ < D < µ + 3σ ) ≈ 0.99 Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 284 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization Probability Density Function - N(2,0.5) 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 ≈ 68% ≈ 95% ≈ 99% Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 285 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization • 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( X ≤ x ) = F ( x ) Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 286 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization A random Variable Z would also have cumulative distribution function F if: Pr( Z ≤ z ) = F ( z ) 1.00 0.90 0.80 0.70 y=F(x) 0.60 0.50 0.40 0.30 0.20 0.10 0.00 100 150 200 250 300 x Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 287 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization 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). Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 288 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization 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. Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 289 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization SAMPLING ALGORITHM 1 1.00 0.90 0.80 STEP 1: Sample 0.70 Realization u from 0.60 Uniform Random 0.50 Variable U 0.40 0.30 0.20 0.10 0 0.00 100 150 200 250 300 STEP 2: Calculate realization x=F-1(u) x=F-1(u) from Random Variable Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 290 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization 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]. Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 291 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization 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 Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 292 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization ESTIMATION OF EMPIRICAL CONTINUOUS CDF Y = PROFIT 1. Given data: yi , i = 1,…,n. 2. Order data such that y(1) < y(2) < < y( n −1) < y( n ) 3. Set: 1 F ( y(1) ) = Pr(Y ≤ y(1) ) = n 2 n −1 F ( y( 2 ) ) = Pr(Y ≤ y( 2 ) ) = F ( y( n−1) ) = Pr(Y ≤ y( n −1) ) = n ; …; n n F ( y( n ) ) = Pr(Y ≤ y( n ) ) = = 1 n 4. Plot the points ( y(1) , F ( y(1) )), , ( y( n ) , F ( y( n ) )) in a graph. 5. Connect these points by a straight line. Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 293 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization 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: yi , i = 1,…,n. 2. Order data such that y(1) < y(2) < < y( n −1) < y( n ) 3. Calculate y( n ) − y(1) z j = y(1) + j ⋅ , j=1,…,m m Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 294 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization 4. For every zj determine y (i ) such that y(i ) < z j < y(i +1) 5. Set for j=0,1, …, m i F (z j ) = n 6. Set for j=1, …, m z j −1 + z j Pr(Y = ) = F ( z j ) − F ( z j −1 ), j = 1, ,m 2 STEPS 4, 5 and 6 can be executed in EXCEL using the FREQUENCY FUNCTION. Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 295 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization PROFIT DISTRIBUTION: You are 90% sure that your Profit will be larger than $356 (see Spreadsheet) Profit Distribution (after simulation of 500 replications) 0.60 0.50 0.40 Probability 0.30 0.20 0.10 0.00 $212 $241 $271 $301 $330 $360 $389 $419 $448 $478 Profit Distribution appears to have a SPIKE WHY? Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 296 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization 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 Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 297 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization X Pr(D<=X) Pr(D>X) 200 50% 50% PROFIT when D>200: Quantity Ordered 200 Total Cost $400.00 Quantity demanded 250 Full Price Revenue $900.00 Sales price $4.50 Salvage Revenue $0.00 Salvage value $0.75 Total Revenue $900.00 Purchase price $2.00 Total Profit $500.00 HENCE : Pr(Profit=$500.00)=50.00% Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 298 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization Calculating Mean Profit and Uncertainty for a number of different order quantities $700.00 $600.00 $500.00 $400.00 Profit $300.00 $200.00 $100.00 $0.00 150 170 190 210 230 250 Order Quantity 5 % Bound Mean Profit 95% Bound Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 299 Source: Financial Models Using Simulation and Optimization by Wayne Winston EMSE 388 – Quantitative Methods in Cost Engineering Financial Models Using Simulation and Optimization 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. Lecture Notes by Instructor: Dr. J. Rene van Dorp Chapter 27 - Page 300 Source: Financial Models Using Simulation and Optimization by Wayne Winston