esd.70j engineering economy module - session 21 esd.70j engineering economy module fall 2005 session...

20
ESD.70J Engineering Economy Module - Session 2 1 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - [email protected] Link for this PPT: http://ardent.mit.edu/real_options/ROcse_Excel_latest/ExcelS ession2.pdf

Upload: nigel-watts

Post on 12-Jan-2016

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 1

ESD.70J Engineering Economy Module

Fall 2005Session One

Alex Fadeev - [email protected]

Link for this PPT: http://ardent.mit.edu/real_options/ROcse_Excel_latest/ExcelSession2.pdf

Page 2: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 2

Session two – Simulation

• Objective: – Generate random numbers– Set up simulation by Data Table– Generate statistics for simulation – Draw histogram and cumulative distribution

function (CDF)

Page 3: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 3

Questions for “Big vs. small”

From the base case spreadsheet, we’ve calculated NPV’s.

However, we assumed deterministic demand forecasts for years 1, 2 and 3. It is an over-simplifying assumption since actual demand will vary.

We need to evaluate the range of NPV outcomes, their Min, Max, distributions and the expected NPV values!

Page 4: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 4

Outline

• Set up random number generator

• How does Monte Carlo simulation work

• Set up simulation by Data Table

• Get descriptive statistics from the simulation

• Draw cumulative distribution function (CDF)

Page 5: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 5

Excel’s RAND() f’n

• Returns an evenly distributed random number greater than or equal to 0 and less than 1

• To generate a random real number between a and b, use: =RAND()*(b-a)+a

• Formula in cell C3: “=Entries!C9*((1-Entries!C25)+2*Entries!C25*RAND())” Returns an evenly distributed random demand for year 1 around 300,

but may differ by plus or minus 50%. [or just: “=Entries!C9*(RAND()+(1-Entries!C25))”]

The Same logic for cell C4 and C5

Page 6: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 6

Random number generatorFollow the instructions, step by step

1. Click “Worksheet” under “Insert” to add a new sheet, name it “Rand”

2. Type in “Year” in cell B2, “Random demand” in cell B3, type “1”, “2”, “3” in cell C2, D2, E2 respectively

3. Type “=Entries!C9*((1-Entries!C25)+2*Entries!C25*RAND())” in cell C3

4. Type “=Entries!C10*((1-Entries!C25)+2*Entries!C25*RAND())” in cell D3

5. Type “=Entries!C11*((1-Entries!C25)+2*Entries!C25*RAND())” in cell E3

Link for Excel: http://ardent.mit.edu/real_options/ROcse_Excel_latest/Session2-2.xls

Page 7: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 7

6. Click “Chart” under “Insert” menu7. “Standard types” select “XY(Scatter)”, “Chart

sub-type” select any one with lines, click “Next”8. “Data range” select B2:E3, click Next9. “Chart options” select whatever pleases you,

click “Next”10. Choose “As object in” and click “Finish”11. Press “F9” several times to see want happens

We have built a random demand generator for the 3 years that assumes independent demand (0 correlation) from year to year

Page 8: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 8

How Monte Carlo Simulation works

Calculate two NPVA ’s corresponding to the two random demand simulations

Demand in Year 1

Demand in Year 2

Demand in Year 3

NPVA

345 678 1001

189 579 690

How about generating many sets of random demands, and get the corresponding NPVA’s

Page 9: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 9

Monte Carlo Simulation (Cont)

Generate many sets of random demands for the three-year span

Calculate corresponding big number of NPVA's

Statistical analysis

Generate distribution of NPVA

Page 10: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 10

Set up simulation by Data TableFollow the instructions, step by step:1. Link demand in sheet for Plan A to the random demand

generated, specifically, Plan A!E5 = Rand!C3; Plan A!G5 = Rand!D3; Plan A!I5 = Rand!E5

2. Click “Worksheet” under “Insert” menu to add a new sheet, and name the new sheet “Simulation”

3. In “Simulation” sheet, Type “NPVA” in cell A1, type “=Plan A!C16” in cell B1 (“Plan A!C16” is the output of result for NPVA)

4. Select “A1:B2001”, click “Table” under “Data” menu, in “column input cell” put “A2002”, leave “row input cell” blank

Page 11: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 11

Explanation

• For the one-way Data Table, there is no need to set up the input values in a list, since each row of the Data Table (for example A2:B2) calls rand() and generates an NPVA projection

• We have 2000 rows in the Data Table, so we have simulated 2000 times

• Click “F9” to try another simulation run

Page 12: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 12

Check this again

Generate many sets of random demands for the three-year span

Calculate corresponding big number of NPVA's

Statistical analysis

Generate distribution of NPVA

Page 13: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 13

Get descriptive statistics for the simulation results

• We want to get the mean (median will be the same), maximum, and minimum value for the simulated results of 2000 NPVA

Follow the following instructions, step by step:1. In “Simulation” sheet, type “Mean” in cell D1, “Maximum”

in cell D2, “Minimum” in Cell D3

2. Cell E1 type in “=AVERAGE(B2:B2001)”, Cell E2 type in “=MAX(B2:B2001)”, cell E3 type in “=MIN(B2:B2001)”

Page 14: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 14

Comparison of deterministic and dynamic results

• From the base case spreadsheet, we learn NPVA is $162.1 million

• What is your result for the expected NPVA when considering demand uncertainty?

• Jensen’s inequality:)]([)]([ xfExEf

Page 15: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 15

Draw cumulative distribution function (CDF)

Follow the instructions, step by step:1. In sheet “Simulation”, type “Bound” in E6,

“Count” in F6, and “CDF” in G62. Type in “0, 1, 2, …, 20” in cell D7 to D273. Set Cell E7 “=$E$3+D7*($E$2-$E$3)/20”, and

drag the formula down to E274. Set Cell F7

“=COUNTIF($B$2:$B$2001,"<"&TEXT(E7,“#.00000"))”, and drag the formula down to F27

5. Set Cell G7 “=F7/2000”, and drag down to cell G27

Page 16: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 16

6. Click “Chart” under “Insert” menu7. “Standard types” select “XY(Scatter)”, “Chart sub-

type” select anyone with lines, click “Next”8. “Data range” select “= Simulation!$E$7:$E$27,

Simulation!$G$7:$G$27”, click Next9. “Chart options” select whatever pleases you, click

“Next”10. Choose “As object in” and click “Finish”11. In the chart, double click Value (x) axis, “Format

axis” window popped out, go to “scale” menu, change “Value (Y) axis crosses at” into “-400”

12. Click “F9”, see the CDF moves

Now you get the CDF for the simulation

Page 17: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 17

Explanation• We set up 20 equal-width intervals to study how

many data points sitting in each interval• “countif” function counts the number of cells

within a range that meet the given criteria.• “text” function converts a value to text in a

specific number in a specific format– #: format code for displaying only significant digits and

does not display insignificant zeros– 0: format code for displaying insignificant zeros if a

number has fewer digits than there are zeros in the format.

Page 18: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 18

Explanation (Cont)• “Text” function used here to circumvent some

stubborn Excel idiosyncrasy that makes “countif” not working

– See if it works if you type in “=COUNTIF($B$2:$B$2001,<E7)

• Each point on the CDF curve calculated by fraction of the 2000 simulation results that is smaller than a certain bound

• More refined CDF plots and histograms can be found at http://web.mit.edu/tao/www/ESD70/S2/2.xls

Page 19: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 19

Summary

• Random number generation in Excel

• Using Data Table for simulation

• At least two ways to run Monte Carlo simulations in Excel

Page 20: ESD.70J Engineering Economy Module - Session 21 ESD.70J Engineering Economy Module Fall 2005 Session One Alex Fadeev - afadeev@mit.edu Link for this PPT:

ESD.70J Engineering Economy Module - Session 2 20

Next class…

• Today’s session modeled demand uncertainty based on an evenly distributed random variable

• This is not a particularly realistic model, though it is simple and sufficient for today’s purposes.

• Next session we’ll explore alternative random # distributions.