#### Transcript Chapter 19

ENGINEERING ECONOMY Fifth Edition Blank and Tarquin Mc Graw Hill CHAPTER 19 MORE ON VARIATION AND DECISION MAKING UNDER RISK 1 19. Learning Objectives 1. Understand certainty and risk. 2. Examine variables and distributions. 3. Relate to the context of random variables. 4. Estimate expected value and standard deviation from sampling. 5. Understand and apply Monte Carlo techniques and simulation to engineering economy problems. 2 19.1 Certainty, Risk, and Uncertainty It is said, “There is nothing certain in this world other than death and taxes.” Situations and the passage of time create change, variation, instability. Engineering economy deals with aspects of a very uncertain future. 3 19.1 A Parable worth remembering Yesterday is history… today is “now”… and tomorrow is a mystery. Putting this into perspective: Accountants deal with yesterday. Engineers deal with tomorrow… when it comes to engineering economy. So, how can we deal with the uncertainties of future estimation? 4 19.1 Certainty Most of the chapters in this text have presented problems where values were given: Assume certainty of occurrence; Sorry, the real world is not like that! About the only “certain” or near-certain parameter in a problem might be the purchase price of an asset; the rest of the parameters will vary with time. 5 19.1 Decision Making under Risk Risk is associated with knowing the following about a parameter: 1. The number of observable values and, 2. The probability of each value occurring. 3. We know the “state of nature” of the process at hand. Decision making under risk 6 19.1 Decision Making under Uncertainty We will have two or more observable values; However, we find it most difficult to assign the probability of occurrence of the possible outcomes; At times, no one is even willing to try to assign probabilities to the possible outcomes. 7 19.1 Discrete vs. Continuous Outcomes If a parameter is “discrete,” then there are a finite number of occurrences that can occur, and we attempt to assign a probability for each outcome. If a parameter is continuous in nature, then it can take on an infinite number of values between two set limits, and we would have to deal with continuous functions. 8 19.1 Example 19.1 Two individuals assessing wedding costs: (Charles and Sue) Charles’ estimates are (subjective) Estimated Costs Prob(Cost) $3,000 0.65 $5,000 0.25 $10,000 0.10 9 19.1 Ex. 19.1 Histogram Plot: Charles Output produced by Palisade’s RiskView Excel add-in software. Note the mean value for Charles: $4,200 for the wedding costs. 10 19.1 Example 19.1 Sue, on the other hand, estimates the following estimated costs for the Estimated Costs Prob(Cost) $8,000 0.333 $10,000 0.333 $15,000 0.333 You should feel sorry for Sue’s father: He will have to pay for the wedding! 11 19.1 Sue’s Probability Distribution Sue’s mean value for the wedding is $11,000. 12 19.1 The Merged PDF Plots for Charles and Sue After discussion, they agree that the wedding should cost from $7,500 to no more than $10,000 with equal probability. The agreed-to distribution uniform from 7,500 to 10,000 with equal probability. 13 19.1 Before a Study Is Started: Must decide the following: Analysis under certainty (point estimates); Analysis under risk: Assign probability values or distributions to the specified parameters; Account for variances; Which of the parameters are to be probabilistic and which are to be treated as “certain” to occur? 14 19.1 Two Ways to Account for Risk 1. Expected Value Analysis 1. Discrete or continuous? 2. Must assign or assume probabilities/probability distributions. 2. Simulation Analysis 1. Assign relevant probability distributions: 2. Generate simulated data by applying sampling techniques from the assumed distributions. 15 19.1 Analysis under Uncertainty This is the “worst” situation to be in. Here, the states of nature may or may not be known, or; States of nature may be defined, but assignment of probability distributions is at best “a shot in the dark.” What do you do? Try to move from a degree to an improved level of acceptable risk. (Hereon, we assume decision making under risk.) 16 ENGINEERING ECONOMY Fifth Edition Blank and Tarquin Mc Graw Hill CHAPTER 19 19.2 ELEMENTS IMPORTANT TO DECISION MAKING UNDER RISK 17 19.2 Basic Probability and Statistics RANDOM VARIABLE A rule that assigns a numerical outcome to a sample space. Describes a parameter that can assume any one of several values over some range. Random Variables (RV’s) can be: Discrete or, Continuous. 18 19.2 Two Types Discrete – assumes only finite values. Continuous – can assume an infinite number of values over a defined range. 19 19.2 Probability A number between 0 and 1. Represents a “chance” of some event occurring. Notations: P(Xi), P(X = Xi): read as: “The probability that the random variable, X, assumes a value of, say, Xi” 20 19.2 Probability For a given event and all of that event’s possible outcomes: The summation of the probabilities for all possible outcomes must sum to 1.00. A probability assignment of “0” means that the event is impossible to occur. 21 19.2 Probability Distributions A function that defines how probability is distributed over the different values a random variable can assume. 22 19.2 Probability Distributions Individual probability values are stated as: P(Xi) = probability that X = Xi [19.1] “X” represents the random variable or rule (math function, for example) Xi represents a specific value generated from the random variable, X. Remember, the random variable, X, is most likely a rule or function that assigns probabilities. 23 19.2 Probability Distributions Probabilities are developed two ways: 1. Listing the outcome and the associated probability: 2. From a mathematical function that is a proper probability function. 24 19.2 Cumulative Probability Distribution Cumulative Probability Distribution, or CDF – Cumulative distribution function: Represents the accumulation for probability over all values of the variable. Notation: F(Xi) 25 19.2 The CDF General Form F(Xi)= P(X Xi) for all i in the domain of X. 26 19.2 Example 19.2 Data No of Treatments Per Day 0 Prob. of Infection Reduction 0.07 1 0.08 2 0.10 3 0.12 4 0.13 5 0.25 6 0.25 Discrete data with seven possible outcomes. The probabilities were most likely developed from experimental observations. 27 19.2 Example 19.2 CDF Computed No. of Treatments Per Day 0 Prob. of Infection Reduction 0.07 Cumulative Probability 1 0.08 0.15 2 0.10 0.25 3 0.12 0.37 4 0.13 0.50 5 0.25 0.75 6 0.25 1.00 0.07 28 19.2 Discrete Probability Distributions PDF and CDF from Example 19.2 29 19.2 Continuous Distribution: Uniform If the distribution in question represents outcomes that can assume a continuous range of values, then: The model is described by some assignment of fitted continuous-type distribution. One common type of distribution is the: UNIFORM DISTRIBUTION 30 19.2 Uniform Distribution Discrete or continuous: For the continuous case, new notation: Let f(X) denote the PDF of the random variable; F(X) denotes the cumulative density function (CDF) of the random variable. 31 19.2 Equal Probability For the uniform distribution: All of the values from A to B are considered equally likely to occur. Thus, all values from A to B have the same probability of occurring. See example 19.3 for cash-flow modeling. 32 19.2 Example 19.3 – Cash-Flow Modeling Client 1 Estimated low cash flow: $10,000 Estimated high cash flow: $15,000 Distributed uniformly between $10,000 and $15,000. The cash flow is assumed to be best described as a uniformly distributed random variable between $10,000 and $15,000. 33 19.2 Example 19.2: Client 1 Distribution PDF – Uniform{10k – 15k} CDF from the PDF 34 19.2 Parameters for the Uniform Density f(X): 1 1 f (X ) Max Min B A Cumulative Density, F(X): x min x A F(X ) Max Min B A 35 19.2 Uniform Distribution Mean: Min Max A B 2 2 Variance: ( Max Min) ( B A) Var ( ) 12 12 2 2 2 X 36 19.2 Client 1: Question What is the probability that the monthly cash flow will be no more than $12,000? P(X 12,000) = F(12,000); A = 10,000; B = 15,000 f(X) = 1/(15 – 10) = 1/5 = 0.200 F(12) = Cumulative of “12”; = (12 – 10)/5 = 4/5 = 0.80: 80% chance that the CF will be $12,000 or less! 37 19.2 Example 19.3: Client 2 Parameters for Client 2: Assumed Distribution – Triangular Parameters: Low = Most Likely: High: 20 ($ x 1000) 28 ($ x 1000) 30 ($ x 1000). The triangular distribution is used to model Client 2’s cash flow. 38 19.2 Triangular Distribution Typical Triangular pdf and cdf: PDF – Client 2 CDF – Client 2 39 19.2 Parameters for a Triangular L = low value; M = most likely; H = High value. f(X) is in two parts: 2( X L) f ( x) if L X M ( M L)( H L) or, 2( M X ) f(x) = if M X H ( M L)( H M ) 40 19.2 Example 19.2: Client 2, P(X 25,000) “M” is the mode of the distribution; Mode is the most frequently occurring value. For the Triangular: f(mode) = f(M) = 2/(H-L); (19.5) Cumulative F(M) = (M-L)/(H-L) (19.6) f(28) = 2/(30-20)= 0.2 = 20% The breakpoint is at the mode, M = 28; F(28) = P(X 28) = (28-20)/30-20) = 0.8 41 19.2 Example 19.3: Client 2 Analysis Given the CDF, F(X) one locates 25 on the xaxis, projects up to the curve and over to read off 0.3125. 42 19.3 Random Samples Assume an economic parameter can be described by a random variable – X. We assume that the random variable, X, possesses a true mean and variance denoted by: - the parameter’s true (but possibly unknown) mean value and; 2 – the parameter’s true (but possibly unknown) variance. 43 19.3 Random Samples – Population A population is defined as a collection of objects, elements, or all of the possible outcomes a variable can assume. A population may be: Infinite in number, or Finite. A population is characterized numerically by the population parameters. 44 19.3 Random Samples: Population Parameters Just as a random variable, a population possesses (numerically) a: Mean , Variance 2. In practice, we can define the population, but probably do not know the true mean and variance of the population. 45 19.3 Random Samples: Inference In the area of applied statistics, one usually samples from the defined population in order to make inferences concerning the population. There is always uncertainty present when one samples from a parent population. This is why the area of probability is usually studied before one studies statistics. 46 19.3 Random Samples: Key Relationships The diagram below presents an overview of the relations between: Populations, probability, a sample, and statistics. Probability Sample Population Statistics Ref: Probability and Statistics for Engineering and the Sciences, 4th Edition, Jay Devore (Duxbury), p. 3. 47 19.3 Random Sample: Point Estimate In many cases we assume certainty. We supply a point estimate of the parameter in question. A point estimate is a sample of size 1 taken from the specified population. An analysis under “certainty” is essentially applying a point estimate, which is a sample of size 1. 48 19.3 Random Sample If we research the parameter of interest and make another estimate, then we have: The original estimate and, A second estimate: So that we now have a sample of size 2. A point estimate is then: The most likely value we perceive at the time of the estimate, or a mean value estimate. 49 19.3 Random Sample A population is comprised of two or more outcomes (values). The population mean, , is: N x i 1 N i Often, we attempt to estimate from a sample drawn from the population. 50 19.3 Random Sample A random sample of size n is the selection – in a random fashion – of n values from the specified population. Random means the sampling procedure assumes or requires that every element in the population has an equally likely chance of being in the sample. 51 19.3 Random Sample: Variability We assume that the values that make up a population are not all the same value. The values perhaps are all different, or mostly so. Thus, a population possesses a concept termed: Variance 52 19.3 Variance of a Population Variance of a population is a measure of the dispersion of every element in the population from the mean value of the population. If all of the values in the population are numerically “close,” then the variance will be “small.” If the values are not all close, then the associated variance will be “larger.” 53 19.3 Variance – Defined for a Population Variance of a population – denoted as Var(X) computationally, is: N 2 (x i ) 2 i=1 N Squaring the term in ( ) removes the effects of negative signs in the summation. 54 19.3 Population Variance N 2 2 (x ) i i=1 N The variance is the sum of the squared deviations about the population mean. Small deviations generate a smaller variance: Large deviations generate a larger variance. 55 19.3 Concept of Variance and Sampling We sample to learn something about the specified population. We can use sample results (mean, variance,…) as estimates of the random variable in question. Large sample sizes (say 30 or more) yield more precision in an estimate as opposed to small samples (under 30). 56 19.3 Random Sample: Simulation One “samples” from a population to either draw inferences about the population, or: To simulate the population. Simulation is the art and science of generating artificial data from one or more random variables using statistical sampling techniques. 57 19.3 Sampling and Variability If a population possesses a high degree of variance among its members, then: Samples drawn from that population will likely possess high variance: High variance inhibits precise estimates; The higher the variability of a population the less reliable sample estimates will be. Variability is a key factor is estimation. 58 19.3 Reviewing the Uniform Distribution Assume a uniform distribution where A = 0 and B = 1. The mean of the {0,1} uniform is 0.5 59 19.3 Generating Uniform {0,1} Random Numbers The Uniform Distribution – U{0,1} – is, by far, the most widely used distribution in all of statistics. Numerous software programs in a variety of languages have been written to generate random numbers from 0 to 1. Excel supports a random number function generator. 60 19.3 Random Sample Excel’s RAND Function RAND( ) Remarks To generate a random real number between a and b, use: RAND()*(b-a)+a If you want to use RAND to generate a random number, but don't want the numbers to change every time the cell is calculated, you can enter =RAND() in the formula bar, and then press F9 to change the formula to a random number. Ref. Microsoft’s Excel Help Data base. 61 19.3 Excel’s RAND Function By marking and dragging the top cell down, Excel will generate a different random number in each cell. 62 19.3 Random Numbers Other Than {0,1} Excel supports the RANDBETWEEN function. RANDBETWEEN(bottom,top) Bottom is the smallest integer RANDBETWEEN will return. Top is the largest integer RANDBETWEEN will return. 63 19.3 RANDBETWEEN Function Formula Description: (Result)=RANDBETWEEN (1,100) Returns a uniformly distributed number between 1 and 100 64 19.3 RANDBETWEEN Function Formula Description: (Result)=RANDBETWEEN (1,100) Returns a uniformly distributed number between 1 and 100 65 19.3 RANDBETWEEN Function – Example 66 19.3 Sampling from a Discrete Distribution Our objective is to initiate simulating outcomes from a discrete probability distribution. We apply a process known as the: Inverse Transform Method. This is part of a process known as: Monte Carlo Sampling Derived from the development of the atomic bomb in 1943 – 45 in the U.S. 67 19.3 Simulating from a Discrete Process First, one defines the probability distribution set: Use Example 19.4 Given a discrete probability set with three possible outcomes: { 24, 30, and 36). 0.20 N = 24 P ( X N i ) 0.50 N = 30 0.30 N = 36 68 19.3 Example 19.4: Step 1 Generate the pdf and cdf. PDF CDF 69 19.3 Example 19.4: Step 2 Using the CDF, fix a sample size. Assume “n” = 10. Generate 10 U{0,1} random numbers. Assume the 10 numbers are as shown in Example 19.4 70 19.3 Example 19.4: 10 Uniform RN’s Sample No. Random Number 1 45 2 44 3 79 4 29 5 81 6 58 7 66 8 70 9 24 10 82 • Next, “map” the RN onto the CDF to observe the outcome for that random number. • The RN is located on the y-axis: Project over to the CDF curve, then down to the x-axis and read the associated outcome. This is called the inverse transform method. 71 19.3 Example 19.4: First RN = 45 First RN = 45 (Assume 0.45) Observe the outcome as N = 30 months 72 19.3 Example 19.4: Continue With Other RN’s 73 19.3 Summary of Outcomes for n = 10 From example 19.4, the 10 “simulated” outcomes are shown on the next slide. 74 19.3 Summary of Outcomes for n = 10 Sample No. Random Number Simulated Outcome 1 45 30 2 44 30 3 79 36 4 29 30 5 81 36 6 58 30 7 66 30 8 70 36 9 24 30 10 82 36 The simulated outcomes are proportional to the originally assigned probabilities. 75 19.3 Sample Size Questions A sample of size 10 is not sufficient to perform a reasonable simulation analysis for a real-world problem. In simulation modeling of cash flows, sample size is a critical issue. Obviously, larger sample sizes are better (provide more information and better approximate the situation being evaluated). 76 19.3 Sample Statistics for n = 10: Example 19.4 Sample No. 1 2 3 4 5 6 7 8 9 10 Mean Var Std-Dev Outcome 30 30 36 30 36 30 30 36 30 36 32.40 9.60 3.10 From a sample of size 10, the sample mean is 32.40 with an associated variance of 9.60. 77 19.3 Continuous Process If the process under study is considered “continuous,” then the associated pdf and cdf must be generated. Assume a continuous uniform distribution to illustrate. Use Example19.3, Client 1’s data. Est. low cash flow: $10,000 Est. high value: $15,000 Mean = (10 + 15)/2 = 12.5 ($12,500) 78 19.3 Sampling from a Continuous Uniform Graphical Approach: Fix the sample size (use 10 again). Generate 10 U(0,1) random numbers. Generate the CDF for the uniform and plot. Similar Procedure as the discrete case. The pdf and cdf for the uniform are presented on the next slide. 79 19.3 PDF and CDF for the Uniform (10,15) We “sample” always from the CDF! “Map” the RN over to the CDF curve. Generate a U{0,1} random number. Project down to x-axis for the outcome. 80 19.3 For Example 19.4: Client 1 Assume the RN is “45.” This can be interpreted as 0.45. Locate 0.45 on the y-axis; Project to the right to intersect the CDF curve; Then project down to the x-axis to read the associated outcome for y = 0.45. 81 19.3 Example 19.4: Using the Uniform CDF RN = 0.45 outcome given RN = 0.45 is X = 12.5. This would be the first outcome for the first sample. Repeat for all other RN,s. 82 19.3 Random Number Generation Excel and all other simulation software support the generation of uniform random numbers. A U(0,1) random number generator (software program) will generate a sequence or stream of random numbers between 0 and 0.99999. “0” and “1” cannot be generated due to software and floating point arithmetic associated with digital computers. 83 19.3 Question of Sample Size For simulation of cash flows using computer software, the sample size can be virtually as large as the analyst desires (10,000 or more is not uncommon). Sampling is based upon: The Law of Large Numbers, and The Central Limit Theorem of statistics. 84 19.3 Sample Sizes Small samples – less than 30 Apply the t-distribution from statistics. Large Sample sizes – 30 or more. Simulation studies – 1,000 to 20,000 per run are not uncommon and take very little computer time. Obviously, the larger the sample the greater the reliability of the use of the values. 85 ENGINEERING ECONOMY Fifth Edition Blank and Tarquin Mc Graw Hill CHAPTER 19 19.4 EXPECTED VALUE COMPUTATIONS FOR ALTERNATIVES 86 19.4 Expected Value Given a random variable – X. Two important properties: Expected Value of X; denoted E(X). Variance of X. denoted Var(X). IF the entire population was known and available, then all parameters could be calculated directly! 87 19.4 Why Sample? One samples from a population in an attempt to estimate some property or value of a true but unknown population parameter. Thus, random samples are drawn or generated from the population in question to estimate, say, a population parameter. 88 19.4 Common Estimators Given a population with population parameters: – the population’s mean value; 2 – the population’s variance. We focus on estimating the mean value – – of a population. 89 19.4 Notation Concerns We focus on two sets of notation: Set 1: Population Parameters Denoted by Greek symbols - Population mean; 2 - population variance; - population standard deviation. Set 2: Sample Estimators X Mean of a sample of size “n.” s2 – Sample variance s – Sample standard deviation 90 19.4 Expected Value (Operation) Expected Value is the long-run expected average if the variable is samples from a large number of times. Estimating a population mean – . X i P( X i ) if X a discrete random variable. E ( x) 91 19.4 Mean of a Sample of Size “n” Sample mean Take or extract a sample of size “n” from a population. We require that the sample be “random” – every element in the population has an equally likely chance of being selected: If not, the sample is “biased.” Compute the sample mean value… 92 19.4 Sample Mean Value: X-bar The mean of a sample of size “n” is: n X x i i n 93 19.4 The Sample Mean Measure of central tendency of a set of values. The sample mean X is termed an unbiased estimator of the population mean – .. Unbiased means: E( X ) 94 19.4 Sample Mean Thus, a sample of sufficient size is taken, say 30 or more: The sample mean is calculated from the sample data: The sample mean, X, is then used as a point estimate of the true but unknown population mean value, . 95 19.4 Unbiased Estimator An estimator or the process of calculating the estimate should: Provide a numerical result that is close to the population parameter being estimated. Not “biased” in any way. The mean of a sample of size n is termed an unbiased estimator of the population mean. This is why a sample mean is often used as a reliable “point” estimator. 96 19.4 Other Measures of Central Tendency Mean – already been discussed. Mode: The value that most frequently occurs in a population or in a sample. The mode is a biased estimator of the population mean. Median: The value where 50% of the observations occur below the median value and 50% occur above the median value (biased estimator). 97 19.4 Measures of Variability Variance of a population: N 2 (x ) i 2 i=1 N 98 19.4 Standard Deviation of a Population The standard deviation of a population; Denoted as is: N (x i ) 2 i=1 N 99 19.4 Variance: Notes 2 = Var(X); X 2 X Var(X) 100 19.4 Sample Variance and Standard Deviation Sample of size “n.” s 2 (X s s i X) n 1 2 101 19.4 Computational Form of the Variance An alternative form for computations of a sample variance is: s 2 X 2 n 2 X n 1 n 1 i 102 19.4 Sample Variance and Standard Deviation Sample of size “n.” s 2 (X i X) n 1 Note: The variance is the sum of the squared distances 2 (deviations) that each variable in the sample is from the mean value of the set. The divisor (n-1), is required to permit s2 to be an unbiased estimator of 2 . s s 103 19.4 Combining the Mean and the Variance It is customary to refer to the following values above and below a mean value. X (t )(s) Where “t” is usually equal to { 1, 2, 3 } 104 19.4 t = 1, 2, 3: In most engineering economy applications we will find: Virtually all of the sample values in the sample will be within 3 standard deviations of the mean value of the sample. For the normal distribution (Example 19.10) we will find that well over 99% of the normally distributed values will be within 3 standard deviations of the mean value of the sample. 105 19.4 Sample Distributions Different means and standard deviations illustrated. 106 19.4 Example 19.5 Utility bills from two different populations (North American Data) Sample No. 1 2 3 4 5 6 7 Mean X 40 66 75 92 107 159 275 116.29 (x-xbar) -76.29 -50.29 -41.29 -24.29 -9.29 42.71 158.71 Sum Sq'd Dev. 5819.51 2528.65 1704.51 589.80 86.22 1824.51 25190.22 37743.43 107 19.4 Example 19.5 Utility Bills from two different populations (Asian Data) Sample No. 1 2 3 4 5 Mean X 84 90 104 187 190 131.00 (x-xbar) -32.29 -26.29 -12.29 70.71 73.71 Sum Sq'd Dev. 1042.37 690.94 150.94 5000.51 5433.80 12318.55 108 19.4 Comparisons… The dispersion of the data for the Asian sample is smaller that that of the North American sample. Analysis from Excel is shown on the next slide… 109 19.4 Comparing the Two Samples North American Sample X No. 1 40 2 66 3 75 4 92 5 107 6 159 7 275 Mean 116.29 Var 6,290.57 StdDev 79.313123 Max 275 Min 40 Range 235 • The variance of the NA sample is larger than the variance of the Asian sample. • Note: The Range (Max – Min) for the NA sample is also higher. • The NA sample contains more variability than the Asian sample. Asian Sample No. 1 2 3 4 5 Mean Var StdDev Max Min Range X 84 90 104 187 190 131.00 2,809.00 53 190 84 106 110 19.4 Deviation Ranges for Example 19.4 Examine: (1)(s) and (2)(s) “bands” for the NA data. Standard deviation for NA: 79.31 Sample mean: 116.29 X 1s 116.29 (1)79.31 $36.98 to 195.60 Six out of seven data values fall in this range, or 85.7%. X 2s 116.29 (2)79.31 -42.33 to 274.91 111 19.4 Dispersion for Both Samples (Fig 19-9) 112 19.4 Continuous Functions: Summarization Continuous PDF’s: Replace summations with integrals; Over the defined range of the random variable in question. Let R represent the defined range of the specific pdf. P(X) is replaced by the differential element f(x)dx. 113 19.4 Key Relationships for Continuous RV’s If the random variable is described by a continuous function, the following relationships hold: E(X)= X(0.2)dX = R 0.1X 2 15 10 = 0.1(225 - 100) = $12.5 E(X) = = $12.5 114 19.4 Var(X): Continuous Uniform The variance of the continuous uniform is: Var(X) = X (0.2)dX-12.5 = 2 2 R 0.2 3 X 3 15 (12.5) 2 10 = 0.06667(3375 - 1000) - 156.25 = 2.08 X 2.08 $1.44 115 19.4 Summary For a continuous Uniform{10,15}; Then mean = $12.5; The variance is 2 = Var(X) = 2.08 The standard deviation = $1.44 Thus, the mean for U{10,15} = $12.5 and the variance = 2.08. 116 19.4 Next… The next section presents an overview of a fundamental simulation methodology termed, Monte Carlo Sampling and… introduces basic Simulation of cash flows. 117 ENGINEERING ECONOMY Fifth Edition Blank and Tarquin Mc Graw Hill CHAPTER 19 19.5 MONTE CARLO SAMPLING AND SIMULATION ANALYSIS 118 19.5 Monte Carlo Sampling Monte Carlo Sampling is a traditional approach (method) for generating pseudorandom numbers to sample from a prescribed probability distribution. Pseudo-random refers to the fact that a digital computer can generate approximate random numbers due to fixed word size, and can round off problems. 119 19.5 Monte Carlo Sampling Requires: The CDF of the assumed pdf; A uniform random number generator; Application of the inverse transform approach. Why require the CDF? The y-axis of a CDF is scaled from 0 to 1. That is the same as the range of U(0,1). Facilitates mapping of an RN to achieve the outcome value on the x-axis. The U(0,1) selects a X-value from the CDF. 120 19.5 Monte Carlo Sampling Illustrated Cumulative Probability A U(0,1) R. N. Xj 121 19.5 Simulation Using Monte Carlo Sampling Formulate the economic analysis: The alternatives – if more than one; Define which parameters are “constants” and which are to be viewed as random variables. For the random variable(s), assign the appropriate PDF: Discrete and or continuous. Apply Monte Carlo sampling – a sample size of “n” where it is suggested that n 30. Compute the measure of worth (PW, AW,…) Evaluate and draw conclusions. 122 19.5 Simulation Assumptions It is assumed that: All parameters are independent; The value of a given parameter in no way impacts or influences the value of another parameter. This is termed: The property of independent random variables. 123 19.5 Example 19.7: Overview System 1 Two alternative systems ( i = 15%/yr.); System 1 P = $12,000, no salvage value. n1 = 7 years; No annual net revenue is offered. Considered a “high risk” venture. Assumption: NCF1-5 modeled by a continuous U(-$4,000, +$6,000) – analyst's best guess. Certainty: P = $12,000 and n = 7! 124 19.5 Example 19.7: Overview System 2 System 2 P = $8,000, no salvage value. Annual net revenue = $1,000 for each of the first 5 years; But after 5 years, no guarantee of future revenues. Equipment updates may be useful up to 15 years – BUT, the exact number of years is unknown. Cancel any time after 5 years. 125 19.5 Example 19.7: Overview System 2 Variable Assumptions: P2 = $8,000; NCFG = $1,000 first 5 years; NCF2 years 6, 7, … assumed to follow: Discrete uniform($1,000 to $6,000) in $1,000 increments. N2 after t = 5 assumed to be continuous U(6,15) 126 19.5 Define the Random Variables System 1: NCF1 = U(-4000,6000) System 2: NCF2: DiscreteU(1000,6000) =1000 System 2: n2 U(6,15) 127 19.5 Systems 1 & 2 PW Formulations PW1 = -P1 + NCF1 (P/A,15%,n1) [19.17] PW2 = -P2 + NCFG(P/A,15%,5) + NCF2(P/A,15%,n2-5)(P/F,15%,5) [19.18] • Terms in represent varying parameters. • NCFG = the guaranteed cash flow for System2 128 19.5 Summarizing: Analytical Setup PW1 = -12,000 + NCF1(P/A,15%,7) = -12,000 + NCF1(4.1604) [19.19] PW2 = -8000 + 1000(P/A,15%,5) + NCF2(P/A,15%,n2-5)(P/F,15%,5) = -4648 + NCF2(P/A,15%,n2-5)(0.4972) [19.20] At this point – Design a spreadsheet model to conduct a simulation for, say, n = 30 samples. 129 19.5 Example 19.8: Spreadsheet Model Simulate NCF1 First 5 Values Shown… C D E =RAND()*100 Sample No 6 7 8 9 10 1 2 3 4 5 RN1(100) NCF1-$ 12.5625 0.5158 12.0306 73.8529 30.3512 -$2,800 -$4,000 -$2,800 $3,300 -$1,000 =INT((100*$C74000)/100)*100 Important Note: The values shown in this simulation may not match the values shown in Figure 19-12 due to inability to generate the same exact sequence of U(0,1) used in the text. 130 19.5 Generating NCF2 NCF2 = DiscUniform{1,000,6,000,=1,000} Six possible outcomes; {1,000,2,000,3,000,4,000,5,000,6,000} P(each outcome) = 1/6 =0.1667 The categories will be as shown on the next slide… 131 19.5 NCF-2 CDF Assignments RN from-to NCF2 will Equal…. 00 – 16 $1,000 17-32 $2,000 33-49 $3,000 50-66 $4,000 67-82 $5,000 83-99 $6,000 132 19.5 Generating NCF-2 in Excel In Excel this will require a complex IF statement to slot the generated RN into the appropriate outcome value. We will apply a Nested IF construct. F G Sample No. RN2(100) 6 7 8 9 10 1 2 3 4 5 83.6176 26.5754 18.6240 27.0229 13.4377 H NCF2-$ $6,000 $2,000 $2,000 $2,000 $1,000 =IF($G7<=16,1000, IF($G7<=32,2000,IF($ G7<=49,3000,IF($G7 <=66,4000,IF($G7<=8 2,5000,IF($G7<=100, 6000,6000) 133 19.5 Generating n2 The random variable – n2, represents the time period in years AFTER t = 5. We know that System 2 will have at least a 5-year life, but could go up to as much as 15 years. We need to simulate the number of years after t = 5, and then apply the (P/A, n2-5) to come back to t = 5. See [19.18, 19.20] 134 19.5 “n2” Analysis: The PDF The n2 random variable is defined as: Continuous Uniform{6,15} f(x) = 1/(16-9) = 1/9 = 0.1111 Mean = 10. 135 19.5 The CDF for n2 X = 15 136 19.5 Generating n2 Life We use the CDF for the uniform. Specific problem of the CDF is: F(X) = (x-Low)/(High – Low); F(X) = (X -6)/(15-6); F(X) = (X-6)/9. Set F(X) = a U(0,1) say, RNj Then, RNJ = (X-6)/9; (solve for X). X = 9(RNJ) + 6. (returns the additional life after 5 years) 137 19.5 Generating n2 Life… X = 9(RNJ) + 6. (returns the additional life after 5 years given the j-th random number) =RAND() Cell Equation: 6 7 8 9 10 I J K Sample No. RN3 0.556 0.406 0.527 0.295 0.699 N-yrs 1 2 3 4 5 =INT(((9*J7)+1) +6) 12 10 11 9 13 138 19.5 Example 19.8: Computing the PV’s If “n” = 30, then 30 individual present values will be computed over the different simulated lives (System 2) and the varying cash flows. From the 30 PV results, we determine how many out of 30 generate a positive PV and how many generate a negative PV. Calculate the percentages out of 30 that have a positive present value for each alternative. 139 19.5 Excel’s PV Function Dialog Data Entry The “PV” function will be used to compute the associated present values. 140 19.5 The “Random Number” Worksheet C Sample No 6 7 8 9 10 1 2 3 4 5 D E F G H I RN1(100) NCF1-$ RN2(100) NCF2-$ N-yrs 12.5625 82.0129 37.4472 89.9367 89.7730 -$2,800 $4,200 -$300 $4,900 $4,900 83.6176 91.9930 84.3865 81.1570 64.2324 $6,000 $6,000 $6,000 $5,000 $4,000 RN3 0.556 0.513 0.429 0.741 0.088 12 11 10 13 7 The above shows the first 5 out of 30 samples for NCF1, NCF2 and N for System 2. These values will not compare to the values in Figure 19-12 due to a different sequence of RN’s that were generated by Excel. 141 19.5 Spreadsheet Design For this example: One workbook with, Two spreadsheets: Sheet 1 is named “Random Numbers” Sheet 2 is named “PW Values” Sheet 2 summary calculations will refer to certain values in the “Random Numbers” spreadsheet and to values in the “PW Values” spreadsheet. 142 19.5 Design Overview for the Model Sheet 1 “Random Numbers” contains the simulated values as specified by the problem statement. Sheet 2 “PW Values” Calculates the 30 PW values for the two systems and summarizes. Sheet 2 contains the 30 calculated PW values by referencing data in Sheet 1: Summary results are then presented in Sheet 2. 143 19.5 Calculation of 30 PW’s Input Parameters Input Parameters for the Alternatives System 1,P1 $ 12,000.00 System 2, P2 $ n 7 yrs NCF $ MARR 15% MARR 8,000.00 1,000.00 15% 5 Yrs 144 19.5 Simulation Analysis: Results Sample No. PW - Sys 1 1 -$23,649 2 -$9,504 3 -$351 4 -$21,153 5 -$26,561 29 $65 30 $481 Present Worth Calculations + Sample No. 0 1 1 0 1 2 0 1 3 0 1 4 0 1 5 1 0 29 1 0 30 11 19 36.67% 63.33% (+) (-) PW - Sys. 2 $7,763 -$3,031 $2,045 $97 $2,163 $6,507 -$511 Counts (+) (-) 1 0 0 1 1 0 1 0 1 0 1 0 0 1 21 9 70.0% 30.0% (+) (-) The first five samples and the last two are shown above for a given sequence of RN’s. 145 19.5 Analysis for Current Sequence of RN’s Sample No. PW - Sys 1 1 -$23,649 2 -$9,504 3 -$351 4 -$21,153 5 -$26,561 29 $65 30 $481 Present Worth Calculations + Sample No. 0 1 1 0 1 2 0 1 3 0 1 4 0 1 5 1 0 29 1 0 30 11 19 36.67% 63.33% (+) (-) For this run, 36.67% of the generated PW’s for System 1 were positive and 63.63% were negative. PW - Sys. 2 $7,763 -$3,031 $2,045 $97 $2,163 $6,507 -$511 Counts (+) (-) 1 0 0 1 1 0 1 0 1 0 1 0 0 1 21 9 70.0% 30.0% (+) (-) System 2: 70% had a positive PW and 30% were negative. 146 19.5 Final Comments The results shown on the previous slide were from a given sequence of RN’s. The spreadsheet can be recalculated and a different sequence of RN’s will be generated. The % positive and % negative will change from run to run – as expected. 147 19.5 Conclusions Based on Current Run From a sample of size 30: System 2 presented a greater percentage of positive present worth over the percentage of positive present worth for System 1. This could lead one to believe that System 2, over the long run, is the better alternative. Suggest going with System 2! 148 19.5 The Normal Distribution Popular Distribution. Continuous pdf. Often referred to as the “Bell-Shaped Curve.” Applicable to a large number of physical applications. See Figure 19-15… 149 19.5 Different Normal Distributions Different means with equal variance. Different means with different variances. The Standard Normal with mean = to 0 and variance = 1. 150 19.5 PDF for the Normal The distribution function for the normal is: PDF: 2 1 ( X X ) f (X ) exp 2 X 2 2 X Note: There is no direct way to generate normally distributed random numbers using the inverse transform. Other approaches must be used. 151 19.5 The Standard Normal Distribution Calculate a “Z” value as: X X Z s [19.22] Where X-bar is the sample mean and s is the sample standard deviation, Z is normally distributed with a mean of 0 and a variance of 1. 152 19.5 Difficulties in Simulating Generating random numbers that follow a normal distribution are involved if one is using Excel. Most spreadsheets do not support a normal random number generator. Other methods must be used (refer to texts on simulation and the generation of random numbers from a prescribed normal). 153 19.5 Variation Ranges for the Normal Variable X Range Probability Variable Z Range + 1 0.3413 0 to +1 1 0.6826 -1 to +1 + 2 0.4773 0 to +2 2 0.9546 -2 to +2 + 3 0.4987 0 to + 3 3 0.9974 -3 to +3 154 19.5 Beware! When using the normal distribution with a mean close to 0, it is possible to generate a negative outcome. This may not be applicable to the problem at hand. Some software systems provide a “truncated normal,” where you can specify a lower and/or upper cutoff point. 155 ENGINEERING ECONOMY Fifth Edition Blank and Tarquin Mc Graw Hill CHAPTER 19 Chapter Summary 156 19. Summary To perform decision making under risk implies that some parameters of an engineering alternative are treated as random variables. Assumptions about the shape of the variable's probability distribution are used to explain how the estimates of parameter values may vary. Additionally, measures such as the expected value and standard deviation describe the characteristic shape of the distribution. 157 19. Summary In this chapter, we learned several of the simple, but useful, discrete and continuous population distributions used in engineering economy–uniform and triangular–as well as specifying our own distribution, or assuming the normal distribution. 158 19. Summary Since the population's probability distribution for a parameter is not fully known, a random sample of size n is usually taken, and its sample average and standard deviation are determined. The results are used to make probability statements about the parameter, which help make the final decision with risk considered. 159 19. Summary The Monte Carlo sampling method is combined with engineering economy relations for a measure of worth such as PW to implement a simulation approach to risk analysis. The results of such an analysis can then be compared with decisions when parameter estimates are made with certainty. 160 19. Summary Simulation analysis is a powerful tool when properly applied. One must be fully versed in applied statistics and modeling. Several Excel add-ins are on the market to simplify sophisticated simulations of engineering economy problems. Example: Palisade Corporations “@RISK” Excel add-in, and “Crystal Ball” are popular additions to Excel. 161 19. Summary Simulation modeling is a valuable tool to assist in the analysis of engineering economy problems where risk is an important consideration. Simulation is widely used in the petrochemical, manufacturing, aerospace, and other prominent industrial sectors. 162 ENGINEERING ECONOMY Fifth Edition Blank and Tarquin Mc Graw Hill CHAPTER 19 End of Set 163