OPTION PRICING, JAVA PROGRAMMING AND MONTE CARLO SIMULATION



Similar documents
第 9 讲 : 股 票 期 权 定 价 : B-S 模 型 Valuing Stock Options: The Black-Scholes Model

The Black-Scholes Formula

Numerical Methods for Option Pricing

Caput Derivatives: October 30, 2003

An Introduction to Exotic Options

American and European. Put Option

Jorge Cruz Lopez - Bus 316: Derivative Securities. Week 11. The Black-Scholes Model: Hull, Ch. 13.

Monte Carlo Methods in Finance

Two-State Option Pricing

TABLE OF CONTENTS. A. Put-Call Parity 1 B. Comparing Options with Respect to Style, Maturity, and Strike 13

Exam MFE Spring 2007 FINAL ANSWER KEY 1 B 2 A 3 C 4 E 5 D 6 C 7 E 8 C 9 A 10 B 11 D 12 A 13 E 14 E 15 C 16 D 17 B 18 A 19 D

Options 1 OPTIONS. Introduction

Monte Carlo simulations and option pricing

Binomial lattice model for stock prices

DETERMINING THE VALUE OF EMPLOYEE STOCK OPTIONS. Report Produced for the Ontario Teachers Pension Plan John Hull and Alan White August 2002

Option Valuation. Chapter 21

On Black-Scholes Equation, Black- Scholes Formula and Binary Option Price

Pricing Barrier Option Using Finite Difference Method and MonteCarlo Simulation

Black-Scholes Equation for Option Pricing

A Comparison of Option Pricing Models

Option pricing. Vinod Kothari

Research on Option Trading Strategies

More Exotic Options. 1 Barrier Options. 2 Compound Options. 3 Gap Options

A SNOWBALL CURRENCY OPTION

Valuing Stock Options: The Black-Scholes-Merton Model. Chapter 13

BINOMIAL OPTION PRICING

1 The Black-Scholes Formula

Lecture 12: The Black-Scholes Model Steven Skiena. skiena

UCLA Anderson School of Management Daniel Andrei, Derivative Markets 237D, Winter MFE Midterm. February Date:

One Period Binomial Model

Option Values. Option Valuation. Call Option Value before Expiration. Determinants of Call Option Values

FINANCIAL ECONOMICS OPTION PRICING

Betting on Volatility: A Delta Hedging Approach. Liang Zhong

Practice Set #7: Binomial option pricing & Delta hedging. What to do with this practice set?

Financial Options: Pricing and Hedging

OPTIONS and FUTURES Lecture 2: Binomial Option Pricing and Call Options

Understanding Options and Their Role in Hedging via the Greeks

Mathematical Finance

Session X: Lecturer: Dr. Jose Olmo. Module: Economics of Financial Markets. MSc. Financial Economics. Department of Economics, City University, London

A Genetic Algorithm to Price an European Put Option Using the Geometric Mean Reverting Model

The Binomial Option Pricing Model André Farber

2. Exercising the option - buying or selling asset by using option. 3. Strike (or exercise) price - price at which asset may be bought or sold

Application of options in hedging of crude oil price risk

Finite Differences Schemes for Pricing of European and American Options

CS 522 Computational Tools and Methods in Finance Robert Jarrow Lecture 1: Equity Options

Notes on Black-Scholes Option Pricing Formula

Call Price as a Function of the Stock Price

QUANTIZED INTEREST RATE AT THE MONEY FOR AMERICAN OPTIONS

Institutional Finance 08: Dynamic Arbitrage to Replicate Non-linear Payoffs. Binomial Option Pricing: Basics (Chapter 10 of McDonald)

ACTS 4302 SOLUTION TO MIDTERM EXAM Derivatives Markets, Chapters 9, 10, 11, 12, 18. October 21, 2010 (Thurs)

Lecture 6: Option Pricing Using a One-step Binomial Tree. Friday, September 14, 12

An Introduction to Modeling Stock Price Returns With a View Towards Option Pricing

Chapter 11 Options. Main Issues. Introduction to Options. Use of Options. Properties of Option Prices. Valuation Models of Options.

Review of Basic Options Concepts and Terminology

Moreover, under the risk neutral measure, it must be the case that (5) r t = µ t.

Return to Risk Limited website: Overview of Options An Introduction

Black-Scholes Option Pricing Model

How to Value Employee Stock Options

Chapter 8 Financial Options and Applications in Corporate Finance ANSWERS TO END-OF-CHAPTER QUESTIONS

Assessing Credit Risk for a Ghanaian Bank Using the Black- Scholes Model

Valuing equity-based payments

Call and Put. Options. American and European Options. Option Terminology. Payoffs of European Options. Different Types of Options

Black-Scholes-Merton approach merits and shortcomings

Introduction to Binomial Trees

Lecture 21 Options Pricing

Hedging Illiquid FX Options: An Empirical Analysis of Alternative Hedging Strategies

Chapter 21 Valuing Options

VALUATION IN DERIVATIVES MARKETS

Chapter 13 The Black-Scholes-Merton Model

3. Monte Carlo Simulations. Math6911 S08, HM Zhu

Valuation of Razorback Executive Stock Options: A Simulation Approach

Lectures. Sergei Fedotov Introduction to Financial Mathematics. No tutorials in the first week

The Black-Scholes-Merton Approach to Pricing Options

Week 12. Options on Stock Indices and Currencies: Hull, Ch. 15. Employee Stock Options: Hull, Ch. 14.

FINANCIAL OPTION ANALYSIS HANDOUTS

where N is the standard normal distribution function,

Stochastic Processes and Advanced Mathematical Finance. Multiperiod Binomial Tree Models

Pricing Options Using Trinomial Trees

S 1 S 2. Options and Other Derivatives

Part V: Option Pricing Basics

Oscillatory Reduction in Option Pricing Formula Using Shifted Poisson and Linear Approximation

The Behavior of Bonds and Interest Rates. An Impossible Bond Pricing Model. 780 w Interest Rate Models

Hedging. An Undergraduate Introduction to Financial Mathematics. J. Robert Buchanan. J. Robert Buchanan Hedging

Lecture Notes: Basic Concepts in Option Pricing - The Black and Scholes Model

The interest volatility surface

American Options. An Undergraduate Introduction to Financial Mathematics. J. Robert Buchanan. J. Robert Buchanan American Options

DERIVATIVE SECURITIES Lecture 2: Binomial Option Pricing and Call Options

Options Pricing. This is sometimes referred to as the intrinsic value of the option.

Additional questions for chapter 4

Option Values. Determinants of Call Option Values. CHAPTER 16 Option Valuation. Figure 16.1 Call Option Value Before Expiration

The Black-Scholes pricing formulas

Valuation of Asian Options

Pricing Barrier Options under Local Volatility

Finance 436 Futures and Options Review Notes for Final Exam. Chapter 9

Option Pricing with S+FinMetrics. PETER FULEKY Department of Economics University of Washington

Four Derivations of the Black Scholes PDE by Fabrice Douglas Rouah

How To Value Real Options

Valuing Coca-Cola and Pepsi Options Using the Black-Scholes Option Pricing Model

Risk-Neutral Valuation of Participating Life Insurance Contracts

Transcription:

OPTION PRICING, JAVA PROGRAMMING AND MONTE CARLO SIMULATION NITESH AIDASANI KHYAMI Abstract. Option contracts are used by all major financial institutions and investors, either to speculate on stock market trends or to control their level of risk from other investments. Pricing options correctly is the key to success for many investment portfolios. The purpose of this project is to illustrate how Java programming and Monte Carlo simulations can be used to price options correctly for different set of assumptions concerning the behaviour of stock returns. Contents 1. Introduction: What are options? 1 2. The Black-Scholes Model 3 3. Model of the Behaviour of the Stock Prices 4 4. Numerical Procedures 8 4.1. Binomial Method 8 4.2. Monte Carlo Method 13 5. Conclusion 19 References 21 1. Introduction: What are options? Throughout this project we use the term asset to describe any financial object whose value is known at present but is liable to change in the future. Typical examples are shares in a company, commodities such as gold, oil or electricity, currencies, for instance the value of 10 in US dollars. There are two basic types of options, a call option and a put option. 1

2 NITESH AIDASANI KHYAMI Definition 1. A call option gives the holder the right to buy the underlying asset by a certain date for a certain price. A put option gives the holder the right to sell the underlying asset by a certain date for a certain price. The price in the contract is known as the exercise price, denoted by K, and the date in the contract is known as the maturity, denoted by T. European options can be exercised only on maturity itself. American options can be exercised at any time up to maturity. To illustrate the idea, consider the situation where an investor writes you a European call option that gives you, the holder of the option, the right to buy 500 shares in Sun Microsystems for 5000 a year from now. After a year has passed, i.e. at maturity, the exercise price for the 500 shares can take the following three possible values: (1) K > 5000. (2) K = 5000. (3) K < 5000. If you are fortunate enough for the exercise price to have taken path (1), then you would exercise your right to buy the shares from the investor since you can sell them immediately at K and make a profit of (K 5000). If the exercise price has taken path (2), then you are in a no profit - no loss situation you can exercise the right to buy the shares but they can also be bought from the share market at the same price. However, if the exercise price has taken path (3), then you would not exercise your right to buy the shares since you could buy them at a cheaper price from the share market. One should note that an option gives the holder the right to buy or sell shares, and thus, the holder does not have to exercise this right if he/she does not want to. As a result, the holder of the option never loses money. However, the investor who wrote the option does not get paid at maturity and can theoretically lose an unlimited amount of money. To make the deal fairer, the holder is required to pay the investor (who wrote the option) for buying the option. The amount of money paid to purchase the option is known as value of the option. But how do we compute the fair value of an option? The answer of this question lies in the following few chapters where we will discussing the much celebrated Black-Scholes formula.

OPTION PRICING, JAVA PROGRAMMING AND MONTE CARLO SIMULATION 3 2. The Black-Scholes Model The Black-Scholes Model was developed in the early 1970s by Fischer Black, Myron Scholes and Robert Merton. This model plays a vital role in the pricing and hedging of options. It has also been pivotal to the growth and success of financial engineering in the 1980s and the 1990s. In 1997, Myron Scholes and Robert Merton were awarded the Nobel prize in economics for developing the Black-Scholes model. Unfortunately, Fischer Black had died in 1995, otherwise he also would have been one of the recipients. The Black-Scholes formulas for the price at time zero of a European call option on a non-dividend-paying stock and a European put option on a non-dividend-paying stock are (2.1) c = S 0 N(d 1 ) Ke rt N(d 2 ) (2.2) p = Ke rt N( d 2 ) S 0 N( d 1 ) where d 1 = ln(s 0/K) + (r + σ 2 /2)T σ T d 2 = ln(s 0/K) + (r σ 2 /2)T σ T = d 1 σ T and N(x) is the cumulative probability distribution function for a variable that is normally distributed with a mean of zero and a standard deviation of 1. We also have that c is the price of the European call option, p is the price of the European put option, S 0 is the stock price, K is the strike price, r is the continuously compounded risk-free rate, σ is the stock price volatility, and T is the time to maturity of the option. Example 2. Consider the situation where the stock price six months from the expiration of an option is 42, the exercise price of the option is 40, the risk-free interest rate is 10% per annum, and the volatility is 0.2 per annum. What is the price of the European call and put option? We have that S 0 = 42, K = 40, r = 0.1, σ = 0.2, T = 0.5, d 1 = ln(42 /40 ) + (0.1 + 0.2 2 /2 ) 0.5 0.2 0.5 d 2 = ln(42 /40 ) + (0.1 0.2 2 /2 ) 0.5 0.2 0.5 = 0.7693 = 0.6278

4 NITESH AIDASANI KHYAMI and K e rt = 40 e 0.05 = 38.049. Now, if the option is a European call, then its value, c, is given by c = 42N (0.7693 ) 38.049N (0.6278 ) = 4.76. If the option is a European put, its value, p, is given by p = 38.049N ( 0.6278 ) 42N ( 0.7693 ) = 0.81. One of the aims of the project was to use Java to create a visual object to calculate the Black-Scholes price of a European option. The heart of the Java program, i.e. the code that uses the Black-Scholes formula for calculating the price of the option, has been shown below 1. Figure 1 shows a still image of this visual object. //Calculates d1 and d2 d1 = (Math.log(stockPrice/exercisePrice) + (interest + Math.pow(volatility, 2)/2)*maturity)/(volatility*Math.sqrt(maturity)); d2 = (Math.log(stockPrice/exercisePrice) + (interest - Math.pow(volatility, 2)/2)*maturity)/(volatility*Math.sqrt(maturity)); //Checks if the option is a call or put option and hence, calculates the value of the //option using the Black-Scholes formula if(callselected) result = (stockprice*blackscholes.normalcdf(d1)) - (exerciseprice*math.exp(-interest*maturity)*blackscholes.normalcdf(d2)); else result = (exerciseprice*math.exp(-interest*maturity)*blackscholes.normalcdf(-d2)) - (stockprice*blackscholes.normalcdf(-d1)); //Display result output.settext(precision4.format(result)); 3. Model of the Behaviour of the Stock Prices Let s consider the following equation from Hull [1], p226: (3.1) ds(t) = rs(t)dt + σs(t)dw t for every t [0, T ] where σ is the volatility of the stock price, r is the expected rate of return, S(t) is the asset price at time t and dw t is a Wiener process. Both r and σ are assumed to 1 Matching parentheses have been coloured to improve readability of the code.

OPTION PRICING, JAVA PROGRAMMING AND MONTE CARLO SIMULATION 5 Figure 1. Calculation of the Black-Scholes Price of European Options be constant. A Wiener process is a particular type of Markov stochastic process with a mean change of zero and a variance rate of 1.0. Expressed formally, a variable W t follows a Wiener process if it has the following two properties: (1) The change W t during a small period of time t is W t = ɛ t where ɛ is a random drawing from a standardized normal distribution, φ(0, 1). (2) The values of W t for any two different short intervals of time t are independent. Equation 3.1 is the most widely used model of stock price behaviour. This model is known as geometric Brownian motion. The solution to equation 3.1 is (3.2) σ2 (r S(t) = S(0)e 2 )t+σwt. The discrete-time version of the model is S k t = rs k t t + σs k t W k t where S k t = S (k+1) t S k t 0 k N 1 t = T N. Thus, we have that our discrete-time model is

6 NITESH AIDASANI KHYAMI (3.3) S (k+1) t = S k t + rs k t t + σs k t W k t = S k t + rs k t t + σs k t ɛ t One assumption in our model above that is clearly not true is that the volatility is constant. Consider the following model taken from Hull [1], p447, ds t = rs t dt + Y t S t dw t dy t = λ(µ Y t )dt + ξy t db t where λ, µ and ξ are constants, and dw t and db t are Wiener processes. The variable, Y t, in this model is the asset s variance rate. This is the square of its volatility. The discrete-time version of the this model is S k t = rs k t t + Y k t S k t W k t where Y k t = λ(µ Y k t ) t + ξy k t B k t S k t = S (k+1) t S k t Y k t = Y (k+1) t Y k t 0 k N 1. Thus, we have that our discrete-time model is (3.4) S (k+1) t = S k t + rs k t t + Y k t S k t W k t Y (k+1) t = Y k t + λ(µ Y k t ) t + ξy k t B k t One of the aims of the project was to use Java applets to create graphs of simulated paths of the processes for the price of the underlying asset, both in the case of constant volatility and when it is a stochastic process. In addition, we also had to create graphs of simulated paths for the volatility (as a stochastic process). In the limit as t 0, the discrete-time model 3.3 becomes the continuous-time model 3.1. Figure 2, 3 and 4 shows still images of how the discrete-time curve approaches the continuous-time curve as t 0, i.e. as N. The red curve is a sketch of the continuous-time model and the yellow curve is a sketch of the discrete-time model.

OPTION PRICING, JAVA PROGRAMMING AND MONTE CARLO SIMULATION 7 Figure 2. N = 10 Figure 3. N = 100 Figure 4. N = 1000

8 NITESH AIDASANI KHYAMI 4. Numerical Procedures In this chapter we will be discussing two numerical procedures that can be used to value options when no analytical formula is available. These two procedures are called the binomial method and the Monte Carlo method. 4.1. Binomial Method. In this method we divide the life of an option into N intervals each of length t. Hence, we let t = T/N, where T is maturity date. In addition, one important assumption in the binomial method is that at each time interval, the stock price either moves up by a factor of u and probability p or down by a factor of d and probability 1 p. The following formulae for u, p and d are taken from Hull [1], p390, p = er t d u d u = e σ t d = 1 u = e σ t and are necessary for valuing the option. The value of the option is calculated by starting at the end of the tree, at time T, and working backwards. We will refer to the jth node at time i t as the (i, j) node (0 i N, 0 j i). Define f i,j as the value of the option at the (i, j) node. At time i t there are i + 1 possible values for the stock price. These are S 0 u j d i j j = 0, 1,..., i. For the final nodes, i.e. the nodes at time T (= N t), the value of a put option at node j is calculated by the formula max(k S 0 u j d N j, 0). Once we have calculated the value of the option at all of the N + 1 nodes at time N t, we move to time (N 1) t. Here we calculate the value of the option at all N nodes by using the formula 2 f i,j = e r t[ ] (4.1) pf i+1,j+1 + (1 p)f i+1,j 0 i N 1 0 j i. 2 This formula only applies for a European option. In the case of an American option, we also have to check at each node to see whether early exercise is preferable to holding the option for a further time period t.

OPTION PRICING, JAVA PROGRAMMING AND MONTE CARLO SIMULATION 9 Once we have calculated the value of the option at all of the N nodes at time (N 1) t, we move to time (N 2) t. Here we calculate the value of the option at all N 1 nodes by again using the equation 4.1. We keep repeating this algorithm until we reach time 0, where the value of the option at this time will be the actual value of the put option. The best way to understand this algorithm is to go through a worked example. Example 3. Consider a three year European put option on a non-dividend-paying stock when the stock price is 9, the strike price is 10, the risk-free interest rate is 6% per annum, and the volatility is 0.3. Suppose that we divide the life of the option into four intervals of length 0.75 years. Thus, we have that S 0 = 9 K = 10 r = 0.06 T = 3 σ = 0.3 t = 0.75 and u = e σ t = e 0.3 0.75 = 1.297 p = er t d u d d = e σ t = e 0.3 0.75 = 0.771 1 p = 0.477. = e0.06 0.75 0.771 0.525 = 0.523 Figure 5 shows the binomial tree for this example. Each node has a formula, like S 0 u 4, and a number, like 6.816. The formula is the stock price at that node and the number is the value of the option at that node. The value of the option at time T is calculated by the formula max(k S 0 u j d N j, 0 ). For example, in the case of node A (i = N = 4, j = 0) in Figure 5, we have that the value of the option is f 4,0 = max(k S 0 u j d N j, 0 ) = max(10 (9 1.297 0 0.771 4 ), 0 ) = max(10 3.184, 0 ) = max(6.816, 0 ) = 6.816

10 NITESH AIDASANI KHYAMI Figure 5. Tree used to value a stock option For all the other nodes, i.e. all the nodes except the final ones, the value of the option is calculated using equation 4.1. For example, in the case of node B (i = 3, j = 1) in Figure 5, we have that the value of the option is f 3,1 = e r t[ ] pf 3 +1,1 +1 + (1 p)f 3 +1,1 = e [ ] 0.06 0.75 0.523f 4,2 + 0.477f 4,1 = 0.956 [ (0.523 1 ) + (0.477 4.647 ) ] = 0.956 [ 0.523 + 2.217 ] = 0.956 2.740 = 2.619 Similarly, for the case of node C (i = j = 0), we have that the value of the option is

OPTION PRICING, JAVA PROGRAMMING AND MONTE CARLO SIMULATION 11 f 0,0 = e r t[ ] pf 0 +1,0 +1 + (1 p)f 0 +1,0 = e [ ] 0.06 0.75 0.523f 1,1 + 0.477f 1,0 = 0.956 [ (0.523 0.753 ) + (0.477 2.438 ) ] = 0.956 [ 0.394 + 1.163 ] = 0.956 1.557 = 1.488 This is a numerical estimate for the option s current value of 1.473. In practice, a smaller value of t, and many more nodes, would be used. Table 1 gives all the formulae that are needed to value a European and an American, call and put option, using the binomial method. Option type Formulae for Calculating Value of Option European put f N,j = max(k S 0 u j d N j, 0) j = 0, 1,..., N f i,j = e r t[ pf i+1,j+1 + (1 p)f i+1,j ] 0 i N 1 0 j i European call f N,j = max(s 0 u j d N j K, 0) j = 0, 1,..., N f i,j = e r t[ pf i+1,j+1 + (1 p)f i+1,j ] 0 i N 1 0 j i American put f N,j = max(k S 0 u j d N j, 0) j = 0, 1,..., N f i,j = max {K S 0 u j d i j, e r t[ ] } pf i+1,j+1 + (1 p)f i+1,j 0 i N 1 0 j i American call f N,j = max(s 0 u j d N j K, 0) j = 0, 1,..., N f i,j = max {S 0 u j d i j K, e r t[ ] } pf i+1,j+1 + (1 p)f i+1,j 0 i N 1 0 j i Table 1. Table for Calculating Value of Options One of the aims of the project was to use Java to create a visual object to estimate the price of a European and an American option using the binomial method. The

12 NITESH AIDASANI KHYAMI heart of the Java program, i.e. the code that uses the binomial method for estimating the price of the option, has been shown below. Figure 6 shows a still image of this visual object. //Calculate the underlying asset price at each of the nodes in the binomial tree public void calculatenodeprice(double[][] nodearray){ int last = nodearray.length - 1; for(int i = 0; i <= last; i++){ for(int j = 0; j <= i; j++){ nodearray[i][j] = stockprice*math.pow(up,j)*math.pow(down,i-j); } } } //Calculate the option price at each of the nodes in the binomial tree public void calculateoptionvalue(double[][] optionprice){ int last = optionprice.length - 1; //Calculate the option price at the final nodes in the binomial tree for(int i = 0; i <= last; i++){ if(callselected) //Call option optionprice[last][j] = Math.max(nodePrice[last][j] - exerciseprice, 0); else //Put option optionprice[last][j] = Math.max(exercisePrice - nodeprice[last][j], 0); } //Calculate the option price at the remaining nodes in the binomial tree for(int i = last - 1; i >= 0; i--){ for(int j = 0; j <= i; j++){ if(europeanselected){ //European put or call option optionprice[i][j] = Math.exp(-interest*deltaT)* (prob*optionprice[i+1][j+1] + (1 - prob)*optionprice[i+1][j]); } else if(!europeanselected && callselected){ //American call option optionprice[i][j] = Math.max(nodePrice[i][j] - exerciseprice, Math.exp(-interest*deltaT) * (prob*optionprice[i+1][j+1] + (1 - prob)*optionprice[i+1][j])); } else{ //American put option optionprice[i][j] = Math.max(exercisePrice - nodeprice[i][j],

OPTION PRICING, JAVA PROGRAMMING AND MONTE CARLO SIMULATION 13 } } } } Math.exp(-interest*deltaT) * (prob*optionprice[i+1][j+1] + (1 - prob)*optionprice[i+1][j])); Figure 6. Estimation of the Price of European and American Options using the Binomial Method 4.2. Monte Carlo Method. We now move on to the second numerical method called the Monte Carlo Method. We estimate the price of a European-style option by generating M independent sample values, X 1, X 2,..., X M, of the payoff from the option in a risk-neutral world. We then calculate the mean of the sample payoffs to obtain an estimate of the expected payoff. Finally, we discount the expected payoff at risk-free interest rate to get an estimate of the value of the option. This method is best understood by an example. Example 4. Let us use the Monte Carlo method to estimate the value of a European call option. To do this, we need two very important formulae. The first one will tell

14 NITESH AIDASANI KHYAMI us the asset price at maturity, and the second one will tell us the value of the option at maturity. These two formulae are as follows (4.2) S(T ) = S(0 )exp [(r σ2 2 = S(0 )exp [(r σ2 2 )T + σw T ] ) T + σɛ ] T where ɛ N(0, 1) (4.3) value of option at maturity = max(s(t ) K, 0 ). Now our Monte Carlo algorithm for estimating the value of the option is as follows for i = 1 to M end compute an N(0,1) sample ɛ i σ2 [(r set S i = S 0 e 2 )T +σɛ i T ] set X i = max(s i K, 0) set Mean = 1 M M i=1 X i set Estimate Of Value Of Option = e rt Mean It is important to understand and realize that there is no need to apply the Monte Carlo method in this particular example since the Black-Scholes formula gives us the exact solution. However, there are many complicated situations where we will not have formulae analogue to the Black-Scholes formula. Such is a situation is presented in the following few paragraphs. Now before we investigate this situation, let s have a look at the error of the Monte Carlo estimate of the value of the option. We know from Hull [1], p410, that the error of this estimate is ω M where ω is the standard deviation of the sample payoffs. This means that the error in the value of the option is inversely proportional to the square root of the number of trials. Thus, if we wish to double the accuracy of our estimate, we have to increase the number of trials by a factor of 4. Thus, a very large value of M is needed to estimate the value of the option to a reasonable accuracy. This makes the Monte Carlo method computationally very time consuming. 3 However, there are several 3 Another drawback of the Monte Carlo method is that it cannot easily handle situations where there are early exercise opportunities, like for example in the case of American options.

OPTION PRICING, JAVA PROGRAMMING AND MONTE CARLO SIMULATION 15 methods which can be used to reduce the variance which can lead to a considerable decrease in the computation time. One such method which we will be investigating is called the Antithetic Variate Technique. 4.2.1. Antithetic Variate Technique. The algorithm for the antithetic variate technique is very similar to the Monte Carlo algorithm given above. The main difference is that before we estimated the price of a European-style option by generating M independent sample values, X 1, X 2,..., X M, of the payoff from the option by using M random N(0, 1) samples, ɛ 1, ɛ 2,..., ɛ M. In the antithetic variable technique, we will be generating 2M sample values, X 1, X 2,..., X M and X 1, X 2,..., X M. If X i is calculated using ɛ i, then X i is calculated using ɛ i. In addition, before we calculated the mean of the X i s but now, with the antithetic variates, we calculate the mean of the X i s, where X i = 1(X 2 i + X i ). Example 5. Below is the corresponding antithetic variate version of the algorithm in example 4. for i = 1 to M end compute an N(0,1) sample ɛ i σ2 [(r set S i = S 0 e 2 )T +σɛ i T ] σ2 [(r set S i = S 0 e 2 )T σɛ i T ] set X i = max(s i K, 0) set X i = max(s i K, 0) set X i = 1 2 (X i + X i ) set Mean = 1 M M i=1 X i set Estimate Value Of Option = e rt Mean Another important part of the project was to write a Java program for pricing options using Monte Carlo simulations for a specified volatility model(mean-reverting). The mean-reverting volatility model was shown in equation 3.4. It is as follows (4.4) S (k+1) t = S k t + rs k t t + Y k t S k t W k t Y (k+1) t = Y k t + λ(µ Y k t ) t + ξy k t B k t where λ, µ and ξ are constants, and dw t and db t are Wiener processes. The variable, Y t, in this model is the asset s variance rate. This is the square of its volatility. We

16 NITESH AIDASANI KHYAMI also have that 0 k N 1 t = T N. This is an example of a situation where we have no analytical formulae, but a recurrence relation. In situations alike this one, the Monte Carlo method is very helpful. The pseudocode for the mean-reverting model using Monte Carlo simulations is as follows 4 for i = 1 to M end for j = 0 to N 1 end compute an N(0,1) sample ɛ 1 compute an N(0,1) sample ɛ 2 set Y j+1 = Y j + λ(µ Y j ) t + ξy j ɛ 1 t set Y j+1 = Y j + λ(µ Y j ) t ξy j ɛ 1 t set S j+1 = S j (1 + r t + Y j ɛ 2 t) set S j+1 = S j (1 + r t Y j ɛ 2 t) if option = call set X i = max(s N K) set X i = max(s N K) otherwise end if set X i = max(k S N ) set X i = max(k S N ) set X i = 1 2 (X i + X i ) set Mean = 1 M M i=1 X i set Estimate Value Of Option = e rt Mean Once the above pseudocode was implemented in Java, the program was used to predict prices of two options and hence, the results were compared with the actual 4 Note that Y 0 = µ.

OPTION PRICING, JAVA PROGRAMMING AND MONTE CARLO SIMULATION 17 option prices. The two call options, Barclays and Marks and Spencer, were taken from LIFFE(International Financial Futures and Options Exchange in London). Tables 2 and 3 show the data for the two call options. Tables 4 and 5 show the results produced along with the percentage error between the predicted and the actual option prices. Name of option Option type Marks & Spencer Call Option Strike Price ( ) 130 Start Date 15/11/00 Expiry Date 29/12/00 Interest rate (%) 6 µ 0.133542407 λ 0.43208172 ξ 2.271729357 Table 2. Data for Marks and Spencer Call Option Name of option Option type Barclays Call Option Strike Price ( ) 1050 Start Date 9/11/00 Expiry Date 17/01/01 Interest rate (%) 6 µ 0.105011209 λ 1.07073792 ξ 1.989763468 Table 3. Data for Barclays Call Option I believe that my program produced quite accurate results since the average error was less than 1% in both cases(0.856% for the Marks and Spencer option and 0.151% for the Barclays option).

18 NITESH AIDASANI KHYAMI Date Option Price Stock Price Days to Predicted Option error ( ) ( ) Maturity Price ( ) (%) 15/11/00 63.500 192.000 29 63.040 0.724 16/11/00 64.500 193.000 28 64.000 0.775 17/11/00 62.500 191.000 27 62.086 0.662 20/11/00 60.000 188.500 26 59.343 1.095 21/11/00 67.500 196.000 25 67.095 0.600 22/11/00 58.500 187.000 24 57.935 0.966 23/11/00 59.500 188.000 23 58.989 0.859 24/11/00 65.000 193.500 22 64.216 1.206 27/11/00 61.500 190.000 21 60.504 1.620 28/11/00 67.000 196.000 20 66.596 0.603 29/11/00 65.000 194.000 19 64.334 1.025 30/11/00 66.500 195.500 18 66.053 0.672 01/12/00 67.000 196.000 17 66.528 0.704 06/12/00 64.500 193.500 16 63.840 1.023 07/12/00 63.000 192.000 15 62.371 0.998 08/12/00 64.000 193.000 14 63.475 0.820 11/12/00 61.000 190.000 13 60.334 1.092 12/12/00 59.000 188.000 12 58.381 1.049 13/12/00 57.500 186.500 11 56.866 1.103 14/12/00 65.000 194.000 10 64.330 1.031 15/12/00 58.000 187.000 9 57.319 1.174 18/12/00 60.500 190.000 8 60.273 0.375 19/12/00 62.000 191.500 7 61.718 0.455 20/12/00 62.000 191.500 6 61.607 0.634 21/12/00 60.000 189.500 5 59.570 0.717 22/12/00 59.500 189.000 4 59.093 0.684 27/12/00 64.500 194.000 3 64.113 0.600 28/12/00 59.500 189.000 2 59.065 0.731 29/12/00 56.500 186.000 1 56.027 0.837 Table 4. Comparison of Actual and Predicted Value of Marks and Spencer Call Option

OPTION PRICING, JAVA PROGRAMMING AND MONTE CARLO SIMULATION 19 Date Option Price Stock Price Days to Predicted Option error ( ) ( ) Maturity Price ( ) (%) 9/11/00 957.000 1995.000 45 956.886 0.012 10/11/00 972.000 2010.000 44 967.414 0.472 13/11/00 896.500 1935.000 43 898.547 0.228 14/11/00 906.000 1945.000 42 902.737 0.360 15/11/00 899.000 1938.000 41 898.149 0.095 16/11/00 904.000 1943.000 40 905.459 0.161 17/11/00 913.500 1953.000 39 915.269 0.194 20/11/00 919.000 1959.000 38 918.479 0.057 21/11/00 905.000 1945.000 37 906.962 0.217 22/11/00 820.000 1860.000 36 820.579 0.071 23/11/00 820.500 1861.000 35 821.129 0.077 24/11/00 847.500 1888.000 34 846.424 0.127 27/11/00 875.000 1916.000 33 874.472 0.060 28/11/00 858.000 1899.000 32 857.477 0.061 29/11/00 833.500 1875.000 31 833.376 0.015 30/11/00 935.500 1977.000 30 935.065 0.046 1/12/00 933.500 1975.000 29 930.206 0.353 6/12/00 927.500 1970.000 28 926.382 0.121 7/12/00 917.000 1960.000 27 918.475 0.161 8/12/00 940.000 1983.000 26 939.969 0.003 11/12/00 985.500 2029.000 25 987.501 0.203 12/12/00 942.500 1986.000 24 942.084 0.044 13/12/00 1044.000 2088.000 23 1045.767 0.169 14/12/00 971.000 2015.000 22 971.828 0.085 15/12/00 981.000 2025.000 21 978.142 0.291 18/12/00 1047.500 2093.000 20 1050.121 0.250 Table 5. Comparison of Actual and Predicted Value of Barclays Call Option 5. Conclusion In this project we have discussed some of the basic aspects of option pricing and how we utilize the Black-Scholes formula when we have an analytical formula. Analytic solutions, are, of course, only one side of the coin. If we have efficient numerical

20 NITESH AIDASANI KHYAMI algorithms to find the solution, the lack of an analytic solution does not constitute a serious hindrance. We showed that the Monte Carlo method using antithetic variates can produce very accurate results, despite the fact that sometimes the speed of convergence can be quite slow. There are other numerical methods which can also be used such as finite difference methods and high-accuracy PDE methods. One of the main questions that rose in mind after the completion of this project was whether the stochastic volatility processes discussed in this project can adequately describe the market. I believe that the answer to this question is much more complex than what one might think at first. Part of the difficulty is defining what the initial volatility actually means. The shortest time period over which average volatility figures are available is 10 days. This means that the initial volatility is essentially known only in a very imprecise manner. The situation gets worse when we consider that most option trading occurs just a few days before maturity. The time period over which volatility data is collected and distributed by the exchanges and financial information agencies such as Reuters and Bloomberg has been set by convention and is not really binding. Therefore, it is still possible to directly analyze the trades to obtain short term volatility information. Hence, any meaningful empirical study will necessarily be large scale and involve considerable effort.

OPTION PRICING, JAVA PROGRAMMING AND MONTE CARLO SIMULATION 21 References [1] John C. Hull: Options, Futures and Other Derivatives. Prentice Hall, 2000 [2] Desmond J. Higham: An Introduction to Financial Option Valuation. Cambridge University Press, 2004 [3] Edited by Bruno Dupire: MONTE CARLO, Methodologies and Applications for Pricing and Risk Management. Risk Books, 1998 [4] H. M. and P. J. Deitel: Java, How to Program. Prentice Hall, 2002 [5] Helmut Kopka and Patrick W. Daly: A Guide to L A TEX 2ε. Addison-Wesley, 1995