Introduction Distributions Example
CORPFIN 2503 – Business Data Analytics: Monte
Carlo simulation
čius
Week 8: September 13th, 2021
čius CORPFIN 2503, Week 8 1/29
Introduction Distributions Example
Outline
Introduction
Distributions
Example
čius CORPFIN 2503, Week 8 2/29
Introduction Distributions Example
Introduction
Future is uncertain; thus, analysts and managers use several
techniques to analyze future events or outcomes:
• Sensitivity analysis shows how the (many) different values of
one uncertain variable affect another variable:
• e.g., how different values of oil price affect Qantas profit
• Scenario analysis shows how (a few) different values for
several uncertain variables affect another variable:
• e.g., best / most likely / worst case scenarios for BHP profit
taking into account commodity prices, exchange rates, and
interest rates
• Simulation is the synthesis of sensitivity and scenario analysis:
many scenarios for many different values of several uncertain
variables
• Monte Carlo simulation is sophisticated simulation.
čius CORPFIN 2503, Week 8 3/29
Introduction Distributions Example
Monte Carlo simulation
1. We need to identify factors that affect a variable of interest
(e.g., stock prices, int. rates, exchange rates).
2. Then we determine the distribution of the factors as well as
correlation coefficients between the factors.
3. We generate randomly, e.g. 1,000 values for these factors. ⇒
So we have 1,000 scenarios.
4. For each scenario, we calculate the value of the variable of
interest.
5. We sort the obtained values in the ascending order.
čius CORPFIN 2503, Week 8 4/29
Introduction Distributions Example
Monte Carlo simulation II
The distribution of outcomes can be used to:
1. compute the expected, worst, and best outcomes
• e.g., best / most likely / worst case scenarios for BHP profit
taking into account commodity prices, exchange rates, and
interest rates
2. calculate the probability of a particular outcome (if the
number of scenarios is relatively small)
3. calculate the probability that the outcome is greater or lower
than a particular value
• e.g., what is the probability that BHP profit will be greater
than AUD10 billion?
4. find the lowest 1st and 5th percentiles of the outcome (for
value at risk (VaR)):
• e.g., if VaR on an asset is $100m at a one-week, 95%
confidence level, it means that there is a only a 5% chance
that the value of the asset will drop more than $100m over any
1 week.
čius CORPFIN 2503, Week 8 5/29
Introduction Distributions Example
Distributions
In this lecture, we will consider the following distributions:
1. normal
2. uniform.
čius CORPFIN 2503, Week 8 6/29
Introduction Distributions Example
Normal distribution
Normal distribution is defined by 2 properties:
• mean
• standard deviation.
čius CORPFIN 2503, Week 8 7/29
Introduction Distributions Example
Uniform distribution
a b
Uniform distribution is defined by 2 properties:
• minimum value
• maximum value.
čius CORPFIN 2503, Week 8 8/29
Introduction Distributions Example
Example
Let’s use Monte Carlo simulation to predict net income of the
following firm:
• Sales follow normal distribution: N (100, 20)
• Fixed costs follow uniform distribution: U(20, 22)
• Variable costs depend on sales: Sales×U(0.4, 0.5)
• A firm has debt of 100; interest rate follows normal
distribution: N (0.02, 0.005)
• Income tax rate follows uniform distribution: U(0.25, 0.30).
čius CORPFIN 2503, Week 8 9/29
Introduction Distributions Example
Example II
Net income using expected (i.e., average) values:
Variable Value Calculation
Sales 100
– Fixed costs –21 20+22
2
– Variable costs –45 0.4+0.5
2
× 100
– Interest payments –2 100× 0.02
Net income before taxes 32 100− 21− 45− 2
–Taxes –8.8 0.25+0.3
2
× 32
Net income 23.2 32− 8.64
Monte Carlo simulation will reveal how this value is impacted by
uncertainty of the future.
čius CORPFIN 2503, Week 8 10/29
Introduction Distributions Example
Example III
First, we need to generate 5 random variables:
data work.monte_carlo;
do scenario = 1 to 1000;
sales = rand(“Normal”, 100, 20);
fixed_costs = rand(“Uniform”, 20, 22);
variable_costs_ratio = rand(“Uniform”, 0.4, 0.5);
interest_rate = rand(“Normal”, 0.02, 0.005);
income_tax_rate = rand(“Uniform”, 0.25, 0.30);
output;
end;
run;
čius CORPFIN 2503, Week 8 11/29
Introduction Distributions Example
Notes for the SAS code on the previous slide
SCENARIO is an index (or counter) variable. It is set to iterate
from 1 to 1,000:
do scenario = 1 to 1000;
Now the loop has been setup; thus, we need to specify what should
happen during each iteration.
OUTPUT option instructs SAS to record each iteration in our
dataset.
END statement closes off the DO loop.
čius CORPFIN 2503, Week 8 12/29
Introduction Distributions Example
Example IV: Sample
čius CORPFIN 2503, Week 8 13/29
Introduction Distributions Example
Example IV
Let’s look at the statistical properties of these variables:
proc means data=work.monte_carlo n mean std min p1 p5
p25 median p75 p95 p99 max maxdec=3;
var sales fixed_costs variable_costs_ratio interest_rate
income_tax_rate;
run;
čius CORPFIN 2503, Week 8 14/29
Introduction Distributions Example
Example V
čius CORPFIN 2503, Week 8 15/29
Introduction Distributions Example
Example VI
Let’s look at their histograms:
proc sgplot data=work.monte_carlo;
histogram fixed_costs;
run;
proc sgplot data=work.monte_carlo;
histogram variable_costs_ratio;
run;
proc sgplot data=work.monte_carlo;
histogram income_tax_rate;
run;
čius CORPFIN 2503, Week 8 16/29
Introduction Distributions Example
Example VII
proc sgplot data=work.monte_carlo noautolegend;
histogram sales;
density sales;
density sales / type=kernel;
keylegend / location=inside position=topright across=1
noborder;
run;
proc sgplot data=work.monte_carlo noautolegend;
histogram interest_rate;
density interest_rate;
density interest_rate / type=kernel;
keylegend / location=inside position=topright across=1
noborder;
run;
čius CORPFIN 2503, Week 8 17/29
Introduction Distributions Example
Histogram for FIXED_COSTS
čius CORPFIN 2503, Week 8 18/29
Introduction Distributions Example
Histogram for VARIABLE_COSTS_RATIO
čius CORPFIN 2503, Week 8 19/29
Introduction Distributions Example
Histogram for INCOME_TAX_RATE
čius CORPFIN 2503, Week 8 20/29
Introduction Distributions Example
Histogram for SALES
čius CORPFIN 2503, Week 8 21/29
Introduction Distributions Example
Histogram for INTEREST_RATE
čius CORPFIN 2503, Week 8 22/29
Introduction Distributions Example
Example VIII
Let’s compute net income for each scenario:
data work.monte_carlo;
set work.monte_carlo;
net_income= (sales – fixed_costs
– sales*variable_costs_ratio
– 100*interest_rate)*(1-income_tax_rate);
run;
čius CORPFIN 2503, Week 8 23/29
Introduction Distributions Example
Example IX
čius CORPFIN 2503, Week 8 24/29
Introduction Distributions Example
Example X
Now let’s look at the statistical properties of NET_INCOME:
proc means data=work.monte_carlo n mean std min p1 p5 p25
median p75 p95 p99 max maxdec=3;
var net_income;
run;
proc sgplot data=work.monte_carlo noautolegend;
histogram net_income;
density net_income;
density net_income / type=kernel;
keylegend / location=inside position=topright across=1
noborder;
run;
čius CORPFIN 2503, Week 8 25/29
Introduction Distributions Example
Descriptive statistics of NET_INCOME
Net income using expected (i.e., average) values is 23.2; mean and
median values from Monte Carlo simulation are also around 23.
Min and max values are –4.265 and 54.726.
5th percentile value is 9.110 =⇒ we are 95% confident that net
income will be higher than 9.110.
čius CORPFIN 2503, Week 8 26/29
Introduction Distributions Example
Histogram of NET_INCOME
čius CORPFIN 2503, Week 8 27/29
Introduction Distributions Example
What if we increase the number of scenarios?
The key difference: when the sample size increases, the range
becomes wider.
čius CORPFIN 2503, Week 8 28/29
Introduction Distributions Example
What if we increase the number of scenarios? II
čius CORPFIN 2503, Week 8 29/29
Introduction
Distributions
Example