• 沒有找到結果。

Monte Carlo Simulation for European Call Option

N/A
N/A
Protected

Academic year: 2022

Share "Monte Carlo Simulation for European Call Option"

Copied!
10
0
0

加載中.... (立即查看全文)

全文

(1)

Monte Carlo Simulation for European Call Option

Zheng-Liang Lu

Department of Computer Science and Information Engineering National Taiwan University

January 9, 2020

(2)

Introduction

• We invent new financial instruments to hedge the risk of holding assets, which are volatile from time to time.

• The central question of financial engineering

1

is, “What is the fair price of one instrument?”

• The key idea is very simple: no free lunch.

2

• We first inscribe the price behavior by stochastic processes.

• In particular, we assume that the return rate of one stock is a Brownian motion

3

.

1See https://en.wikipedia.org/wiki/Financial_engineering and https://en.wikipedia.org/wiki/Rocket_science_in_finance.

2See https://en.wikipedia.org/wiki/Arbitrage.

3See https://en.wikipedia.org/wiki/Brownian_motion.

Zheng-Liang Lu 1

(3)

Brownian Motion

• The stock price S

t

follows dS

t

S

t

= µdt + σdW

t

, (1)

where µ is the annual return rate, σ is the annualized volatility, and W

t

is a Wiener process.

4

• By the Itˆ o calculus, the solution of Equation (1) is S

t+1

= S

t

e

(µ−12σ2)∆t+σ

∆tZt

, where ∆t is the time interval and Z

t

∼ N(0, 1).

4See https://en.wikipedia.org/wiki/Wiener_process.

Zheng-Liang Lu 2

(4)

1 clear; clc; close all;

2

3 s0 = 100; mu = 0.05; v = 0.2;

4 T = 1; n = 252; dt = T / n;

5

6 A = (mu - 0.5 * v ˆ 2) * dt;

7 B = v * sqrt(dt);

8

9 figure; grid on; hold on;

10 for i = 1 : 50 % 50 price paths

11 ds = exp(A + B * randn(1, n));

12 S = s0 * cumprod([1 , ds]);

13 plot([0 : n] + today, S);

14 end

15 xlabel("Date"); ylabel("Closed price");

16 datetick("x", 29); axis tight;

• Use cumprod to calculate the cumulative product.

• Use datetick and assign dates to the x axis.

Zheng-Liang Lu 3

(5)

2020-01-01 2020-04-01 2020-07-01 Date

80 100 120 140 160 180

Closed price

Zheng-Liang Lu 4

(6)

European Call Option

6

• A European option is an option that can only be exercised at the strike price X at maturity time T .

• If the asset follows Equation (1) with the spot price S

0

, then the call price c is

c = e

−rT

E

Q

[ (S

T

− X )

+

],

where r is the risk-free interest rate and E(·) is the expected value of the payoff function (S

T

− X )

+

under the risk-neutral probability measure Q.

5

5Also see https://en.wikipedia.org/wiki/Black_Scholes_model#

Black_Scholes_formula.

6Black and Scholes (1972) and Merton (1973). Merton and Scholes received the 1997 Nobel Memorial Prize in Economic Sciences for their work.

Zheng-Liang Lu 5

(7)

1 clear; clc; close all;

2

3 s0 = 100; mu = 0.05;

4 v = 0.2; T = 1; n = 1e5;

5 A = (mu - 0.5 * v ˆ 2) * T;

6 B = v * sqrt(T);

7 ST = s0 * exp(A + B * randn(1, n));

8

9 histogram(ST, 20, "binmethod", "integer", ...

10 "Normalization", "probability");

11 xlabel("Price");

12 ylabel("Probability density");

13 hold on; grid on;

14

15 X = 100; % strike price

16 line([X, X], [0, 0.025], "color", "red");

17 legend({"Stock price at time T", "Strike price"});

Zheng-Liang Lu 6

(8)

40 60 80 100 120 140 160 180 200 220 240 Price

0 0.005 0.01 0.015 0.02 0.025

Probability density

Stock price at time T Strike price

Zheng-Liang Lu 7

(9)

1 ...

2

3 % MC simulation

4 c = 0;

5 for i = 1 : n

6 ST = s0 * exp(A + B * randn(1));

7 if ST > X

8 c = c + ST - X;

9 end

10 end

11 c = exp(-mu * T) * c / n

12

13 % built-in function: see Financial Toolbox

14 blsprice(s0, X, mu, T, v)

• The simulation produces the call price about 10.4579 while the Black-Scholes formula gives us the call price 10.4506.

Zheng-Liang Lu 8

(10)

Vectorized Version

1 clear; clc;

2

3 s0 = 100; X = 100; mu = 0.05;

4 v = 0.2; T = 1; n = 1e6;

5 A = (mu - 0.5 * v ˆ 2) * T;

6 B = v * sqrt(T);

7 ST = s0 * exp(A + B * randn(1, n));

8

9 % MC simulation by vectorization

10 c = exp(-mu * T) * sum(ST(ST > X) - X) / n

Zheng-Liang Lu 9

參考文獻

相關文件

• Performance: vectorized code often runs much faster than the corresponding code containing loops.. Zheng-Liang

• But Monte Carlo simulation can be modified to price American options with small biases (pp..

Bootstrapping is a general approach to statistical in- ference based on building a sampling distribution for a statistic by resampling from the data at hand.. • The

First appearing in print in 1887's A Study in Scarlet.. received the 1921 Nobel Prize

These activities provide chances for students to work on their own, to apply their economic concepts, to develop a critical attitude and, above all, to increase the interest of

Graphene: leading the way in material science and technology.. The 2010 Nobel Prize

If the skyrmion number changes at some point of time.... there must be a singular point

The 1911 Nobel prize in Physics was awarded to Wilhelm Wien, Germany For his discoveries regarding the laws governing the radiation of heat. The 1918 Nobel prize in Physics was