Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) Part I: Design Stage I. Define the system objectives and list any requirements. a. The system objectives state the purpose of the design. b. Requirements include any task the system or design must perform as well as any constraints such as a budget or schedule. II. Define an option space or possible design configurations. a. Select a few options to analyze. Since an option can include an infinite number of choices, it is feasible to analyze the most likely choices. (Note: However, this process may lead to a sub-optimal choice.) b. Define the parameters of each option i.e. the numerical quantities that specify design elements. Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Define the system objectives and list any requirements: Suppose you need to select the I-beam that best fulfills the following requirements: o Member is constructed from aluminum o I-beam is simply supported at both ends o I-beam is uniformly loaded with a distributed force equal to 3775 N/m o I-beam cannot deflect any more 0.60mm Page 1 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) The setup: Parameters: Cross Section of I-Beam Page 2 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) Part II: Evaluation Measures (EMs) I. Based on the design objectives and requirements, create a list of evaluation measures for your system. a. An evaluation measure is a numerical quantity that allows one to grade some aspect of the design. b. It is important that the evaluation measures are independent, meaning that two measures do not evaluate the same quality or a combination of the same qualities. II. Define the details of each evaluation measure. a. Is the EM deterministic or probabilistic? i. A deterministic EM is one whose values are fully expressed as one number. (For Example: The safety rating of a car is 4 stars out of 5.) ii. A probabilistic EM is one whose values are expressed as a range. (For Example: The length of a beam can be 2 meters +/- 10 cm.) b. Result: i. If the EM is deterministic, determine if higher option values are more favorable. ii. If the EM is probabilistic, also determine if higher option values are more favorable. Next, determine the risk inclination. 1. There are 3 risk states, risk averse, risk neutral and risk seeking. After selecting a risk inclination determine the extent of the risk inclination, rho or “ρ.” If one is risk averse then ρ is positive and if one is risk seeking then ρ is negative, and if one is risk neutral then ρ= infinity. As a general scale for ρ, a value of 5 is moderate and a value of 1 is extreme. This value must then be de-normalized (multiplied by the range of the EM: High-Low). For further details reference the graphs below which display the affect of one’s risk inclination (rho) on the utility value: Page 3 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example List Evaluation Measures: The evaluation measures for this decision will include Cost Deflection Evaluation Measure Description: Cost is a deterministic EM since the price per beam will be used in the analysis. For cost a lower option value is more preferable. Deflection is a probabilistic evaluation measure. Since there are tolerances in the beam’s dimensions, the performance of each beam needs to be simulated. For deflection a lower option value is more preferable. o For deflection this example will be risk averse with a rho=5. ________________________________________________________________________ CHECKLIST: Before proceeding be sure to have the following information: Options with parameters Evaluation Measures and details including: o Deterministic / Probabilistic o Value preference (are higher or lower option values more preferable?) o Risk Inclination ________________________________________________________________________ Page 4 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) Part III: Evaluation Measure Details I. If an EM is probabilistic then that particular factor of the design needs to be modeled as a random variable. To complete this step a simulation must be performed to determine the distribution. To find the distribution of the EM: a. Open MATLAB and change the working directory to where EQUATION.M and LOOPY.M are saved. b. Open “EQUATION.M” and using this file define the variables that make up the equation which determines your EM. Then set the result vector, RV, equal to that equation. Be sure to save the file under a new, descriptive title. (YOURTITLE.M) Note: MATLAB is case-sensitive. It is important to note the order of the variables because the same order will be used in the simulation. See comments in EQUATION.M. Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example 5 Load Length 4 384 Youngs MomentI (Youngs = Young’s Modulus and MomentI = moment of inertia) The equation to determine the deflection of the beam is Due to the complexity of this equation it will be broken down into two equation files. One will determine a distribution for MomentI since the moment of inertia is a value determined by multiple dimensions from the beam’s cross section. The second equation will compute the rest of the deflection equation as a distribution. Then both distributions will be combined which yields the deflection distribution. Equation File One: Moment of Inertia Equation File Two: Loading Page 5 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) ________________________________________________________________________ c. Run “LOOPY.” Loopy is the MATLAB program that models the variables defined in the Equation file as distributions using the Monte Carlo Method. You will be asked: 1. “How many Variables?” The answer is equal to the number of variables previously defined in “YOURTITLE.M.” (In Loading.m, number of variables = 2) 2. “How many Simulations?” 10,000 to 100,000 Monte Carlo simulations will return satisfactory results. 3. “How many bins?” After each variable is simulated a histogram of that variable appears so that you can check that the variable was correctly modeled after the desired distribution. The “bins” refers to the number of bars plotted in the histogram. 50 bins will usually produce satisfactory results. Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Below is a list of the prompts from “LOOPY” ________________________________________________________________________ Next, a menu bar of the available distribution types will appear. Select the desired distribution. Then “LOOPY” will prompt you to input information required to define that distribution. Enter this information Page 6 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) and then press ENTER. A histogram of the random variable will appear. View the graph then press ENTER to continue modeling the remaining variables. After all simulations have been run, “LOOPY” will prompt you to type the name of “YOURTITLE.M.” In single quotes type the name of the equation file saved (without the ‘.M’) and then press ENTER. A final histogram of the result will be displayed for the option. Set the Option name to equal RV (Option1=RV) press ENTER. Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example For deflection you will need to run the loopy program twice for each option. For this example, the normal distribution will be used to model the variables. A normal distribution will ask you to input the mean and the standard deviation of your variable. The nominal value will be input as the mean and the +/- tolerance divided by two will be the value for the standard deviation. Thus, if you are simulating the length of the beam the mean value equals 3m and the standard deviation equals 0.02m or (0.04 / 2). (See values from page 2 for further details) o The first loopy run will be used to compute the moment of inertia for the beam. Follow the instructions and input the appropriate information. Next type “Moment1=RV;” and this will set the distribution of the moment of inertia equal to the title Moment1 or the moment of inertia for option 1. o Next run loopy again except use it to compute the load portion. After loopy is complete set “Load1=RV;” and this will set the load portion of the deflection equal to the title Load1 or Load of option 1. o Finally, type “Deflection1=Load1./Moment1;” and this step will complete the deflection equation thus returning a distribution for the deflection of the option. (See README_MATLAB for an explanation of the “.” operator.) o Type “hist(Deflection1,50);” and a histogram of the distribution will be plotted with 50 bins and it should look similar to: Page 7 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) ________________________________________________________________________ d. Perform the “NORMFIT” function on the simulated option. Using this syntax: [mu,sigma,muci,sigmaci] = normfit(RV,alpha), choose a confidence level (95% conf= 0.05=alpha); this function will return four items: i. mu: the mean of your sample distribution ii. sigma: the standard deviation of your sample distribution iii. muci: the max and min the mu is restricted to, dependant on your confidence level. iv. sigmaci: the max and min the sigma is restricted to, dependant on your confidence level. For further details simply type “help normfit” at the MATLAB prompt. Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Normfit Results for Option 1 Repeat this process again to obtain the deflection distribution and normfit information for the other options. ________________________________________________________________________ Page 8 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) e. Using the information from “NORMFIT” and your risk inclination chose a Certainty Equivalent for your option. The certainty equivalent is a pseudo expected value for a distribution that has been adjusted based on one’s risk inclination. For example, if the given distribution is for deflection and the mean is 1.0mm and less deflection is preferable, then the certainty equivalent for someone who is risk averse could be 1.3mm. Likewise, for the same distribution, if the person is risk seeking then his certainty equivalent may be 0.8mm. One way to determine the certainty equivalent is to use the muci values. If higher values are more preferable for the EM and you are risk averse then you might want to choose the lower of the two muci values to be on the safe side. f. Select a HIGH and a LOW limit for the evaluation measure. HIGH is the largest acceptable value for the EM and likewise LOW is the smallest acceptable value. This range must encompass all of your option scores. Any option that does not fall between the HIGH and LOW values may be discarded. Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Continuing with Option 1 … The Certainty Equivalent for deflection will be taken from the muci information. Since the example is risk averse the higher of the two muci values will be used as the certainty equivalent. Certainty Equivalent = 0.0005259m (Continue on and determine a CE for each option). Select a HIGH and a LOW value for the evaluation measure o HIGH= 0.0006m o LOW= 0.00045m In addition it should be noted that since Deflection is probabilistic, the software will allow you to use the standard deviation of the deflection as an evaluation measure as. In this example the standard deviation of deflection will be used as an evaluation measure since it is important for the distribution to be tightly packed around the mean. ________________________________________________________________________ II. If an EM is deterministic: a. Select a HIGH and a LOW limit for the evaluation measure. HIGH is the largest acceptable value for the EM and likewise LOW is the smallest acceptable value. Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example For the cost evaluation measure: Select a HIGH and a LOW value for the evaluation measure o HIGH= $130.00 o LOW= $120.00 Page 9 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) ________________________________________________________________________ CHECKLIST: Before proceeding be sure to have the following information: For deterministic know the Evaluation Measure’s: o HIGH o LOW For probabilistic know the Evaluation Measure’s: o HIGH o LOW o Certainty Equivalent ________________________________________________________________________ Part IV: Determining Option Grades I. To determine the option grades, a MACRO for MS Excel will be used. Before proceeding, read the README_XL file for disclaimers. a. Begin by double-clicking on the Excel file “Decision Making Macro.” b. Next, go to the top tool bar and select: “Tools” “Macro” “Run Macro.” c. Select “CreateEMs” and click RUN. Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Page 10 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) d. Follow the instruction boxes and input the necessary information. (Have the information from the previous “Checklists” on hand to expedite this process) e. Once complete, SAVE AS the file with a new name descriptive of your project. f. Go through the newly created EM sheets and fill in the score boxes shaded in blue. All boxes that are shaded in blue must be filled in for the later macros to work properly. (Any boxes shaded in green are optional and contain only reference information to benefit the user)You should note that the Macro allows you to use sigma (standard deviation) as an evaluation measure if the EM is probabilistic. Refer to Appendix I for further details. As you input values, the grade of the options should appear in the appropriate boxes. i. The Grade of an option is a number that takes into account the option score, your risk inclination, and the range of the option. ii. For information on the exact formula used to compute the option grade, please reference appendix II. Page 11 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example g. SAVE again. h. Once all the evaluation measure information has been entered, select the “Final” sheet. i. Inputting the weights of the evaluation measures into the blue boxes: You can choose to enter the weights yourself (arbitrarily) or you can use the weight macro to guide you along. i. Before proceeding, for any EM that you do not wish to include, put 0’s (zeros) in their weight columns. ii. To run the weighting macro: “Tools” “Macro” “Run Macro.” iii. Select “WeightCalc.” iv. The Weight of an EM is a measure of how important that EM is with regard to the other EMs. v. The value of a weight is always between 0 and 1. vi. The sum of the weights of all the EMs is equal to 1. Page 12 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) vii. Below are the types of weight elicitation techniques available in the macro: 1. Direct Methods a. Each method follows these steps: i. Numerically assign a rank order to the evaluation measures. List the EMs from most important with a value of 1 to the least important. (This first step should always be performed regardless of the weight elicitation technique that you choose to employ) ii. Use one of the following formulas for assigning weights wti K ri 1 K K r j 1 j wti 1 ( K ri 1) z K (K r j 1 Rank Sum: ri is the rank of the ith EM, K is the total number of EMs j 1) z Rank Exponent: ri is the rank of the ith EM; K is the total number of EMs; z is an undefined measure of the dispersion in the weights 1 1 wti K j 1 rj 1 1 1 wt1 1 ... / K K 2 3 K wti 1 wt K 0 0 0 ... / K K 1/ ri K (1/ r ) j 1 Rank Order Centroid: ri is rank of the ith EM, K is the total number of EMs j Rank Reciprocal: ri is the rank of the ith EM, K is the total number of EMs 2. Indirect Methods a. Trade Offs: (not available in the macro) i. Rank EMs in order of their overall value ii. You are asked if overall weight of the second EM is as great as the weight from the lowest to some intermediate point of the value scale of the first EM. iii. The third EM can now be compared to intermediate points on either the first or second ranked EMs and so on… Page 13 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) iv. Method works well when the value curves are firmly established and when the value curves are continuous b. Balance Beam Approach: i. Establish a rank order of the overall weights of the evaluation measures. ii. A series of questions is posed beginning with “Is the overall weight of the first EM (a) greater, (b) less than, or (c) equal to the overall weight of the second and third EMs iii. If answer is “less than” then the third EM is dropped and replaced by the fourth EM. (If “greater than” then the fourth EM is added to the second and third ) iv. The goal is to establish a series of equations that define the weights for all of the evaluation measures. v. The least valued EM is given a weight of 1 and then you are asked to assign a weight to the second least weighted EM then this information is used to solve the system of equations vi. The results are then normalized into weights with values between 0 and 1 Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example The rank order of the evaluation measures is as follows: 1. Deflection 2. Cost 3. Deflection Deviation Remember the numbers associated with the EMs because the macro will prompt you for these values. Below is a table which includes the weights determined by all of the direct weight methods. While you only need to select one weight method the table is provided for your edification. Method Cost Deflection Sigma of Deflection Rank Sum 0.3333333 0.5 Rank Exponent* 0.341081377 0.417737668 Rank Order 0.2777778 0.6111111 Rank Reciprocal 0.272727273 0.545454545 0.1666667 0.241180955 0.1111111 0.181818182 *For Rank Exponent a dispersion value of 0.5 was used. Page 14 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) And by the Indirect Method of Balance Beam: After completing the instructions of the macro for the balance beam method the following box will appear: This message box contains the system of equations that you will use to determine the weights. Since the lowest EM is set to one go to the next equation and ask yourself how much greater Cost is than the Sigma of Deflection. For this example, Cost will equal 2. Use these values to complete the final equation which gives Deflection a value of 3. Finally, normalize these values into weights between 0 and 1. In the end: Deflection weight = 0.5 Cost weight = 0.33 Sigma of Deflection weight = 0.17 ________________________________________________________________________ j. Go to the top tool bar and select: “Tools” “Macro” “Run Macro” k. Select “MakeFinal” and click RUN. This will execute the Macro that computes the final grades for the options. i. The final grade is computed using the following equation: FinalGrade Weight i * Gradei This equation is summed over each evaluation measure. l. Save Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Using the weights from Rank Exponent, the final calculated grades are: Evaluation Measure Cost Deflection Sigma of Deflection Final Grade Weight 0.3411 0.4177 IBeam1 0.6 0.519 Weighted Grade 0.204648826 0.216799826 IBeam2 0.66 0.3535 Weighted Grade 0.225113709 0.147676309 IBeam3 0.7 0.2845 Weighted Grade 0.238756964 0.118842461 0.2412 0.7207 0.173820469 0.6238 0.150453745 0.5746 0.13859396 0.595269121 0.523243763 0.496193385 ________________________________________________________________________ Page 15 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) Part V: Sensitivity I. Now that the final grades have been determined it is important to perform a sensitivity analysis. a. A sensitivity analysis will allow you to see if you have selected a good weight value for an evaluation measure. b. The analysis works by varying the weight of one EM from 0 to 1 while adjusting the weights of the other EMs to keep their proportions the same. The final grades of each option are re-computed then graphed. c. To run the sensitivity analysis go to “Tools” “Macro” “Run Macro” d. Select “Sensitivity” and click RUN. e. For each EM a new sheet containing the sensitivity plot will be created. II. Plot Review a. The “Sensitivity Analysis” is primarily concerned with analyzing the area around the chosen weight for the evaluation measure. (If the weight of a particular evaluation measure is 0.5 then the x axis of the plot should go from 0.4 to 0.6.) Therefore, readjust both the “x” and the “y” axis for each new plot. To do so place the cursor over the axis you desire to alter and right click. A menu bar should appear and select “FORMAT AXIS”. An option box will appear and you need to select the tab titled “SCALE”. On the scale page input the minimum and maximum values for your graph that should be displayed and click “OK.” b. For each new plot look for any intersections near the chosen weight of the varied evaluation measure. c. If the plotted lines of the options intersect or are close together at the point of interest you may wish to re-evaluate your weights for a clearer decision. d. SAVE Page 16 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example Below is the sensitivity analysis plot for the Cost evaluation measure: Sensitivity of Cost 0.59 0.57 Final Option Grades 0.55 IBeam1 IBeam2 IBeam3 0.53 0.51 0.49 0.47 0.45 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 Weight of Cost Note that the x and y axes on the chart were altered to display the appropriate range of values. ________________________________________________________________________ III. Review the final grades again and take into consideration the sensitivity analysis and decide on the best option for the design. Example Example Example Example Example Example Example Example Example Example Example Example Example Example Example After reviewing the final grades and the sensitivity analysis it is clear that I-Beam 1 is the best option for the design. Page 17 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) Appendix I Standard Deviation Notations: I. For all continuous EMs, you have the option of including sigma (standard deviation) of the distribution as an evaluation measure. 1. While the Macro automatically makes a space for sigma, you can eliminate its effect by giving it a weight of zero on the “Final” page. 2. If you are unsure whether or not to include the standard deviation the following information may be helpful: a. First, it is important to realize that all designs are unique. Therefore, using sigma as an evaluation measure is situational to the specific design. (Sigma should be considered as an EM if the tolerances around the mean need to adhere to a certain restriction). b. The standard deviation may not be useful as an EM if all points of the distribution meet your set criteria… In general there are three criteria types. i. All points > X ii. All points < X iii. X<All points <Y 1. If not all points on the distribution meet your criteria, it may be more useful to consider the number of points that fail to meet the criteria as an evaluation measure instead of the standard deviation. To determine the number of points that fail to meet your set criteria use the “HISTC” function in MATLAB. (see README_MATLAB for details) Page 18 of 19 Decision Making Based on the Monte Carlo Method (and Software Instruction Guide) Appendix II I. Grade Determining Equations: a. Deterministic or Risk Neutral evaluation measure i. Higher option scores preferable: v( x) x Low High Low ii. Lower option scores preferable: v( x) High x High Low b. Probabilistic evaluation measure: i. Higher option scores preferable: v( x) 1 exp[ ( x Low) / ] 1 exp[ ( High Low) / ] ii. Lower option scores preferable: v( x) 1 exp[ ( High x) / ] 1 exp[ ( High Low) / ] Page 19 of 19