You are on page 1of 9

170451150.xls.ms_office, Sheet: Introduction, p.

1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 A B C

@RiskStarter.XLS: An Introduction to @Risk by Example


4/9/2001
John O. McClain jom1@cornell.edu Johnson Graduate School of Management Cornell University Ithaca NY 14853 This is a very simple introduction to @Risk. It uses only "menu commands", rather than the buttons that are part of @Risk, because it is easier to describe, in writing, where the menu commands are than to describe which button to click. You are welcome to use it in any manner, and change it as you see fit. This introduction comes without any guarantee whatsoever, and is distributed free of charge. An example is used to teach the basics of operating @Risk and getting it to report what you want to know. The example depicts a resupply problem. This is followed by a sheet that illustrate use of different probability distributions. The description omits mention of how to use the "Interactive @Risk Results Window", and instead tells the user how to get the desired output deposited on a worksheet in the active workbook. This has two advantages. First, it is easier to explain. Second, most users want their output in Excel format sooner or later anyway.

170451150.xls.ms_office, Sheet: Example, p. 2


A 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 B C D E F G H I

@Risk Example: One Chance to Sell


Demand is normally distributed, Mean 500, Std Dev 20. You start the day with "Q" units. You get to decide on Q. Your cost is $5 per unit. Revenue is $7 per unit sold. Leftover units have no cost or value. (a) What is the average profit if you use Q=520? (b) What does the distribution of profits look like? (c) What is the probability that profit will be below $800? (d) Try other values of Q to seek the highest profit. Stock (Q) Demand Sales Profit 520 500 500 900 <== To be determined <== We will use @Risk to make this Normally Distributed =MIN(C10,C11) <== Sales is the minimum of Q and Demand = 7*C12 - 5*C10 <== We will make @Risk report the average as Output.

Solution for questions (a, b, c): If you have not already done so, start @Risk. 1. Make Demand a normally distributed random variable as follows: Select Cell C11. Pull down the "Insert" menu and select "Function" In the left window, select "@Risk Distribution" (see picture below). In the right window, select "RiskNormal" Click OK Enter the mean and standard deviation of demand. Click OK Cell C11 should now read: =RiskNormal(500,20).

Abbreviation for the preceding instructions: Select C11. Menu: Insert, Function, Left Window: @Risk Distribution, Right Window: RiskNormal, OK, Mean: 500. std dev: 20. OK. 2. Make Profit an "output" so @Risk will give you a report on it: Select C13. Menu: @Risk, Model, Add Output Cell C13 should now read: =RiskOutput() + 7*C12 - 5*C10 3. Set @Risk to simulate Demand 1000 times: Menu: @Risk, Simulation, Settings, Iterations tab. # Iterations 1000, # Simulations 1. OK.

170451150.xls.ms_office, Sheet: Example, p. 3


A 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 B C D E F G H I 4. Set @Risk to report the simulation results on a Worksheet in this workbook. Menu: @Risk, Results, Report Settings. (Make selections shown below) "Un-check" this

5. Run the simulation. Menu: @Risk, Simulation, Start.

71 6. Three new worksheets will appear. Their contents are shown below. 72 Answer (a): Profit averages $888.36 with standard deviation $121.30 73 Answer (b): The distribution (graph) is bell shaped, except for a spike on the right side. 74 Answer (c): The Output Statistics Report shows that profits are below $800 about 24% of the time. 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 Input Statistics Report
Inputs Demand Simulation# 1 Statistics / Cell $C$11 Minimum 436.647 Maximum 578.549 Mean 500.012 Standard Deviation 20.0344 Variance 401.377 Skewness 0.02406 Kurtosis 3.04675 NumErrs 0 Mode 494.674 5% 467.072 10% 474.327 15% 479.262 20% 483.103 25% 486.47 30% 489.495 35% 492.249 40% 494.888 45% 497.448 50% 499.981 55% 502.511 60% 505.048 65% 507.68 70% 510.448 75% 513.463 80% 516.831 85% 520.686 90% 525.606 95% 532.771

Output Statistics Report


Outputs Profit Simulation# 1 Statistics / Cell $C$13 Minimum 456.532 Maximum 1040 Mean 888.357 Standard Deviation 121.303 Variance 14714.4 Skewness -0.574 Kurtosis 2.71398 NumErrs 0 Mode 1040 5% 669.501 10% 720.291 15% 754.836 20% 781.721 25% 805.292 30% 826.466 35% 845.741 40% 864.216 45% 882.134 50% 899.868 55% 917.578 60% 935.338 65% 953.759 70% 973.136 75% 994.243 80% 1017.81 85% 1040 90% 1040 95% 1040

Output Graphs

170451150.xls.ms_office, Sheet: Example, p. 4


A B C D E F G H I 101 Solution for question (d): Multiple runs 102 7. Try a range of values for Q. The following assumes you want to try 460, 480, 500, 580 103 Select cell C10. Menu: Insert, Function. Left Window: @Risk Distribution. Right Window: RiskSimtable. OK. 104 105 {460,480,500,520,540,560,580} (be sure to type { } around the numbers) 106 Cell C10 should now read: =RiskSimtable({460,480,500,520,540,560,580}) 107 108 109 110 111 112 113 114 115 116 117 118 8. Set @Risk to run multiple simulations with the same random number sequence. Menu: @Risk, Simulation, Settings: 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 9. Request only summary output. Menu: @Risk, Results, Report Settings: 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150

170451150.xls.ms_office, Sheet: Example, p. 5


A 151 152 153 154 B C D E F G H I 10. Run the simulation. Menu: @Risk, Simulation, Start. You will be asked if you want to save the previous model. Say NO. You will be asked if you want to replace the previous output summary. Say NO. 11. A worksheet named "Summary Report" should appear (see below).

155 Answer (d): Average profit is highest in simulation 2, for which Q=480. 156 Based on these results, you can try a "finer grid" of values for Q near the best one. 157 158 Output Name Output Cell Simulation# Minimum Maximum Mean 159 Profit $C$13 1 765.781555 920 918.8639 160 2 665.781555 960 948.3878 161 3 565.781555 1000 944.1999 162 4 465.781525 1040 888.3872 163 5 365.781525 1080 798.8599 164 6 265.781525 1120 699.9896 165 7 165.78154 1053.043 600.0335 166 167 Input Name Input Cell Simulation# Minimum Maximum Mean 168 Stock (Q) $C$10 1 460 460 460 169 2 480 480 480 170 3 500 500 500 171 4 520 520 520 172 5 540 540 540 173 6 560 560 560 174 7 580 580 580

Std Dev

9.713387 36.21125 81.52765 121.2055 137.0791 139.709 139.8456


Std Dev

0 0 0 0 0 0 0

170451150.xls.ms_office, Sheet: Example, p. 6


J 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42

43 Simulations 1. 44 OK. 45 46 47 48 49 50

170451150.xls.ms_office, Sheet: Example, p. 7


J 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

170451150.xls.ms_office, Sheet: Example, p. 8


J

101 102 103 w: RiskSimtable. OK. 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150

170451150.xls.ms_office, Sheet: Distrib, p. 9


A 1 B C D E F G H I J K L

@Risk Example: General Distributions

2 This is the same example, illustrating how to "fit" some distributions. 3 Two @Risk functions use "tables" as input: 4 >> RiskGeneral randomly generates values anywhere between two limits, on a continuous scale. 5 >> RiskDiscrete randomly generates values from the top row of the table. 6 The other distributions are self-explanatory. (See the note below about the LogNormal distribution.) 7 8 Continuous Discrete Table Normal Log Expo Uniform Table Poisson Binomial Uniform 9 normal nential 10 Stock (Q) 520 520 520 520 520 520 520 520 520 11 Sales 500 500 500 500 500 500 500 500 500 12 Profit 900 900 900 900 900 900 900 900 900 13 Demand 500 500 500 500 500 500 500 500 500 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 X: Freq: Historical Frequencies of Demand: 460 480 500 520 540 22 Cells: Continuous Distributions C13 D13 E13 F13 G13 46 77 35 10

Formulas: = RiskGeneral(C15, G15, C15:G15, C16:G16) = RiskGeneral(Min, Max, Values of X, Frequencies) = RiskNormal(500,20) = RiskNormal(Mean, Standard Deviation) = RiskLognorm(500,20) = RiskLognorm(Mean, Standard Deviation) = RiskExpon(500) = RiskExpon(Mean) = RiskUniform(460,540) = RiskUniform(Lower Limit, Upper Limit)

Discrete Distributions

I13 = RiskDiscrete(C15:G15, C16:G16) = RiskDiscrete(Values of X, Frequencies) J13 = RiskPoisson(500) = RiskPoisson(Mean) K13 = RiskBinomial(1000,0.5) = RiskBinomial(n, p) L14 = RiskIntUniform(460,540) = RiskIntUniform(Lower Limit, Upper Limit)

Note about the Lognormal Distribution Lognormal has the shape of an asymmetrical bell. X cannot be negative, so the distribution begins at X=0. However, it has a long tail to the right. All positive X-values are possible. It is often used in place of the normal distribution to represent variables that cannot have negative values.

You might also like