Professional Documents
Culture Documents
Monte Carlo Simulation 01d
Monte Carlo Simulation 01d
HANDBOOK
How to perform a
MONTE CARLO
SIMULATION
financialmodellinghandbook.com
ABOUT THE FINANCIAL
MODELLING HANDBOOK
Financial modelling should be collaborative. Collaboration reduces
error, speeds up development time and lowers cost. The Financial
Modelling Handbook is a collaborative, crowd-sourced guide to
building better financial models using the FAST Standard.
www.financialmodellinghandbook.com/contribute
Financial Modelling
HANDBOOK
GERALD
Gerald Strever is a leading expert on financial
modelling and spreadsheet techniques.
financialmodellinghandbook.com
Financial Modelling
HANDBOOK
How to perform a
MONTE CARLO
SIMULATION
To simulate is to try to duplicate the features, appearance and characteristics of a real
system.
The real-life system is not touched until the advantages and disadvantages of what
may be a major policy decision are first measured on the system's model.
How to perform a
MONTE CARLO
SIMULATION
For performing a simulation, we shall:-
1) Define a problem
2) Introduce the variables associated with the problem
3) Construct a mathematical model
4) Set up possible courses of action for testing
5) Run the experiment
6) Consider the results (perhaps deciding to modify the model or change data
inputs), and
7) Decide what course of action to take.
The idea behind Monte Carlo simulations is to generate values for uncertain elements in the
model (known as “variables” or “inputs”) through random sampling.
1. Identify the variables / inputs in the model where simulation would be helpful.
2. Define a probability distribution curve for each identified variable / input in the model.
3. Using random numbers, simulate values from a probability distribution for each variable
/ input in step 1.
4. Repeat the process for a series of replications (also called “runs” or “trials”) – the more
trials undertaken; the greater the confidence in the result.
Let us set up the example of a fictitious firm selling automobile tires as our simulation
1 model.
From a study of the previous 60 months, monthly demand for tires is 300, 320, 340,
360, 380 or 400 with specific probabilities for each value. Now let us assume that the
following additional information is known regarding the operating environment.
Financial Modelling financialmodellinghandbook.com
HANDBOOK
Depending on competitors' prices and other market conditions, this firm estimates
2
that its average selling price per tire each month follows a discrete uniform
distribution between $60 and $80 (in increments of $1).
Financial Modelling financialmodellinghandbook.com
HANDBOOK
The firm’s variable cost per tire also varies each month depending on material costs
3
and other market conditions. This causes the firm’s average profit margin per tire
(calculated as a percentage of the selling price) to vary each month. Using past
data, the firm estimates that its profit margin per tire follows a continuous uniform
distribution between 20% and 30% of the selling price.
This firm estimates that its fixed cost of stocking and selling tires is $2,000 per
4
month.
Financial Modelling financialmodellinghandbook.com
HANDBOOK
5 Using this information, let us simulate and calculate the firm's average profit per
month from the sale of auto tires.
Cell F46 (labelled “Random number 1”) generates the random number used to
simulate the demand that month.
6 The random number in Cell F46 is used in a LOOKUP function to simulate the
monthly demand in Cell F112.
Monthly demand of tires (Rows 98-103), probabilities (Rows 105-10) and the random
number in cell F97 are used to calculate the monthly demand (in cell F112).
7 In cell F119, we simulate the average selling price per tire by using the
RANDBETWEEN function (with bottom value = 60 and top value = 80).
Cell F47 generates the random number used to simulate the average profit margin
8 per tire.
The random number in cell F47 is used to simulate the average profit margin per
9 tire in cell F127. For this, we use the continuous uniform distribution formula, [a +
(b-a) * n] with a = 20% and b = 30%.
10
10
Using these simulated values, the firm’s monthly profit is calculated in cell F136 as -
Profit = (Demand for tires) x (Average selling price per tire) x (Average profit margin
per tire) - (Monthly fixed cost)
MONTHLY PROFITS
This result indicates that this firm will earn a profit of $4,334 per month. It is important to
remember, however, that each randomly simulated value only represents something that
could occur. As such, there is no guarantee that the specific values simulated will actually
occur.
Owing to the presence of random numbers, these simulated values will change each time
the model is replicated (they will change each time the F9 key is pressed in Excel). It would
be incorrect to estimate the firm's profit based on just one replication.
Financial Modelling financialmodellinghandbook.com
HANDBOOK
MONTHLY PROFITS
To calculate a firm's average monthly profit, we need to replicate the simulation model
several thousand times. However, in order to keep the size of the resulting Excel files
relatively small, we illustrate only 200 replications.
It is important to note that 200 replication may not be sufficient for a simulation model to
yield trustworthy results. An average based on just 200 replications might be different each
time we run the simulation model.
Careful thought should be given to how many times a model should be run.
Financial Modelling financialmodellinghandbook.com
HANDBOOK
11
We illustrate the use of Data Table to replicate Firm's simulation model 200 times.
Step 1: We first use 200 cells in an empty column in the spreadsheet to represent
the 200 values of the dummy variable. We can describe the cells E9:E208 as ‘Trial 1’
to ‘Trial 200’ - to indicate we are performing 200 replications
13
12
Step 2:
In the cell adjacent to the first cell in the range E9:E208 (that is, in cell F9), we
12
specify the cell reference for the output measure we want replicated 200 times.
In the model, this corresponds to Cell F136 of ‘Monte Carlo Simulation_Calc’ sheet,
13
the monthly profit value. Hence, the formula in cell F9 would be = 'Monte Carlo
Simulation_Calc'!F136. Leave cells F10:F208 blank. Data Table will fill in these cells
automatically when we run it.
Step 3:
Step 4:
Because our Data Table is arranged in columns, we leave the Row input cell box
15
blank.
We then select any arbitrary cell (for example cell F5 that has nothing to do with the
simulation model) and enter this cell reference in the Column input cell box.
It is important to make sure this selected cell has no role to play in the simulation
model. In effect, we are telling Data Table that cell F5 contains our dummy formula.
Note: rows 11 to 205 are hidden for screenshot purposes.
Financial Modelling financialmodellinghandbook.com
HANDBOOK
16
Step 5:
Finally, click OK to run Data Table.
16
The procedure now takes the 200 entries in cells F9:F208, plugs them one at a time
in cell F5, and reports the value of cell F136 of ‘Monte Carlo Simulation_Calc’ sheet
each time in cells F9:F208.
16
Step 5 (continued):
Owing to the presence of random numbers, these simulated values will change each
16
time the model is replicated (that is, they will change each time the F9 key is pressed
in Excel).
16
Step 5 (continued):
Even though the variable values in cells F9:F208 and the formula in cell F5 are
16
dummies, Excel generates new random numbers for each replication of the model.
The simulated results in cells F9:F208 are therefore different for each replication.
17
Select the range F9:F208, copy it and paste values only. Further analysis should be
17
undertaken based on the captured values, rather than on a live data table.
19
20
19 ‘Standard deviation’.
We could also calculate several outcomes using the Descriptive Statistics function in
the Analysis Toolpak.