To simulate is to try to duplicate the features, appearance and characteristics of a real system.
The idea behind simulation is to imitate a real-world situation mathematically, to study its properties and operating characteristics, to draw conclusions and make action decisions based on the results of the simulation.
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.
2. 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
3. financialmodellinghandbook.com
GERALD
Gerald Strever is a leading expert on financial modelling and spreadsheet techniques.
He is the Senior Managing Partner at Finance Training Solutions, specialising in Financial Strategy, Business Modelling and Company Valuation.
Financial Modelling
HANDBOOK
4. To simulate is to try to duplicate the features, appearance and characteristics of a real system.
The idea behind simulation is to imitate a real-world situation mathematically, to study its properties and operating characteristics, to draw conclusions and make action decisions based on the results of the simulation.
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.
Financial Modelling
HANDBOOK
How to perform a
SIMULATION
MONTE CARLO
DOWNLOAD THIS GUIDE AND THE ACCOMPANYING EXCEL EXAMPLE
5. 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.
Financial Modelling
HANDBOOK
DOWNLOAD THIS GUIDE AND THE ACCOMPANYING EXCEL EXAMPLE
How to perform a
SIMULATION
MONTE CARLO
6. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
MONTE CARLO SIMULATION
When a problem contains elements that exhibit chance or probability in their behaviour, a Monte Carlo simulation may be deployed.
The idea behind Monte Carlo simulations is to generate values for uncertain elements in the model (known as “variables” or “inputs”) through random sampling.
The technique breaks down into simple steps:
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.
5. Analyze the outcomes
7. Let us set up the example of a fictitious firm selling automobile tires as our simulation 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.
financialmodellinghandbook.com
Financial Modelling
HANDBOOK
PROBABILITY OF DEMANDS INPUTS
1
1
8. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
GATHER THE DATA
Depending on competitors' prices and other market conditions, this firm estimates that its average selling price per tire each month follows a discrete uniform distribution between $60 and $80 (in increments of $1).
2
2
9. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
GATHER THE DATA
The firm’s variable cost per tire also varies each month depending on material costs 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 month.
3
3
4
4
10. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
CALCULATING MONTHLY DEMAND
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.
Formula in F46: = RAND()
Note: rows 49 to 95 are hidden for screenshot purposes.
5
11. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
CALCULATING MONTHLY DEMAND
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).
Formula in F112: = LOOKUP(F$97, F105:F110, F98:F103)
Note: rows 49 to 95 are hidden for screenshot purposes.
6
12. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
CALCULATING SELLING PRICE
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).
The formula in F119: = RANDBETWEEN(F117, F118)
7
13. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
CALCULATING PROFIT MARGIN
8
Cell F47 generates the random number used to simulate the average profit margin per tire.
The random number in cell F47 is used to simulate the average profit margin per tire in cell F127. For this, we use the continuous uniform distribution formula, [a + (b-a) * n] with a = 20% and b = 30%.
The formula in F127: = F125 + (F126 - F125) * F124.
Note: rows 49 to 120 are hidden for screenshot purposes.
8
9
9
14. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
CALCULATING MONTHLY PROFIT
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)
Formula in cell F136 is = F132 * F133 * F134 - F135
10
10
15. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
MONTHLY PROFITS
This is the result for a single replication of Firm's simulation model.
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.
16. financialmodellinghandbook.com
Financial Modelling
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.
We then compute summary statistics just from these 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.
17. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
REPLICATION USING A DATA TABLE
We illustrate the use of Data Table to replicate Firm's simulation model 200 times.
The procedure is as follows:
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
Note: rows 11 to 205 are hidden for screenshot purposes.
11
11
18. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
REPLICATION USING A DATA TABLE
Step 2:
In the cell adjacent to the first cell in the range E9:E208 (that is, in cell F9), we 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, 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.
Note: rows 11 to 205 are hidden for screenshot purposes.
12
12
13
13
19. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
REPLICATION USING A DATA TABLE
Step 3:
We now select the range E9:F208 (that is, both columns).
After selecting this range, we choose DataTable (Alt D, T).
The window titled Data Table, is now displayed.
Note: rows 11 to 205 are hidden for screenshot purposes.
14
14
20. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
REPLICATION USING A DATA TABLE
Step 4:
Because our Data Table is arranged in columns, we leave the Row input cell box 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.
15
15
21. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
REPLICATION USING A DATA TABLE
Step 5:
Finally, click OK to run Data Table.
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.
Note: rows 11 to 205 are hidden for screenshot purposes.
16
16
22. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
REPLICATION USING A DATA TABLE
Step 5 (continued):
Owing to the presence of random numbers, these simulated values will change each time the model is replicated (that is, they will change each time the F9 key is pressed in Excel).
Consequently, it is not advisable to estimate a firm's profit based on just one replication. The formula shown in the screenshot is an array formula generated by running the data table.
Note: rows 11 to 205 are hidden for screenshot purposes.
16
16
23. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
REPLICATION USING A DATA TABLE
Step 5 (continued):
Even though the variable values in cells F9:F208 and the formula in cell F5 are 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.
Note: rows 11 to 205 are hidden for screenshot purposes.
16
16
24. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
REPLICATION USING A DATA TABLE
Select the range F9:F208, copy it and paste values only. Further analysis should be undertaken based on the captured values, rather than on a live data table.
Note: rows 11 to 205 are hidden for screenshot purposes.
17
17
25. financialmodellinghandbook.com
Financial Modelling
HANDBOOK
REPLICATION USING A DATA TABLE
Now we can calculate a few outcomes to analyse the scenario:-
‘Average monthly profit’.
‘Standard deviation’.
Probability that monthly profit will be >= 4000 USD.
18
18
19
20
19
20