Decision Support Models @ Risk handout Simulating Spreadsheet models using @RISK 1. Step 1 1.1. Open Excel and @RISK enabling any macros if prompted 1.2. There are four on line help options available. Pull down the @RISK menu and choose the Help command. How do I answers frequently asked questions about @RISK, Online Manual is an electronic copy (PDF file) of the user s guide, @RISK Help is a searchable database of the user s guide, and PDF Help lists various facts about the probability distribution functions available in @RISK view. 2. Step 2 2.1. Build the soft pretzel spreadsheet as shown in Figure 1. Enter the numerical values for each assumption in the B column, and enter the formula (shown in the Cell C12) for Net Contribution in Cell B12. Net Contribution should equal $966.67 when finished. Figure 1: The soft pretzel example 3. Step 3 3.1. Model input variables Market Size with a normal distribution: 3.1.1. Right click when the cursor is over B5, select @RISK, and click on Define Distributions. A window pops up, titled @RISK Definition for B5, showing a normal Mónica Oliveira, MAD 2008/2009 1
distribution (Figure 2). @RISK automatically enters the current value in B5 (100,000) as the mean value; in this case, 1.0000E+05 is entered for μ (the mean). Figure 2: Defining market size (cell B5) as a normal distribution with mean 100,000 and standard deviation 10,000 3.1.2. Enter 10000 for σ (standard deviation), as shown in Figure 2. Do not enter commas when entering numbers for the parameters. You can easily delete the current entry by double clicking in the text box to highlight the number and typing in your number. 3.1.3. The @RISK definition window updates the graph of the distribution as you enter the parameter values. The formula appears in the text box above the curve. While the formula remains red and underlined, it models the distribution being displayed in the graph. 3.1.4. Do not export the formula to cell B5 in the spreadsheet, click Apply. 3.2. Next, we model Market Proportion as a discrete distribution: 3.2.1. Bring up the @RISK Definition window by right clicking when the cursor is over B6, selecting @RISK, and clicking on Define Distributions. 3.2.2. Display the list of distributions by clicking on the black triangle to the right of Normal. Slide the scrollbar up and click on Discrete. Mónica Oliveira, MAD 2008/2009 2
3.2.2.1. To enter the first x value, click the cell in the row labelled 1 below X and type in the value 0.16. Hitting enter moves the cursor into the cell to the right and directly below P. Enter the corresponding probability 0.15. 3.2.3. Hitting enter again places the cursor in the second row in the x column directly below 0.16. 3.2.4. Continue repeating Steps 3.2.3 and 3.2.4 for successive rows until you have entered the remaining three ordered pairs: (0.19, 0.35), (0.25, 0.35) and (0.28, 0.15). 3.2.5. Click Apply, and cell B6 now contains this discrete distribution. 3.3. Enter the distribution for the two remaining inputs variables by following the above steps. Specifically, set up Variable Cost as a Uniform(0.08,0.12) distribution in cell B8, where 0.08 is the minimum and 0.12 is the maximum; and Fixed Cost as a Triang(6500,8000,9000) distribution in B9, where 6500 is the minimum, 8000 is the most likely, and 9000 is the maximum. Be sure to click Apply buttons to insert the distributions into cells B8 and B9. 3.4. An alternative to the @RISK Definition window is to use Excel s function wizard. To do this, first click the f x button on Excel s toolbar, select the @RISK Distribution function category, then choose the particular distribution (e.g. RiskNormal) as shown in Figure 3. Figure 3: Excel function wizard selection window showing @risk categories 4. Step 4 4.1. Right click when the cursor is over B12, highlight @RISK, and click on Add Output. 4.2. Notice that RiskOutput() has been added to the formula for Net Contribution in the formula bar (above the columns of the spreadsheet). The word RiskOutput identifies Mónica Oliveira, MAD 2008/2009 3
B12 as an output and the parentheses provide a way to name the output cells. Place the cursor between the parentheses in the formula bar, click, and type Net Contribution (including the double quotes). @RISK will now name the output from this cell Net Contribution. Hit enter. 5. Step 5 5.1.1. Click the Run Simulation button (fourth from the right in @RISK s toolbar), and @RISK will simulate the model for 100 iterations. Figure 4 shows the @RISK Results window. The numbers in your window may be somewhat different because your particular run may have randomly chosen different input values, even though your model has exactly the distributions. Figure 4: Simulation results for the soft pretzel model 6. Step 6 6.1. In the @RISK Results window, highlight Net Contribution under Outputs in the leftmost column, right click, highlight Histogram in the pop up menu, and click on Histogram. The histogram of the Net Contribution appears in a new window, as shown in Figure 5. Notice that the expected Net Contribution ($951) is displayed over the histogram, and summary statistics, such as the standard deviation ($1891), are displayed in the right hand column. 6.2. The two delimiters (gray vertical lines overlaying the graph) are markers that allow you to determine cumulative probabilities. In Figure 5 the leftmost delimiter is at the fifth percentile as shown by the 5% in the scrollbar below the curve. This delimiter is at the x value of 2289.12 as shown below the scrollbar. Therefore, according to the model, there is a 5% probability that the Net Contribution will be less than or equal to $2289. The 90% shown in the scrollbar indicates that there is a 90% probability that the demand will be Mónica Oliveira, MAD 2008/2009 4
greater than $2289 but less than $3979. The rightmost delimiter shows that there is a 5% probability that the Net Contribution will be greater than or equal to $3979. Figure 5: Histogram of net contribution showing various summary statistics in the right hand column 6.2.1. The two delimiters can be moved to display different cumulative probabilities. Click on a delimiter bar and drag the mouse left or right while holding the mouse button down. The bar moves correspondingly. Note that the smallest increment it will move $1000. Find the probably that Net Contribution will be between 2000 and 3800. (Answer: 86%) 6.3. Clicking on the triangles to the left and right of the scrollbar below the graph also moves the bar, but this time by one percentile. Find the x values so that there is a 20% chance that Net Contribution will be below the first x value and a 20% chance that Net Contribution will be above the second x value. (Answer: $913 and $2633). 6.4. You can also type exact values for either the x value or the percentile into the spreadsheet cells located to the right of the graph. The Left X and Left P refer to the leftmost delimiter and the Right X and Right P refer to the rightmost. If you enter the x value, @RISK reports the p value and vice versa. Diff. X and Diff. P calculate the difference in the x values and p values; these cells cannot be typed in. Enter 25 for Left P and 75 for Right P. The corresponding x values are approximately $475 and $2435. Thus, there is a 50% chance that Net Contribution will be between $476 and $2435. Mónica Oliveira, MAD 2008/2009 5
6.5. You now have three different ways to calculate the break even probability: Click on the delimiter bar, click on the scroll bar, or type in zero for Left X value. Find P(Net Contribution 0). (Answer: 40%) 6.6. You have various options for formatting the graph. The buttons highlighted in Figure 5 will reformat the graph to pre specified configurations. For example, to draw the risk profile as a CDF, click on the Redraw graph as ascending cumulative line (fourth button from the right). Alternatively, you can access all the formatting option by right clicking when the cursor is over the graph, and choosing Format Graph. The functions of the tabs of the Graph Format dialog box are explained below. 6.7. The six tab along the top of the graph format dialog box accessed in step 6.7 allow you to make various alterations to the graph: 7. Step 7 6.7.1. The Type tab allows you to view either a density curve or a CDF curve. 6.7.2. The Scaling tab allows you to change the scale (the units and the max and min) of the x and y axes. 6.7.3. The Style tab allows you to change the patterns and colours of the graph. 6.7.4. The Titles tab allows you to label the axis, title the graph, and add a legend. 6.7.5. The Delimiters tab allows you to remove or modify the delimiters 6.7.6. The Variables to Graph allows you to graph multiple output distributions on one graph. 7.1.1. In the @RISK results window, click on the Simulation heading, then click on Settings. (Alternatively, in Excel, pull down the @RISK menu, select Simulation, and click on Settings) Figure 6 shows the Simulation Settings dialog box that appears. Mónica Oliveira, MAD 2008/2009 6
Figure 6: Simulation settings dialogue box 7.2. To Change the number of times the model is simulated, click the Iterations tab and type 1000 in the text box for # Iterations. 7.3. To have Excel display different inputs values, click the Sampling tab and chose Monte Carlo under the Standard Recalc heading. Click OK. 8. Step 8 8.1.1. In the @RISK Results window, the five rightmost buttons insert new windows. The leftmost button of these five inserts a summary statistics window, which we discussed above. Click on the Insert New Detailed Statistics Window. This window provides a complete array of statistics on all the output and input distributions. Scrolling down, you see that you can do such things as define scenarios and filter the data. @RISK s on line help has explanations. 8.2. Click on the Insert New Data Window. This window display the actual sampled input values along with the corresponding calculated Net Contributions Values. 9. Step 9 9.1.1. Return to your spreadsheet and enter the prices 0.40, 0.45, 0.50, 0.55 and 0.60 in cells C15 to C19. These are the five prices we might charge for the soft pretzels. 9.2. Highlight cell B7 and click on the Paste Function button (f x button) in the Excel toolbar. 9.2.1. In the Paste Function window, scroll down the Function category list (left side) until you see the @RISK categories. Select @RISK Distribution (Figure 3). 9.3. Scroll down the Function name list (right side) until you find RiskSimTable, click OK, move the cursor to the spreadsheet, and highlight cells C15 and C19. (Note: Keep the mouse Mónica Oliveira, MAD 2008/2009 7
button depressed while highlighting the range of cells so that C15:C19 is placed in the text box.) Click OK. This changes Net Contribution to ($2133.33) because Price is $0.40. 9.4. We must now modify the settings so that @RISK knows to run five simulations. Click the Settings button (fifth button from the right) and select the Iterations tab shown in Figure 6. 9.4.1. Change the # Simulations = from 1 to 5. @RISK will now run five separate simulation, the first when Price=0.40, the second when Price =0.45 and so on until Price =0.60. Click OK. 9.5. Click the Run Simulation button. 10. Step 16 10.1. The means or expected values increase dramatically as the price increases, as shown in Figure 7. For example, the expected Net Contribution equals $3176 when Price = $0.60, which is nearly the maximum Net Contribution of $3566 when Price = $0.40. Figure 7: The simulation output from running five simulations for the five input price levels using RiskSimTable 10.2. The standard deviations are found by inserting the detailed statistics window. Click on Tab 2 in the @RISK Result window and click on the Insert New Detailed Statistic Window button (fourth from the right). The fourth row of this window lists the standard deviation of all the input and output variables. The standard deviation increases as the prices increases. Thus, along with the higher expected value there is more uncertainty. 10.2.1. To calculate the break even probabilities, return to Tab 1. Find the column labelled xl= and double click on the entry in the first row (the row corresponding to Sim #1). Type in 0 and hit enter. The break even probability is displayed in the Mónica Oliveira, MAD 2008/2009 8
column immediately to the right, labelled pl=. The break even probability for our simulation run is 77%. Continue highlighting the entries in the xl= column by doubleclicking and entering 0 for the remaining price levels. The break even probabilities will decrease as the price increases. 10.3. To graph all five risk profiles, first graph a single CDF. Click on Tab 3, click on the Net Contribution under Outputs along the left, right click, choose Cumulative, and click on Ascending line. In the Graph Results pop up window, click OK. The resulting curve should be the CDF for Net Contribution (Sim #1). 10.3.1. To overlay all five risk profiles, as shown in Figure 8, do the following: Right click when the cursor is over the graph, choose Format Graph, click on the rightmost tab Variables to Graph, highlight all five variables, and click OK. Figure 8 shows that the risk profile for Price=$0.60 dominates all of the others. Figure 8: The five risk profiles for the five price levels showing that higher prices dominate lower price levels 11. Step 11 11.1. Close all worksheets so that @RISK clears the inputs by outputs table. Open a new worksheet. 11.2. Build the soft pretzel model in Figure 9. Mónica Oliveira, MAD 2008/2009 9
Figure 9: Spreadsheet that models dependence between prize and market proportion 11.2.1. Enter the distributions shown in C5 to C8 for the assumptions in B5 to B8. 11.2.2. Enter the price levels: $.30, $.40, $.50, $.60, $.70 in B12 to B16 and the corresponding Change in the Market Proportion: 10%, 5%, 0%, 5%, 10% in the C12 to C16. 11.2.3. Enter the five forecast formulas in cells B19 to B23. The formula for cell B19 is shown in cell C19. After entering this formula into B19, copy it down to cells B20 to B23. 11.3. Collectively, highlight all five of the Net Contribution equations (cells B29:B23), rightclick, and enter Net Contribution for the name of this output range. 11.4. Click the Run Simulation button. Figure 10 shows the @RISK Results window that pops up when the simulation finishes. Mónica Oliveira, MAD 2008/2009 10
Figure 10: Summary statistics for the five different prizes (B19 to B23) charged for soft pretzels 12. Step 12 12.1. Click on Tab 2 in the @RISK Results window, highlight Net Contributions $.50 under the Outputs heading, right click, choose Cumulative, and click on Ascending line. 12.2. Right click when the cursor is over the graph, choose Format Graph, click on the rightmost tab Variables to Graph, highlight Net Contribution $.30/B19 and $.40/B20. Clicking OK produces a graph of all three risk profiles showing the dominance of the $.50 price (Figure 11). Mónica Oliveira, MAD 2008/2009 11
Figure 11: Risk profiles for the $30, $40 and $50 pretzel prices incorporating the dependence between market structure and price 13. Step 13 13.1. Click on Tab 3 in the @RISK results window, right Click the Net Contribution heading 14. Step 14 directly below Outputs, and click on Summary Graph. 14.1. Close all worksheets, so that @RISK clears the inputs by outputs table, and reopen or build again the worksheet shown in Figure 1. 14.2. Modify the worksheet to match Figure 13, specifically, insert a new fourth row, and type Market Mean in A4 and =RiskUniform(90000,110000) in B4. Figure 12: Incorporating uncertainty about the mean of the distribution for market Mónica Oliveira, MAD 2008/2009 12
14.2.1. Enter the distribution shown in the C column for the remaining input variables. In cell B5, be sure to indicate that the mean of the market size is B4; this is, enter =RiskNormal(B4,10000) in B5. 14.3. Highlight cell B12, right click, and click Add Output. If desired, name this cell. 14.3.1. Click Run Simulation. Mónica Oliveira, MAD 2008/2009 13