# Pricing European Call Options with Monte Carlo …janroman.dhis.org/stud/I2008/MC/MC.docx · Web...

Embed Size (px)

### Transcript of Pricing European Call Options with Monte Carlo …janroman.dhis.org/stud/I2008/MC/MC.docx · Web...

1. Mälardalens Högskola

Course: MMA707Teacher: Jan RömanDate: 09/10/2008

By

Marcelo TamesYoseph Ghebreyesus

Diego R. Calvo

Pricing European Call Options with Monte Carlo Simulation and Stochastic Volatility

Table of Contents

Introduction.............................................................................................................................3The idea of Monte Carlo.........................................................................................................4Implementation in Excel.........................................................................................................6Black-Scholes Comparison.....................................................................................................8Histogram Representation.......................................................................................................9Conclusion............................................................................................................................10References.............................................................................................................................11Appendix...............................................................................................................................12

Visual Basic code..............................................................................................................12

2

Monte-Carlo Simulation

TASK: Build an application in Excel/VBA to solve option prices (European options) with Monte-Carlo. Also include a stochastic volatility in the model. Plot the histogram of the outcome and calculate the probability to reach the strike.

Introduction

Monte Carlo simulation treats randomness by selecting variable values from a certain stochastic model. This method has become increasingly popular due to the computational power of our current technology which allows us to implement complex mathematical experiments intended to imitate real-life systems in areas such as finance, physics, computer science, etc.

Our Monte Carlo Simulation uses geometric Brownian motion as the building block for modeling stock prices considering stochastic volatility. Thus, the periodic return which is expressed in continuous compounding is a function of two components:

1. Constant drift 2. Random shock, i.e. volatility multiplied by a randomized critical z value

To this model we added the Euler Scheme in the Heston model type for stochastic volatility and as a result the drift which was supposed to be constant becomes a random variable of time. After performing m simulations, with the same process, we evaluate the payoff of the European call option at maturity for each simulation. The next step is to obtain an average payoff and discount it into the present to obtain today’s fair option price. Once the calculations are over we can then proceed to compare our price against the price suggested by the with the Black and Scholes formula. Finally, we plot the corresponding histogram for our simulated stock prices at time n to see the distribution. Based on that, we calculate the probabilities for the price to be in certain intervals to compare by simple sight whether it´s close to the strike price or not.

3

The idea of Monte Carlo

The Monte Carlo simulation is a well-known method to estimate Value at Risk (VaR) in regard to the asset class (i.e. basic equity or stocks). This basic simulation is just an application of the geometric Brownian motion which is a particular type of Wiener process. This stochastic process, in turn, models the random behavior of a stock price in continuous time. This geometric Brownian motion satisfies the following stochastic differential equation for continuous time and random variable:

dS t=μ S t dt+σ S t dW t (1)Where:

St= Stock price at time tμ= driftσ= volatilitydW t= Wiener process

However, our work in Excel simulates the future stock price measured in trading days. Therefore we adjust this equation for the discrete time case:

∆ St=St−1(μ∆ t+σε √∆ t ) (2)Where the new terms are:

∆ St= Change in the stock price per unit of time∆ t= Time interval. In our case one day ε= Standard normal random number

As one can note, in the right side of the equation, we have factored the stock price from the previous day letting the terms in parenthesis be the drift and shock successively.

It is important to remark that this geometric Brownian motion is a Markov process since the price of tomorrow only depends on today´s price and not the past. This property gives us some insight about market efficiency (even in its weak form), which tells that all the past information is already impounded in today´s price and the future price will depend solely on current and future events.

John Hull, in his book Options, futures, and other derivative securities, expresses our last formula as a lognormal continuously compounded periodic return of the stock (ln (S¿¿ t /St−1)¿), which is verified by the Ito´s Lemma. Consequently, this lognormal random variable will be approximately

normally distributed with mean (μ−σ2

2)t and variance σ 2t .That´s why we say that the price ratios

are lognormal making our geometric Brownian motion a lognormal diffusion process. The equivalent (and simpler) formula that we implement in our model is as follows:

ln (S¿¿ t /St−1)=αt+z tσ t ¿ (3)

Where:α= The deterministic component, driftz tσ= The stochastic component, where z twill be our generated random variable for the stock price which will be scaled by its correspondent stochastic volatility at time t.

4

This formula represents the core of our simulation. In this case, we set the daily expected return α t to be positive because we expect the stock price to drift upward, entailing a positive expected return over time. In a basic model α t is completely deterministic but it becomes a random variable as well since it depends on the stochastic volatility. Furthermore, we set the initial values for the stock price S0 and volatility σ 1 before starting the simulation. To calculate the stochastic volatility, we decided to implement the Heston model. The main reason for this choice is that there is an algorithm for time-discretization and Monte Carlo simulation of a Heston-type stochastic volatility model. This variant is called the Euler scheme, which allows us to calculate the stochastic volatility for the period in which the random stock price is generated. The formula is as follows:

σ t=σ t−1+κ (θ−σ t−1)∆ t+εt √σ t−1√∆ t (4)

Where:

κ ,θ = preset driftsε t = Standard normal random number at time t

The algorithm is based on a careful analysis of the properties of affine stochastic volatility diffusions and is straightforward and quick to implement and execute. Tests on realistic model parameterizations reveal that the computational efficiency and robustness of the simulation scheme compares very favorably to existing methods.

Coming back to (3), the stochastic component is what we´ve been calling the random shock which will be a function of both random stock price and random volatility. That is what allows us to model the stochastic process getting different paths each time.

5

Implementation in Excel

To start with, we need to show how each term of (3) is set as an input in the Excel sheet.

Expected Daily Drift (mean), α t : First, we set the value of the annual drift or expected return of the stock in one cell, then, in another cell we set the value of the daily drift which is simply calculated by dividing the annual drift by 252, considering that a year has 252 trading days. Finally, in another cell we convert this daily drift into an “expected” daily drift by subtracting one half of the variance at

time t. In simple math: daily drift - σ t2

2

, this is some sort of geometric average and since we are using

stochastic volatility, α can´t be a constant but now becomes a function of t as well, beginning with α 1 as the initial value. The reason for this calculation is that the stochastic volatility is eroding returns. This is due to the key assumption of the random walk idea: that returns are expressed in percentages. For example, let´s imagine that S0 is $100 and then goes up 10% to $110. Then goes back 10%, which nets S2to $99 ($110 x 90% = $99). Then it goes up 10% again, to net S3to $108.90 ($99 x 110% = $108.9). Finally, it goes down again 10% to net S4 to $98.01. It may be counter-intuitive, but the principal is slowly eroding even though the average gain is 0%. That difference is about half of the variance of St.

Expected Daily volatility, σ t: First, we set the value of the annual volatility or expected risk of the stock in one cell, then; in another cell we set the value of the initial daily volatility by dividing the annual volatility by the square root of 252 trading days. The square root is because volatility scales with the square root of time while variance scales with time directly. Next, we start running (4) to get the successive volatilities but before we set the deterministic drifts in (4) κandθ. To generate the standard normal random number ε t at time t i.e. we use an especial Excel function called: NORMSINV (RAND ()). Just RAND provides the probability between 0 and 1 and NORMSINV translates that into the inverse standard normal cumulative distribution, that will give generally a value between -3 and 3, this number appears in the cell named “N (0, 1) Vol”, the idea of this is that we get to randomize the next´s period volatility which will result after multiplying this number by √σ t−1√∆ t and later adding the remaining terms in (4) that are known. This process runs n times according to the number of nodes (time steps in trading days) we choose to have. Observe that all this is for just one simulation (iteration or single path).

Generated random variable for the stock price, z t: The process to generate ztis using NORMSINV (RAND ()) once again. We should usually get a random value between -3 and 3 as well and this number appears in the cell named “N (0, 1) Price”. Like ε t this process runs n times according to the number of nodes we choose to have. Observe that all this is for just one simulation.

Once we get these three variables for a single node t, we can apply (3) to get the lognormal return (ln (S¿¿ t /St−1)¿). Finally to get the simulated stock price for the next period, we simply multiply the current price at time by the exponential of the lognormal return. i.e. St=St−1∗e

ln(S¿¿t /St−1)¿

The routine generates m simulations which can be thought of as paths formed by n amount of nodes. Each of these nodes will have stochastic volatility inbuilt on to them.

6

Since the task is to obtain the payoff of a European call option today (t=0) our next step is to evaluate every nth stock price that came out as a final outcome of each simulation. The evaluation is based on the formula for the European call option payoff:

C (nth ,m )=max {Snth−K ,0 } (5) Where:

nth= Last node or time step.m = Number of simulations.C (nth ,m ) = The value of the call option at the last node which resulted from each of the m simulations or paths.Snth = The final stock price i.e. at the last node for each of the m simulations.K= The strike price which is a given constant.

As a result, we will have obtained m different payoffs. Consequently, we calculate the arithmetic mean of all the payoffs. The formula is as follows:

C=∑i=1

m C (nth ,m)n

(6)

Since that result is at time n in the future we discount it assuming a continuously compounded interest rate. The formula is as follows:

C0=C∗e−rn (7)

Where:

C0 = The European call option value at time 0 i.e. today.r = Risk-free interest raten = Total number of nodes or time steps in each simulation.

C0 represents our final result. The main purpose of the whole simulation was to come up with that option value at time 0. Therefore, this should be the “fair” price to pay for such security. To have a basis for comparison, we use the Black-Scholes formula to calculate the option price for the same stock with the same strike price and time n. Therefore we can see whether our result converges with Black-Scholes or not.

7

Black-Scholes Comparison

We have also implemented the Black-Scholes model to calculate the fair price of the stock to compare it with Monte Carlo simulation. The formula is for the Black Scholes Model is given by:

C0=S0 N (d1 )−K e−rt N (d2)

d1=ln( S0

K )+((r−q )+ σ2

2 )Tσ √T

d2=d1−σ √T

Where: S0 = The initial stock price K = The strike price σ = Volatility q= Dividend

The Black-Scholes formula is an equation of the market for an equity, in which the equity’s price is determined via a stochastic or random process. A Monte Carlo model is a method of estimating a value by the random generation of numbers. When used in conjunction random numbers are generated and fed into the Black-Scholes model. This model is executed repeatedly and the aggregate results are used to price the option.

8

Histogram Representation

The construction of both Probability Distribution and Stock Price Distribution histograms is very straight forward in Excel. Since the prices are calculated with the code in the first sheet; all the histogram sheet does is receive the data and filter it allowing us to count the frequency by which the stock prices show up. Knowing the frequency and the amount of stock prices calculated, the next step would be to determine the probabilities and plot them using the intervals selected. The page refreshes itself each time the simulation is executed and the histograms' speak for themselves showing the distribution of the simulated stock prices at time n. The page has the limitation of being customized for accepting 125 prices but it would only take the user a couple of adjustments to take under account as many inputs as desired.

9

Conclusion

In this project we have taken to the next level the basic Monte Carlo simulation to simulate stock prices. By considering stochastic volatility we have seen that the prices can really jump higher or lower and consequently give us a tremendous difference in payoffs for the call option.

Also in this experiment we have noticed that there is a large probability for such contract to go default. Because of that, the histogram doesn´t show a definite distribution. When comparing the call option´s fair price calculated using the Black-Scholes formula with our method can deviate quite a bit and sometimes get very close to Black-Scholes which may mean just a shot of luck.

We have addressed this problem for a long time but concluded that it may be because of two reasons:

First, since the volatility is stochastic, it makes the lognormal return of the stock completely random even randomizing the drift α which is constant in the simple model. Therefore the more nodes a single path takes, the closer to zero the stock price tends to be. This is because at some point the lognormal return is exceedingly negative making the stock price lose most of its value and for the next period it´s difficult that the simulation takes it back to a normal level since it depends on the price today. We thought that this was caused by negative random volatilities, but after making a restriction to that, we still came up with the same problem.

Second, in the Euler scheme, to calculate the stochastic volatility we introduced two new constants; Kappa and Theta; which we assigned values, but even trying with lower or higher values the volatility ends up at some point extremely high causing the phenomenon explained above.

In conclusion, the combination of three random values obtained for (3) ;which is our main equation; returns a very volatile and sometime even incoherent lognormal return at some point in the stock´s price path.

10

References

Hull, John C. Options, futures, and other derivative securities, 6th ed. Chapter 12: Wiener Processes and Ito's Lemma

http://www.javaquant.net/papers/LeifAndersenHeston.pdf

http://www.bionicturtle.com/learn/article/monte_carlo_simulation_with_gbm_frm_lo_141/

http://www.investopedia.com/articles/04/021804.asp

http://www.riskglossary.com/link/black_scholes_1973.htm

http://www.investopedia.com

http://www.wikipedia.org

11

Appendix

Visual Basic code

Sub CalculateButton_Click() Dim Simulations As Integer Dim Drift As Double Dim Volatility As Double Dim RandomNumberVolatility As Double Dim RandomNumberPrice As Double Dim i As Integer 'Simulations, days Dim j As Integer 'Nodes' Dim Gotoy As Integer Dim Gotox As Integer Dim StockPrice As Double Dim Payoff As Double Dim Stike As Double Dim IniDailyDrift As Double Dim ConstTheta As Double Dim ConstK As Double Dim FairPrice As Double Dim RiskFreeInterestRate As Double Sheets("sheet1").Activate FairPrice = 0'-----------Inputs-----------------------------' Simulations = Range("D3").Value Periods = Range("E3").Value StockPrice = Range("F3").Value Strike = Range("G3").Value Volatility = Range("H6").Value 'initial volatility t=1 DailyDrift = Range("I6").Value ' FIXED ExpectedDailyDrift = Range("J6").Value ' VARIABLE ConstTheta = Range("J3").Value ConstK = Range("K3").Value '--Main Funtion, Begin-------------------------' Gotoy = 10 Gotox = 12 If Simulations <= 5000 Then For i = 1 To Simulations For j = 1 To Periods RandomNumberPrice = Application.WorksheetFunction.NormSInv(Rnd()) 'Zt RandomNumberVolatility = Application.WorksheetFunction.NormSInv(Rnd()) 'Epsilont If (Volatility < 0) Or (Volatility > 0.2) Then Volatility = 0.01 End If Volatility = Volatility + ConstK * (ConstTheta - Volatility) + RandomNumberVolatility * Sqr(Volatility) Returni = ExpectedDailyDrift + Volatility * RandomNumberPrice ' Core formula logreturn ExpectedDailyDrift = DailyDrift - 0.5 * (Volatility) ^ 2 'alpha(t)= daily drift - 0,5*(volatility(t)^2) volatility must change StockPrice = StockPrice * Exp(Returni) 'Stock price for the next period

12

Cells(Gotoy, Gotox) = StockPrice Gotox = Gotox + 1 Next j Gotox = 12 Payoff = StockPrice - Strike ' call option payoff max{Sn-K,0} If Payoff < 0 Then Payoff = 0 End If FairPrice = Payoff + FairPrice Cells(Gotoy, 4).Value = i Cells(Gotoy, 5).Value = RandomNumberVolatility Cells(Gotoy, 6).Value = RandomNumberPrice Cells(Gotoy, 7).Value = Volatility Cells(Gotoy, 8).Value = Returni Cells(Gotoy, 9).Value = StockPrice Cells(Gotoy, 10).Value = Payoff Gotoy = Gotoy + 1 '-----------Restart Inputs For the New Simulation-----------------------------' Volatility = Range("H6").Value 'initial volatility t=1 DailyDrift = Range("I6").Value ' FIXED ExpectedDailyDrift = Range("J6").Value ' VARIABLE '-----------------------------------------------------------------------------' Next i '-----------Option Price Calculation-------------------------------------------' FairPrice = (FairPrice / Simulations) * e ^ (-Periods * RiskFreeInterestRate) Range("B5").Value = FairPrice '-----------------------------------------------------------------------------' Else MsgBox "It will only run for 5000" End IfEnd Sub

Sub ClearButton_Click() Dim AmountRandomNumber As Double Dim Gotoy As Integer Dim Gotox As Integer Simulations = Range("D3") Periods = 12 + Range("E3").Value Gotoy = 10 Sheets("sheet1").Activate Gotox = 4 Range("B5") = "" For x = 4 To Periods For i = 1 To Simulations Cells(Gotoy, Gotox) = "" Gotoy = Gotoy + 1 Next i Gotoy = 10 Gotox = Gotox + 1 Next x

13

End Sub

14