The below demonstrates the applications developed for a Summer project, undertaken during June-July 2005. This follows on from the findings of a previous project, which I have not included here. The text is of a similar style to my report and tries to justify the methods I have used. Although I have since discovered that a few of my assumptions regarding exercise boundaries do not in fact hold, I do feel that the programs below are useful and the estimates given still reasonably precise.
You will need Java version 5 (1.5.0_08) or higher installed to run these programs.
To go back to my homepage, click here.
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.
American options form the majority of those traded today. The aim of this project is to attempt to price various options, particularly American options, by simulating the price of the underlying asset over the specified time period. Monte Carlo methods can be used to obtain an estimate of the option price.
From now, let St := St(ωi) represent the price of an asset at time t when the path follows the sample point ωi ∈ Ω. To use Monte Carlo in this way, we will need to simulate M stock price paths, St(ω1), …, St(ωM) over the time period [0, T]. We can obtain the payoff, hT := h(ST(ωi)) of the option when the stock price is associated with ωi. As before, we can find the mean of the sample payoffs to obtain our estimate of the expected payoff, then discount this value at the risk-free interest rate in order to estimate the value of the option.
We shall consider the price of an asset over a finite set of N+1 evenly-spaced dates 0 = t0, t1, …, tN = T, where tj = jΔt is the time of the jth observation. We will use the equation below to obtain the price of the asset following ωi at time tj, using the parameters for initial stock price S0, exercise price K, risk-free interest rate r, volatility σ and time to maturity T. From now, we shall assume that volatility is fixed. We can extend the model to include stochastic volatility once a suitable model has been found. Moreover, we shall simulate M paths and not use, say, the Antithetic Variable Technique for now.
As before, dWt is a Wiener process.
We shall assume the options below are European in that they can only be exercised at maturity time. The payoffs for each option are given in table 2. Here, S, Smax and Smin denote the average maximum and minimum values of a particular stock price path over the set of times {t0, t1, …, tN}. By increasing the value of N (that is, letting Δt → 0), the path is observed more frequently, almost leading to the appropriate values over the continuous interval [0,T].
| Option type | Option payoff |
| Asian call | max(S - K, 0) |
| Asian put | max(K - S, 0) |
| Lookback call | max(Smax - K, 0) |
| Lookback put | max(K - Smin, 0) |
| Floating lookback call | max(ST - Smin, 0) |
| Floating lookback put | max(Smax - ST, 0) |
Table 2. Payoffs from various path-dependent options.
The program below attempts to price a path-dependent option when given S0, K, r, σ, T, the number of paths to simulate, M and the number of intervals over the half-open interval (0,T]. It is possible to select the desired time-period and the option type using the drop-down boxes. Once again, one should note that percentages need to be specified as values between 0 and 1.
The program then proceeds by simulating M stock price paths, finding the payoff (dependent on the option type chosen), h(ωi), and taking the present value of each. It then estimates the mean and variance of these values to obtain an estimate of the option price, along with a 95% confidence interval. By increasing M, we can obtain a smaller confidence interval.
When pricing European options by simulation, we only need to consider the payoff from exercising at maturity time. However, pricing an American option depends on the expected payoff over the entire interval.
Again, we consider N+1 equally-spaced dates where exercise is possible (such options are in fact called Bermudan options). Increasing N means exercise becomes possible at almost any point over [0,T]. We assume that the current asset price for a particular path, St(ωi) is Ft-measurable, meaning that prices are formed on the basis of past and present prices. We say that that St (and functions of it) are adapted to the filtration {Ft | 0 ≤ t ≤ T}. Some useful properties (with their proofs), related to the conditional expectation of such adapted sequences, are given in Bingham and Kiesel [8], p51-53. A particularly important property is given below.
Let the stochastic variable Yt be adapted to {Ft}.
Now let Zt = Z(St) denote the payoff from exercising the option at time t, if we haven't already done so, and ht = h(St) the price of the option at the same time. At maturity time, since this is the final opportunity to exercise, the payoff at this time is the same as that for a European option.
At time step tj-1 < T, the option holder can either exercise now or wait until after the next time step tj, the value of the option then being the expected value of the payoff at that time. Since the option holder wishes to maximise their payoff, the option price at time tj-1 is the following.
By using backward induction (see Lamberton and Lapeyre [7], p11) and taking the present value at time 0, we obtain the following supermartingale. The solution to the dynamic programming (DP) recurrence is obtained by finding h0. The next objective is then to obtain a martingale from this sequence, in order to price American options.
| e-rThT | = e-rTZT |
| e-r(j-1)Δthtj-1 | = max( e-r(j-1)ΔtZtj-1 , e-rjΔtE(htj | Ftj-1) ) j = 1, …, N (4) |
We define a stopping time ν to be a random variable taking values in {t0, t1, …, tN} where the following holds.
In the case of American options, ν can be thought of as the time exercise takes place (the time the sequence defined by (4) stops). In the case ν = tk, the present value of the option price at time tj, when exercise takes place at time tk is given by the following.
| e-rjΔthνtj | = e-rjΔthtj | j = 0, 1, …, k-1 |
| e-rjΔthνtj | = e-rjΔthtk | j = k, k+1, …, N |
Now let τ = inf{ν | e-rνhν = e-rνZν}. From Lamberton and Lapeyre [7], τ is the smallest optimal stopping time - the earliest time over {t0, t1, …, tN} where exercise is optimal. It turns out that the sequence of discounted option prices stopped at time τ is a martingale, giving the following result.
With this result, the next objective is to find the smallest optimal stopping time, which we can use to find the present value of the option at time τ and, hence, the price of American options.
For a given stock price path St(ωi), the smallest optimal stopping time is the point the option should be exercised. It is the earliest point where the option price at time τ is the payoff from exercise at that time. We need to determine an suitable stopping rule in order to determine the best time of exercise for each simulated stock price path. Chapter 8 of Glasserman [6] suggests forming an optimal exercise boundary, b*t. For each simulated path, the optimal stopping time τ is the following.
| τ = inf{ν | Sν ≥ bν} for a call option |
| τ = inf{ν | Sν ≤ bν} for a put option |
We shall assume from now on that the stock price St follows a Markov process, where the expected stock price in the future depends only on the current stock price St.
We shall consider three approaches to pricing American options.
Using the binomial tree methodThe Cox-Ross-Rubinstein model for pricing American options is provided in table 1. However, one should note that j represents the time step in the model, whilst i denotes the number of upward movements by a factor u. Applying this to equation (4) provides the following DP recurrence for a call option:
| e-rThT | = max( e-rT(S0uidN-i - K) , 0 ) | i = 0, 1, …, j |
| e-rjΔthtj | = max( e-rjΔt(S0uidj-i - K) , 0 ) | j = 0, 1, …, N |
with the DP recurrence for a put option defined below.
| e-rThT | = max( e-rT(K - S0uidN-i) , 0 ) | i = 0, 1, …, j |
| e-rjΔthtj | = max( e-rjΔt(K - S0uidj-i) , 0 ) | j = 0, 1, …, N |
As before, we can price the option in this way by finding h0. The points at which exercise is preferrable to continuing can be used to form the exercise boundary. As a result, we can also find the average optimal stopping time, going through each possible path in the model, as shown by the applet below. However, the problem with this method is a result of having to store option value at each time step. When there are N+1 step in the model, the program needs to store (N+1)(N+2)/2 ∈ O(N2) values in memory. We also need to consider 2N possible stock price paths. This becomes a problem as N becomes very large.
Making use of the Black-Scholes model
Recall, using the model above, that the Black-Scholes formula for calculating the price of a European option at time t is:
| E(ST | St) | = StN(d1) - Ke-r(T-t)N(d2) | for a call option |
| E(ST | St) | = Ke-r(T-t)N(-d2) - StN(-d1) | for a put option |
where
| d1 = |
|
||||||
| d2 = |
|
= d1 - σ√(T-t) |
and N(x) is the cumulative probability function of a standard normal random variable with mean 0 and variance 1. The Black-Scholes value of an option at time t will be used to form the second example of an exercise boundary b. In this case, the smallest optimal stopping time for a simulated path is the first point τ ∈ {t0, t1, …, tN} in the path where the value of the payoff at time tj exceeds the Black-Scholes price of an option worth Stj at the same time step, when given the same values for K, r, σ and T as at time 0. By taking the mean value over all M simulated paths, we obtain another estimate for an American option price. This can be achieved using the next applet.
However, this program will underestimate the true value of the option. This is because the Black-Scholes formula assumes exercise is only possible at time T, and not before. In the case of an optimal stopping time over (τ, T), the payoff from early exercise will exceed the expected value of the option price at maturity. However, the Black-Scholes formula does not take this into account, resulting in an underestimated value, which affects the estimates at all times prior to this.
Using simulation to obtain an exercise boundary
In this section, we will only consider American put options (it turns out that it is never optimal to exercise American call options before maturity, so they become analogus to European call options). The approach to pricing options here is to first obtain a sample of M1 simulated paths. We use this sample to obtain the optimal exercise boundary in the following way.
Let θj denote the value of the exercise boundary at time tj. Considering only maturity time for now, we will exercise the put option iff the asset price is below the exercise price. Hence, we set θN = K. Next, we consider the value of the boundary at time tj < T, working backwards from tN-1 to 0. Since the present value of an option exercised at this time is greater than the present value of an option exercised at a later date, when the stock price remains the same, we have:
We first try θj = θj+1 as the first potential value for the exercise boundary at time tj. For every simulated path where Stj(ωi) le; θj, we exercise the option at this time. For all remaining paths, we exercise at the (already determined) optimal stopping time over {tj+1, …, tN}. We repeat this using every value of Stj(ωi) le; θj+1 as a potential value of θj, with the resulting value being the one that maximises the average present value of the payoff for each option, when exercised at the specified time.
Having computed the estimate for b* in this way, we now simulate a sample of M2 new stock price paths, stopping each one at the first time τ where the stock price is below the exercise boundary. That is:
The following applet attempts to price American options in this way. In this case it ought to be true that, by letting N, M1, M2 → ∞, our estimate of the American option price should tend to the true value, given S0, K, r, σ and T. However, estimating the payoff boundary requires storing all M1 simulated paths, and the values at all N+1 points in memory at the same time. This quickly becomes a problem when we set these two variables to be too large, which is notified by the program to the user. As a result, we need to use smaller values of N and M1, which results in a reduced amount of accuracy. A compromise between accuracy and memory availability is then required when using this method to price American put options.
This project also comes with a report, providing additional details and examples of the above programs, and on which this page is based. Whilst we have an analytic model for pricing European options, no such formula exists for American options, meaning that numerical procedures must be used instead. In theory, we are able to price American options using optimal stopping times, but finding such times becomes a challenge in itself. The binomial method of Cox, Ross and Rubinstein provides an example of pricing options in this way, but only considers a discrete set of stock price values for each time period. Monte Carlo simulation can be used by simulating one sample of stock prices to obtain an exercise boundary and another to estimate the price itself. The method of determining the boundary is, computationally memory-intensive, but a smaller sample results in less accuracy. Whilst limited memory-usage is becoming less of a problem over time, it is still significant in the area of pricing American options.
[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.
[4] H. M. and P. J. Deitel: Java, How to Program. Prentice Hall, 2002.
[5] Helmut Kopka and Patrick W. Daly: A Guide to LATEX 2ε. Addison-Wesley, 1995.
[6] Glasserman P. Monte Carlo methods in financial engineering. Springer, 2004.
[7] Lamberton D., Lapeyre B. Introduction to stochastic calculus applied to finance. Chapman and Hall, 1996.
[8] Bingham N. H., Kiesel R. Risk-neutral valuation: pricing and hedging of financial derivatives. Springer, 1998.