Python for Finance: Part II: 7 Monte Carlo Simulations

Monte Carlo simulations

We are interested in observing the different possible realizations of a future event.
– Scenario 1
– Scenario 2
– Scenario 3
– Scenario 4
– Scenario 5
– Scenario 6

Historical data => A larger data set with “fictional” data

Current Revenues = Last Year Revenues * (1 + y-o-y growth rate)
– Revenue growth rate – Historical Data or User Intuition
– Revenue volatility – Historical Data or User Intuition

Cogs (Cost of Goods Sold): Modeled as a percentage of revenues
Opex: Modeled as a percentage of revenues

Revenues – Cogs = Gross Profit
Revenues – Opex = Operating Profit

Asset pricing with Monte Carlo

Price Today = Price Yesterday * er
r: log return of share price between yesterday and today.
In(price today / price yesterday)
e.g. eIn(x) = x
Price Today = Price Yesterday * e

Logarithm Basics

log2(16) = x
2x = 16
x = 4

log100(1) = 0
1000 = 1

log2(2) = 1/3
81/3 = 2

log2(1/8) = -3
2-3 = 1/8

log8(1/2) = -1/3
8-1/3 = 1/81/3 = 1/2

Brownian motion

We can use Brownian motion in order to model r:
– Drift:
=> The direction rates of return have been headed in the past.
In(Current Price / Previous Price)
=> Calculate average, standard deviation and variance of daily returns in the historical period.
Drift = (μ – 1/2σ2)
Drift is the expected daily return of the stock.

– Volatility:
Random variable.
Random variable = σ * Z(Rand(0;1))
Price Today = Price Yesterday * eDrift + Random variable
Repeat the calculation 1,000 times.

Euler’s Method

Differential equations introduction

yII + 2yI = 3y
fII(x) + 2fI(x) = 3f(x)

Leibniz’s notation
d2y / dx2 + 2 (dy / dx) = 3y

An Introduction to Derivative Contracts

A derivative is a financial instrument, whose price is derived based on the development of one or more underlying assets.

Originally, derivatives served as a hedging instrument.

– Hedging
– Speculating
– Aribtrageurs

Four Types of derivatives

– Forwards
Two parties agree that one party will sell to the other an underlying asset at a future point of time.

– Futures
Highly standardized forward contracts.

– Swaps
Two parties agree to exchange cash flows based on an underlying asset.
e.g. Interest rate, Stock Price, Bond Price, Commodity

– Options
An option contract enables its owner to buy or sell an underlying asset at a given price.

The Black Scholes formula

– A tool for derivatives pricing.
– calculates the value of an option.
– The holder of the option may decide he wants to buy the stock, but he may also decide he is better off without doing it. This freedom is valuable to every investor. Hence, it has a price.

A Call Option’s Payoff
– Strike Price vs. Share Price
– Share Price > Strike Price –> Exercise
– Strike Price > Share Price –> Don’t Exercise

The Black Scholes Formula

The Black Scholes formula calculates the value of a call by taking the difference between the amount you get if you exercise the option minus the amount you have to pay if you exercise the option.

ページトップへ