0% found this document useful (0 votes)
10 views

Least Squares Method

LSM

Uploaded by

nehrusghost
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Least Squares Method

LSM

Uploaded by

nehrusghost
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 70

Valuing American Options by

Least-Squares Monte Carlo Method

Author: Xi Yang

Supervisor: Dr. Daniel J. Duffy

Student ID Number: 1337127

Programme: MSc Mathematical Finance 2013-2014

Dissertation Submitted in Partial Fulfilment of the degree of

MSc Mathematical Finance

September 2014

Word Count: 8040


Abstract

This dissertation introduces an American pricing method proposed by Longstaff and

Schwartz (2001), called Least-Squares Monte Carlo (LSM) method. The key to this

approach is to least-squares method to estimate the continuation value of American

option. Moreover, the explanatory variables in least-squares regression are certain

polynomial functions. We analysis the effect of different basis functions on option

values. We will implement LSM approach in C++ as well.


1. Introduction.......................................................................................................................... 1

2. The Financial Background................................................................................................. 3

2.1. A Brief Introduction to Options............................................................................ 3

2.2. Arbitrage-free Pricing and Martingale Measures.............................................. 3

2.3. Risk Neutrality........................................................................................................ 5

2.4. Simulating from a Geometric Brownian Motion................................................ 7

2.5. Monte Carlo Simulation........................................................................................ 9

2.6. Markov Chain and Stopping Rules................................................................... 11

3. The Least-Squares Monte Carlo Approach.................................................................. 13

3.1. Valuation of American Option........................................................................... 13

3.2. The LSM method of Longstaff and Schwartz................................................. 14

3.2.1. the Valuation Framework of LSM............................................................ 15

3.2.2. The Principle of Ordinary Least Squares (OLS)................................... 17


3.2.3. Approximate Continuation Values........................................................... 19

3.2.4. Description of the Algorithm..................................................................... 21

3.2.5. Valuation American Put Options.............................................................. 25

3.2.6. Choice of basis functions.......................................................................... 30

3.3. Another Numerical Method for Pricing American Derivatives: Binomial

Methods.......................................................................................................................... 35

4. C++ Code for the Algorithm............................................................................................ 45

4.1. The C++ Implementation Using LSM approach............................................. 45

4.2. The C++ Implementation Using Binomial methods....................................... 57

4.3. The Result of C++ Project................................................................................. 59

5. Numerical Results............................................................................................................. 61

6. Conclusion......................................................................................................................... 63

References............................................................................................................................. 64
1. Introduction

European options can be exercised only on the expire date, whereas American

options can be exercised on any trading date before exercise. Valuation of derivatives

with American-style exercise features become one of the most significant practical

problem in option pricing. These types of derivatives exist in all major financial

markets, including the equity, commodity, foreign exchange, insurance, mortgage

and credit markets.

Since American option can be exercised at any time up to the expiration date,

closed-form expressions for derivative prices do not exist. Thus, although the

analytical expressions can be found in some cases, the numerical approaches for

pricing American option are still required.

Numerical methods for pricing American derivatives include Binomial Approach

suggested by Cox, Ross & Rubinstein (1979) and Finite Difference methods. The

major problem for the Binomial methods is that they become infeasible when handle

more than a couple of stochastic factor, since the number of nodes required grows

exponentially in the number of factors. And those two methods cannot be extend to

high-dimensional cases and the cases of path-dependent options either.

The more efficient approach is still a Monte Carlo one. Valuing a derivative security

1
using Monte Carlo typically involves simulating paths of stochastic processes, and

then estimate the option price by discounting the average of the payoff for each path.

However, since the Monte Carlo approach estimate the valuation of American option

using pathwise method, it not been widely applied to pricing American derivatives.

The main difficulty for applying Monte Carlo techniques is to find the conditional

expectations involved in the iterations of dynamic programming. To deal with this

problem, least squares regression on a finite set of functions can be used as a proxy

for conditional expectations. This is an important new algorithm proposed by

Longstaff and Schwartz (2001), called Least Squares Monte Carlo (LSM). The idea is

to estimate the continuation value using least squares regression jointly with the

cross-sectional information obtained from Monte Carlo simulation. Besides, the LSM

method overcomes the “ curse of dimensionality ” by rely on the Monte Carlo

simulation to populate the sample space of the probability distribution.

The focus of this paper is to assess the performance of LSM Approach. Section 2

gives the financial background of LSM approach. Section 3 introduced in details the

algorithm of LSM approach. The C++ implementation of this method is presented in

section 4, and the numerical results are presented in section 5.

2
2. The Financial Background

2.1. A Brief Introduction to Options

Options are financial derivatives that give holder right, but not the obligation, to buy or

sell an underlying asset at a specified strike price at a prescribed time in the future

(Choudhury, King, Kumar & Sabharwal, 2008). Call options give holder the right to

buy the underlying asset, whereas put options give the right to sell. There are

different categories of options distinguished by different option payoffs and ranges of

exercise date. For instance, European options can only be exercised on the expire

date while Bermudan options are exercisable at specific dates on or before maturity.

American options have the additional features that exercise is permitted at any time

during the life of the options. Therefore, not only must a value be assigned to the

American option, but we must determine when it is best to exercise the option.

2.2. Arbitrage-free Pricing and Martingale Measures

One of the basic concepts concerning the valuation of derivatives is arbitrage. This

can be state as, owing to the law of supply and demand, the opportunity to make an

instantaneously risk-free profit must vanish quickly (Wilmott, Howison & Dewynne,

1995). Besides, the largest return that one can make on a risk-free investment is

equivalent to put money into a risk-free bank account.

3
No-arbitrage valuation principle implies that the price of portfolio in the present is the

risk-neutral discounted present value of the portfolio at expire date is expressed as

V (t)  V(T) e  r (T  t) .

According to Föllmer & Schied (2002, p. 228), “A stochastic process M  ( M t )t 0,,T

on a filtered probability space (,  , (t ), Q) is called a martingale if M is adapted,

satisfies EQ | M t |   for all t, and if

M s  EQ  M t | t  for 0  s  t  T .”

In order to decided whether or not a given process M is a martingale relies on the

underlying probability Q. It can be said that M is a Q-martingale or that M is a

martingale under the measure Q to emphasize that a particular measure Q

determines the martingale property of M (Föllmer & Schied, 2002). Furthermore, if the

discounted underlying asset prices path X is a (d-dimensional) Q-martingale, then,

measure Q on (, T ) is called a martingale measure, i.e.,

EQ  X ti    and X si  EQ  X ti | s  , 0  s  t  T , i = 1,...,d.

Additionally, if a martingale measure P* is equivalent to the original measure P on

t , it called an equivalent martingale measure (ibid).

4
2.3. Risk Neutrality

The risk-neutral method is set out in the papers by Cox & Ross (1976) and Harrison &

Pliska (1981). Those papers proposed a different point of view about option pricing

from the early theory.

Let V  V (S, t) be an option which satisfies

dV 1 2 2 d 2V dV
  S 2
 rS  rV  0 ,(2.8)
dt 2 dS dS

with

dS
  dX   dt (2.9)
S

dV
and consider the portfolio   V  S with   , with this strategy, all risks have
dS
d
been eliminated instantaneously and  r  . The value of  in (2.9) does not affect
dt
that of V in (2.8).

Indeed, individual investors may have different approximations of growth rate  ,

however, they can still reach an agreement on the value of V.

The risk neutral world denote a world where all risks are hedged away, the only

growth rate is the risk free interest r. Thus, equation (2.9) can be rewrited as

5
dS
  dX  rdt .(2.10)
S

Moreover, S is a log normal variable with conditional probability density function

defined as follows:

S 1
[log  (r   2 )(t   t)]2
S 2
1 
p[S, t;S, t ]  e 2 2 (t  t)
,(2.11)
 S  2 (t  t )

i.e. If S  S (t) at time t is known, p is the continuous probability of S  S  at time

t  t .

Next, suppose the payoff function for an option V is V (S, T)   (S) , then the expected

value of payoff  (S) can be calculated by the probability density function. To start

with, multiplying  (S) by the risk-neutral probability density function. Then,

integrating from zero to infinity, over all possible future asset prices . Eventually, the

value of V can be calculated by discounting the expected value of payoff  (S) , the

resulting formula is


V(S,t)  e  r (T  t)   (S') p(S, t;S, t )dS 
0 (2.12)

(Wilmott, Howison & Dewynne, 1995).

6
2.4. Simulating from a Geometric Brownian Motion

If log S(t) is a Brownian motion with initial value log S(0), than the stochastic process

S(t) is a geometric Brownian motion (Glasserman, 2004). Moreover, all methods for

simulating Brownian motion can be used to simulate geometric Brownian motion

through exponentiation.

Suppose W is a standard Brownian Motion and X satisfies

dX (t)   dt   dW(t) ,(2.13)

so that X ~ BM (  ,  2 ) . If we set S (t)  S(0) exp(X(t))  f (X(t)) , then an application of

Itô's formula shows that

1
dS (t )  f ( X (t ))dX (t )   2 f ( X (t ))dt
2

1
 S (0) exp( X (t ))dt  dW (t )   2 S (0) exp( X (t ))dt
2

1
 S (t)(    2 ) dt  S(t) dW(t). (2.14)
2

On the contrary, a geometric Brownian motion is given by a Stochastic Diffusion

Equation (SDE) of the form

dS (t )
 dt  dW (t ) .(2.15)
S (t )

7
Then, it can be verified through Itô's formula or comparison with (2.14) that

1
d logS(t)  (    2 ) dt   dW(t) .(2.16)
2

The notation S ~ GBM (  ,  2 ) will be used to indicate that S is a process defined in

(2.13). For the parameter in this notation,  represents drift parameter whereas 

is the volatility parameter of S(t) or log S(t).

As can be seen from (2.16), given a starting level of S(0), if S ~ GBM (  ,  2 ) , then

1
S (t)  S(0) exp([    2 ] t   W(t)) .(2.17)
2

Simulated values of S(t) at a specific time point is

1
S (t)  S(0) exp[(    2 ) t   t Z(t)] ,(2.18)
2

according to the properties of Brownian Motion.

where Z (t) ~ N(0,1) . Besides, due to W are independent and normally distributed, to

find simulated values at discrete dates 0  t0  t1    tn  T , a recursive process is

expressed as

1
S (t i 1 )  S(t i ) exp([    2 ](t i 1  t i )   ti 1  ti Zi 1 ),
2 (2.19)
i  0,1, , n  1,

8
where Z (t i 1 ) ~ IIN(0,1).

2.5. Monte Carlo Simulation

The Monte Carlo method was first suggested as an approach to price option by Boyle

(1977).

There are three main steps to be followed to calculate an estimate of the option value

(Moreno & Navas, 2001):

1. Simulating the paths for underlying asset prices until expire date T and then

calculate the value of payoff functions. Repeating this steps for M times to get M

paths.

2. Calculating the expected payoff.

3. Discounting the average of the payoff for each path to obtain the estimated option

price.

Suppose a path of underlying asset prices is random. For Monte Carlo approach, the

option value is the risk-neutral expectation of its discounted payoff as mentioned in

Section 2.3:

V (S, t)  e  r (T  t) E (Pay  off(S))

9
1 n
 lim e  r (T  t) 
n 
 Pay  off (Si ),
n i 1

where Si is the i th random walk.

In the Monte Carlo method, a risk neutral random walk is generated by

dS  rSdt   SdX ,

1
where dX  Z (dt) 2
and Z (t) ~ N(0,1) , as mentioned in section 2.4.

Then it is simple to obtain that

S (t  dt)  S(t)  dS.

T
If there are m time steps from t = 0 to t =T, then dt  . Thus,
m

 1

Si (dt)  Si (0)   r Si (0)dt   Z Si (0)(dt) 2  ,
 
 1

Si (2 dt)  Si (dt)   r Si (dt)dt   Z Si (dt)(dt) 2  ,
 
 1

Si (3dt)  Si (2 dt)   r Si (2 dt)dt   Z Si (2 dt)(dt) 2  ,
 

 1

Si (T)  Si (T  dt)   r Si (T  dt)dt   Z Si (T  dt)(dt) 2  .
 

However, to implement the Monte Carlo approach to the valuation of American

10
options, two basis issue need to be concerned. The first is to estimate the optimal

stopping point by an efficient algorithm. The second issue is to enhance the

performance when dealing with multiple factors. Those issues are raised since that

Monte Carlo method typically generate the simulating processes pathwise, whereas

the exercise frontier can only be estimated backwards-style through dynamic

programming techniques.

2.6. Markov Chain and Stopping Rules

A commonly method to denote Markov chain i.e. discrete Markov process assumes

that there is a filtered probability space (,  , ( n ) n0 , P) and a state space (E,  ) ,

that is to say, a measurable space E with a σ -algebra  of its subsets such that

one-point sets {x} belong to  for all x  E .

If the random variable X n are n /  -measurable and the following Markov property

holds:

P (X n 1  B | n )( )  P (X n 1  B | X n )( )

for all n  0 and B   , then the stochastic process X  (X n , t ) n0 is called a

Markov chain (Peskir & Shiryaev, 2006).

In term of stopping rule, the price time zero price V (h) depending on the payoff and

11
the stopping time  is given by

V * (h)  essup V (h) .

If N denotes the number of time steps and M the number of paths, a set of prices can

be defined as P (i, j),i  1, , N, j  1, , M . Given a discretization of some stochastic

process S (t), t   0, T  on fixed time points t1 , , t N , P (i) can be the option values

with payoff h at the i th exercise opportunity ti . The optimal stopping time can be

formulated by

 i  P ( i )   es sup i  i  P ( )  : S p (t i ) ,

where i , i  t1 , , t N is a filtration and  i is the set of i -stopping times taking

values in {t1 , , t N } (Kienitz & Wetterau, 2012) . Besides, S p (t i ) is called the Snell

envelope of P and it is the smallest super-martingale that dominates P.

12
3. The Least-Squares Monte Carlo Approach

3.1. Valuation of American Option

An American option can be exercised at any time up to the expiration date, thus the

option values differ from the specific exercise policy used by different investors. On

the expire date, the optimal strategy is to exercise the option if it is in the money, or let

is expire if it is out of money. More precise, the holder of the option is supposed to

compare the value of the option of exercise it immediately with its conditional

expected value of continuation. Thus, the most crucial point of whether or not

exercise the option is to determine its value of continuation under the risk neutral

condition.

The approaches for valuation of American options can be typically divided into two

classes. Binomial models and finite difference methods are classified as backwards

method and are well suited to solve the problem of early exercise opportunities

(ukessays, 2014) . Those two similar approaches generate the discrete lattice points

during the life time of American options, and then iterate backward from the expire

date to calculate the immediate exercise value and the risk-neutral expected value of

holding the option. The lattice points, for which exercise immediately is more

beneficial than continue is called exercise frontier (Choudhury, King, Kumar &

13
Sabharwal, 2008). Moreover, binomial and finite difference methods are adopted to

low dimension of problems and dynamics, typically three or four dimensions. The size

of lattice will growth exponentially when the number of dimensions increase.

Another option pricing technique is Monte Carlo simulation, it can be seen as a

supplement method when compare with binomial approaches and finite different

methods. Monte Carlo methods can be efficient when pricing option with high

dimensions, since the rate of convergence rate does not rely on the number of

dimensions (Choudhury, King, Kumar & Sabharwal, 2008). Those advantages allow

Monte Carlo methods to be commonly implemented in valuation of derivatives.

However, two issues need to be take into consideration, one is that the Monte Carlo

techniques become inefficient when dealing with options which have early exercise

opportunities. Another problem is how to improve the performance of the estimation

for options with multiple processors. Ultimately, the main issue is that Monte Carlo

simulation is a pathwise method while the determination of exercise frontier through

dynamic programming iterate backward.

3.2. The LSM method of Longstaff and Schwartz

Longstaff and Schwarts (2001) published an algorithm for valuation of American

options recently, called Least Squares Monte Carlo (LSM). LSM also use simulation

14
to value American options, it is based on the information provided by Monte Carlo

methods. Specifically, LSM starts with simulating forward paths, and then iterate

backward and estimate the continuation value of the option at each exercise date.

The continuation function is obtained through the least-squares regression, which

introduces a set of basis function from underlying asset prices. Comparing these

approximations with the immediate exercise values to determine the optimal exercise

strategy at each time step.

3.2.1. the Valuation Framework of LSM

Let  represent a stochastic process of underlying asset prices generated by Monte

Carlo methods at discrete time steps 0  t1  t2    t  T . The American option is

approximated by the Bermuda counterpart, assuming  is sufficiently large. Let

C ( ,s; t, T) , s  (t , T ] denote the path of cash flows, conditional on the option not

being exercised at or before time t and the option-holder following the optimal

exercise strategy for all subsequent s.

At the expire date, the option holder exercise the option if it is in the money, or let it

expire otherwise. Prior to maturity at time tk , the investor must make decision about

whether to exercise at that time step or continue and reconsider at the next time step.

Although, the option-holder knows the value of exercise immediately, he has no idea

15
about the cash flow generated by continuation. According to the arbitrage free theory,

at time tk , the value of continuation F ( ; t k ) can be expressed as

 K 
F ( ; t k )  E Q   exp(  r ( ,s) ds) C( , t j ; t k , T) | tk  ,
tj

tk
 j  k 1 

where r ( , t j ; t k ) is the interest rate in period tk for riskless securities that expire in

period t j  tk , Q is the risk-neutral pricing measure, and the expectation is taken

conditional on the information set tk at time tk (Longstaff & Schwartz, 2001).

It is obviously that to solve the problem of optimal exercise, a good approximation of

continuation is required. Let Fˆ ( ; t k ) denote this estimate. Once the expected value

of continuation is obtained, comparing the value of exercise immediately with

Fˆ ( ; t k ) , and then exercise as soon as the immediate exercise value is greater then

or equal to Fˆ ( ; t k ) .

After the optimal exercise policy is determined, the procedure of American option

pricing is to first simulating the paths of underlying asset price by Monte Carlo

methods from risk-neutral pricing measure Q. For each path, find the optimal stopping

point through the estimator functions of continuation value obtained above. According

to the option pricing theory, an optimal exercise strategy can only generate one

unique cash flow for each path((Choudhury, King, Kumar & Sabharwal, 2008)). Then,

the American option pricing problem is solved by discounting the resulting cash flow

16
from exercise back to time zero, and averaging the discounted cash flows over all

paths  .

3.2.2. The Principle of Ordinary Least Squares (OLS)

If no further information is provided, let B be the set of all possible vector  and

B   k . The goal is to find a vector b  (b1 ,..., b K ) from B that minimize the error i.e.

the sum of squared residuals

T
S (  )   et2  ee  (y  X  ) '(y  X  ) (3.1)
t 1

given y and X. Since S (  ) is a real-valued, differentiable, convex function, a

minimum value will always exist. Moreover, S (  ) can be rewrite as

S (  )  y'y   'X'X   2  'X'y . (3.2)

After differentiate by  , the following results can be obtained,

dS (  )
 2 X ' X   2 X ' y, (3.3)
d

 2 S ( )
 2 X 'X. (3.4)
 2

17
Equating (3.3) to zero to derive the normal equations

X ' Xb  X ' y . (3.5)

As a result, the value of b can be calculated by

b  (X'X) 1 X ' y , (3.6)

if X is of full rank K to ensure that X'X is nonsingular.

Otherwise, equation (3.5) has a set of solutions

b  (X'X) 1 X ' y  (I (X'X)  X'X) , (3.7)

where  is an arbitrary vector and (X'X)  is a general inverse of X'X .

It can be proved that the empirical predictor of y, ŷ  Xb , has equivalent value for all

solutions b of X ' Xb  X ' y (Rao & Toutenburg, 1999). Since

Xb  X (X'X) 1 X ' y  X (I (X'X)  X'X)

 X (X'X)  X ' y

which is independent of  when choose different values of b in (3.7).

18
Another theorem describes that S (  ) is able to achieve the minimum value for any

solution of X ' Xb  X ' y . To prove this, observe that

S (  )  (y  Xb  X(b   )) '(y  Xb  X(b   ))

 (y  Xb) '(y  Xb)  (b   ) 'X'X(b   )  2(b   ) 'X'(y  Xb)

 (y  Xb) '(y  Xb)  (b   ) 'X'X(b   )

 (y  Xb) '(y  Xb)  S(b)

 y ' y  2 y ' Xb  b ' X ' Xb  y ' y  b ' X ' Xb  y ' y  yˆ ' yˆ .

3.2.3. Approximate Continuation Values

The prime of the LSM approach is to approximate the conditional expected function of

continuation from cross-sectional information in the simulate paths through the

least-squares method. Precisely, the continuation function F ( ; t k ) is approximated

as a linear combination of a countable set of tk -measurable basis functions

(Longstaff & Schwartz, 2001). Particularly, if the first m basis function are represented

as Lk (), k  1,..., m , the the estimation can be expressed as

m
F ( , t j )   ak Lk (S(t j ,  )) .
k 1

19
where S(t j ,  ) is the underlying asset values at the j th time step for the path  ,

and ak are constant coefficients for the k th basis function Lk (ibid).

Moreover, the option values and underlying asset prices are information used to

determine the coefficients ak for least-squares regression.

Let Aj be the n  m design matrix for the j th time step with Aj (i, k)  L k (S(t j , i )) ,

where i is the i th path with i  1,..., n . Let X j   ak  j be the unknown vector of the

basis function coefficients for j th time step to be determined by the regression

(Choudhury, King, Kumar & Sabharwal, 2008). The objective is the find the basis

function coefficient that minimizes || Aj X j  Y j ||2 (ibid). The column vector values

[Y j ]i are calculated by discounting the option price on path i from time t j 1 to time

t j . Then, to determine the coefficients we solve for the least-squares error   0

determined by

m
F ( , t j )   ak Lk (S(t j ,  ))   . (3.8)
k 1

For each j, minimizing this expression in the sense of the least-squares error. Using

vectors Y, X,  given by

20
 y1   x1   1 
     
 y2   x2 
Y ,X  ,     2   n .
     
     
 yn   xm   n 

For the basis function Lk , k  1,..., m from (3.8), let Lk (S j , n) be the value of the j th

time step in the nth paths. The matrix F   nm is denoted as

 L1 (S j ,1) L2 (S j ,1)  Lm (S j ,1) 


 
L1 (S j , 2) L2 (S j , 2)  Lm (S j , 2) 
A :  .
     
 
 L1 (S j , n) L2 (S j , n)  Lm (S j , n) 

Thus, from Y  AX   , the least-squares minimizer is

AT AX  AT Y ,

which gives

X  (AT A) 1 AT Y .

3.2.4. Description of the Algorithm

Considering a discrete American option which can only be exercised at N+1 limited

times t0  0, t1 ,..., t N  T between t  0 and expire date t  T . Let (,  , ) denote a

probability space equipped with a discrete time filtration   (t j ) j1,...,N . Then,

21
choosing an  D valued and  -adapted Markov chain ( St j ) j 1,..., N as model for

underlying asset prices, and a payoff function f :{t 0 , t1 ,..., t N }   D     0 to

ensure that the resulting variables Z t j  f (t j ,St j ) | j 1,..., N are square integrable.

Furthermore, the initial asset value S0 is deterministic. If the set  0,N of all

 -stopping times with values in {t 0 , t1 ,..., t N } are given, the price U 0 of American

option of payoff f is expressed as

U 0  sup (Z ) . (3.9)


  0, N

The dynamic programming problem can be solved by

U N  Z N
(3.10)

 
U j  max Z t j , (U j 1 | t j ) , 0  j  N  1

and the sequence of stopping time is

 j  min k  j | U k  Z k  .

Then, rewrite the dynamic programming principle with respect to the optimal stopping

time to give

 N  N
  j    0  j  N  1 . (3.11)
 j Zt j  (U j1|t j ) j 1 Zt j  (U j1|t j ),

22
In particular U 0  sup 0,N Z  Z 0 .

With Markov property,

(U j 1 | t j )   j (St j ) , (3.12)

where  j () can be defined as  j (s)  (U j 1 | St j  s).

Hence,  j (St )
j
is the projection of U j 1 on the space

L2j  { :  D   | [ 2 St j )]  } .

The estimation proposed by Longstaff and Schwartz (2001) approximated the

conditional expectation using finite dimensional space L2j instead of the infinite

dimensional one. Considering a set of m linearly independent functions e1 (),..., e m ()

such that [e 2k ( St j )]   for all k  1 to m, j  1 to N. Then, the approximation of

 j in the space spanned by ek () is

 j (St )   j  e(S ) (3.13)


j tj

where

2
 j  arg min  U j 1    e(St )  .
  m j

Introducing a sequence of stopping times  mj , the solution of (3.11) in terms of

23
stopping time generated by (3.13) is as follows:

 Nm  N

 m  j  (3.14)
  mj 1 0  j  N  1.
 j  tj j tj 
Z  e (S )  tj j tj 
Z  e (S ) ,

If there are n independent realization of paths of underlying asset prices, then it is

possible to write

 j (St )   nj  e(S )
j tj

with

1 n
 nj  arg min  (U (n)j 1    e(St(n)j ))2
  m n i 1

1 n
 arg minm
 
 (Z (i)m,n ,i    e(St(ij ) ))2 .
n i 1  j1

The expression for optimal stopping time is then

 Nm ,n ,i  N

 m ,n ,i  j  .
  m , n ,i  0  j  N 1
 j Zt(i)j  nj e (St(i)j ) j 1 Zt(i)j  nj e (St(i)j ),

Eventually, the price of the option

24
U 0  max(Zt0 , Z1 )

is first estimated by

U 0m  max(Zt0 , Z m )
1

and then by

1 n (i)
U 0m ,n  max(Zt0 ,  Z m,n ,i ) .
n i 1 1

For details of this algorithm, refer to Clément, Lamberton & Protter (2002).

3.2.5. Valuation American Put Options

The valuation of American options is simple: generate the paths of underlying asset

prices using Monte Carlo simulations form the risk-neural measure Q. For each

stochastic process the optimal stopping time is determined by the estimator functions.

Eventually, the American option price is approximated by discounting the resulting

cash flows from the optimal stopping point to time zero, and take the average of the

discounted cash flow over all simulating paths.

The specific steps of the LSM algorithm for American put options are:

25
a. Generate the paths of underlying asset prices.

Suppose the expire date for a single asset American option is T, and the optimal

exercise date of the option is t * , t*  [0, T] . Let S denote the underlying asset prices

and X is the strike price for the American option. Under the risk neutral condition, the

original price for this option is

P  E Q  exp( rt *) f(S0 ,S1 ,...,St* ,...,ST )  .

where, S0 ,S1 ,...,St* ,...,ST is the stochastic path for underlying asset prices, while

f(S0 ,S1 ,...,St* ,...,ST ) is the option price at the optimal stopping point t*. Then P is the

value of the American option which is to be approximated by the LSM approach.

Given a discretization of some stochastic process S (t), t   0, T  , the stochastic

process of underlying asset for simulating values at discrete date

0  t0  t1    t j  T is given by setting

1
S (t j 1 )  S(t j ) exp([    2 ](t j 1  t j )   t j 1  t j Z j 1 ),
2 (3.15)
j  0,1, , N  1,

where Z (t j 1 ) ~ IIN(0,1) (as mentioned in section 2.4). Then the sample of underlying

asset prices can be obtained by repeating this procedure for M times.

26
b. Estimate the optimal stopping time for each path and calculate the option value at

each time step.

For American put options, the value of immediate exercise equals the intrinsic value

which is I (Sij )  max  X  Sij , 0 , and notation of continuation value is

H (Sij )  E Q exp( rt) C(S j 1 ) | S ij  . Since American options can be exercised at any

time before the maturity, the optimal stopping time can be found by comparing the

intrinsic value I (Sij ) with continuation value H (Sij ) , i.e.

C(Sij )  max{I(Sij ), H (Sij )} .

It can be seen from the expression of H (Sij ) that the continuation value relies on the

the option value of the next time step, thus the conditional expected value of

continuation have to be solved backward by dynamic programming technique. To

deal with this problem, LSM construct the least-squares regression model

Yi  exp ( rt) C(Sij 1 )  a1  a2 S ij  a3 S ij 2  i ,

which take the underlying asset prices S j and S 2j as explanatory variables for all

simulating paths and the corresponding option value at the next stopping point as

explained variable.

After determining the value of coefficients through least-squares regression, the

27
estimated value of coefficients is denoted by aˆ1 , aˆ2 , aˆ3 and the estimated regression

equation become Yˆj  aˆ1  aˆ2 S ij  aˆ3 S ij 2 . By substituting the value of underlying asset

prices into this regression equation, the approximated value of continuation is finally

obtained:

Yˆi  E Y | S ij   E exp( rt) C(S j 1 ) | Sij  .

Furthermore, Theorem 1.2.1 of Amemiya(1985) implies that Yˆi is the best linear

unbiased estimator of the continuation value.

In this section, the choice of basis functions is the set of power basis:

L0 (S)  1 ; L1 (S)  S ; L0 (S)  S 2 .

However, other types of basis functions include Laguerre, Legendre, Hermite,

Chebyshev, Gegenbauer, and Jacobi polynomials.

Afterwards, iterating backward from maturity to calculate the optimal stopping time

and the option value at each exercise point for all the paths. At expire date T, the

value of exercise the American put option is simple max{X  SiN , 0} . At time N-1, if

option is in the money i.e S Ni 1  X , compare the intrinsic value and the continuation

value and then exercise the option if immediate exercise is more valuable than

continue. Considering only the in-the-money paths in the estimation, the regression

28
equation for approximated conditional expected value of continuation is

y Ni 1  exp( rT ) max{X  SiN , 0}  a1  a2 S Ni 1  a3 S Ni 12  i ,

where , i  I N 1 , I N 1 is the set of all the in the money paths at time N-1. With the

data of underlying asset price S Ni 1 at time N-1, comparing the intrinsic value

max{X  SiN 1 , 0} with the conditional expected value of continuation yˆ Ni 1 to make the

decision about whether exercise the option immediately or not. Similarly, the

continuation value at time N  1, N  2,..., 0 can be obtained backward in time. For

each path i, the option can take the opportunity to exercise at the optimal stopping

time ti*  0,1,..., N  or expire.

c. Discount the resulting cash flows back to time zero and averaging the discounted

cash flows over all paths.

After simulating M processes of underlying asset prices and finding the optimal

exercise opportunity ti* for each path, the option value at that point is denoted by

I (Sit* )  max{X  Sit* , 0} i  {1, 2,..., n} .


i i

*
Due to the optimal stopping time is different, the value of discount factor e  rti differs

for each path. Thus, the average of discounted cash flow should be calculated

respectively, and the ultimate estimated option value of American option can be

29
expressed as

 exp( rt ) I(S
*
i
i
ti*
)
P  Eˆ Q
exp( rt *) f(S0 ,S1 ,...,St* ,...,ST )  i 1
.
n

3.2.6. Choice of basis functions

In this section , the focus is on the effect of different type and number of basis

functions on the estimated option price. To be precise, considering ten different type

of polynomials for basis functions (Moreno & Navas, 2003):

Table 1: Different types of basis function

Name f n (x) Name f n (x)

Power Wn (x) Chebyshev 1st kind A Tn (x)

Legendre Pn (x) Chebyshev 1st kind B Cn (x)

Leguerre Ln (x) Chebyshev 1st kind C Tn* (x)

Hermite A H n (x) Chebyshev 2nd kind A U n (x)

Hermite B H en (x) Chebyshev 2nd kind B S n (x)

where n  0 represents the degree of polynomial.

The polynomials in the table above can be expressed in three alternative methods:

30
a. Explicit expression

Table 2: Explicit expressions of the basis functions

f n (x) N dm cm g m (x)

Wn (x) 0 1 1 xn

 n   2n  2m 
Pn (x) [n/2] 2 n (1) m     x n2m
 m n 

(1) m  n 
Ln (x) n 1   xm
m!  n  m 

1
H n (x) [n/2] n! (1) m (2 x) n  2 m
m !(n  2 m)!

1
H en (x) [n/2] n! (1) m x n2m
m !(n  2 m)!

(n  m  1)!
Tn (x) [n/2] n/2 (1) m (2 x) n  2 m
m !(n  2 m)!

(n  m  1)!
Cn (x) [n/2] n (1) m x n2m
m !(n  2 m)!

(n  m  1)!
Tn* (x) [n/2] 2 n n (1) m (2 x) n  2 m
m !(n  2 m)!

(n  m)!
U n (x) [n/2] 1 (1) m (2 x) n  2 m
m !(n  2 m)!

(n  m)!
S n (x) [n/2] 1 (1) m x n2m
m !(n  2 m)!

The basis functions are special cases of the Explicit expression which is given by

31
N
f n (x)  d n  cm g m (x)
m0

where the value of N is differ from different polynomials and n  0 denotes the

degree of the polynomial.

b. Rodrigues’ formula

Table 3: Expressions of the basis functions using Rodrigues’ formula

f n (x) an  (x) g (x)

(2 n)!
Wn (x) 1 xn
n!
Pn (x) (1) n 2n n ! 2 n x n2m

Ln (x) n! 1 xm

H n (x) (1) n n! (2 x) n  2 m

H en (x) (1) n n! x n2m

1
(n  )
Tn (x)
(1) n 2n 2 n/2 (2 x) n  2 m

1
(n  )
Cn (x)
(1) n 2n 2 n x n2m

1
(n  )
Tn* (x) (1) 2 n 2 n 1 2 2 n n (2 x) n  2 m

32
3
(n  )
U n (x) (1) n 22 n 1 2 1 (2 x) n  2 m
(n  1) 

3
(n  )
S n (x) (1) n 22 n 1 2 1 x n2m
(n  1) 

The basis functions are specific cases of the following equation:

1 dn
f n (x)    (x)(g(x)) n  ,
n 
an g (x) dx

where n  0 represents the degree of the polynomial.

c. Recurrence law

Table 4: Recurrence law for the basis functions

f n (x) an 1 an bn an 1 f 0 (x) f1 (x)

Wn (x) 1 0 1 0 1 x

Pn (x) n+1 0 2n+1 n 1 x

Ln (x) n+1 2n+1 -1 n 1 1-x

H n (x) 1 0 2 2n 1 2x

H en (x) 1 0 1 n 1 x

Tn (x) 1 0 2 1 1 x

33
Cn (x) 1 0 1 1 2 x

Tn* (x) 1 0 1 1/4 1 x

U n (x) 1 0 2 1 1 2x

S n (x) 1 0 1 1 1 2x

The expression for basis function using recurrence law is given by

an 1 f n 1 (x)  (an  b n x) f n (x)  an 1 f n 1 (x) .

where n  0 represents the degree of the polynomial.

In terms of theory, a orthonormal basis functions would be desirable when projecting

continuation values. This means that

b 0, n  m.

a
f n (x) f m (x) dx  
1, n  m.

For different polynomials, the limits of this integral i.e. the value of a and b varies. See

Abramowitz & Stegun (1972) for details. However, if the range of underlying asset

prices is not in the interval [a,b] like in most cases, the basis function will not be

orthonormal basis and the number of terms used in the regressions need to be

added.

34
Furthermore, it is proved by Abramowitz & Stegun (1972) that the relationships

between those polynomials are expressed as

x
H en (x)  2 n /2 H n ( ),
2
1
Tn (x)  U n (x)  U n2 (x) ,
2
x
Cn (x)  2 Tn ( ),
2
x
Sn (x)  U n ( ).
2

It is showed in Abramowitz & Stegun (1972), from tables 22.3 to 22.10, the

coefficients of each of those polynomials with respect to power basis form a

nonsingular matrix which implies that each polynomial generate the same span as

power function. Thus, different types of polynomial generate identical results when

pricing option value.

3.3. Another Numerical Method for Pricing American Derivatives: Binomial Methods

For the purpose of comparing the resulting option price simulated by LSM approach

with the option value calculated using binomial method, the main objective of this

section is to introduce the algorithm for Binomial methods.

The value of options and other derivatives are assumed to vary continuously as a

function of time through the Black Scholes approach. However, stocks and options

35
are purchased at discrete times in reality. Binomial methods introduced by Cox, Ross

& Rubinstein (1979) provide a convenient method for valuing options and other

derivative securities by modeling the continues random walk with a discrete random

walk.

Suppose that the life time of an option is divided into M discrete steps from t  0 to

the maturity t  T with t ranging from t  0,  t , 2 t ,3 t ,..., up to M  t  T . If S is

known at time t, then at time S (t   t) it may take only two possible values; see

figure (3.1).

Assume that the probability Pup  p of stock s will increase in value from S to uS with

u  1 is known (as is the probability Pdown  1  p that the value of the stock S will

move down from S to dS with 0  d  1 ). Note Pup  Pdown  1 .

Figure 3.1. Asset price movement in the binomial method.

The three unknown parameters u, d, p is chosen in such a way that the crucial

36
statistic properties of the discrete random walk described above coincide with those

of the continuous random walk (Wilmott, Howison & Dewynne, 1995). Then, those

parameters can be determined by comparing the discrete random walk with the

continuous risk-neutral random walk and imposing certain constraints.

Starting with a given value of asset price, the remainder of the life time of this option is

divided into M time steps with size of  t  (T  t ) / M . The asset prices S is assumed

to changes only at discrete times  t , 2 t ,3 t ,..., up to M  t  T . Then a binary tree is

construct from t  0 to t  T to determine possible values of S at maturity. This

binary tree is built from a given value of S, and then generate two possible underlying

asset prices (uS and dS) at the first stopping point, after that produce three possible

asset prices at the second time step, and so forth until the maturity; see figure 3.2.

Note that the binary tree reconnects with itself, that is to say, an up jump followed by a

down jump will lead to the asset price as a down jump followed by an up jump.

37
Figure 3.2. The binomial tree of possible asset prices.

Let S m denotes the asset price at time step M. To ensure that the discrete random

walk alone the tree has the same variance and mean as the continuous random walk

under the risk neutral condition, an up jump with probability p and the jump sizes u

and d are chosen, i.e., given S  S m at time step m t , the value of u, d, p are

determined by equating the expected values and variance of S m 1 at time (m  1) t

under continuous random walk in a risk neutral world and the discrete random walk.

Given the asset value S m at time step m t , the expected value of S m 1 for the

continuous case is


Ec  S m 1 | S m    S ' p (Sm , m  t;S', (m  1) t) dS'
0

 e r t S m ,

2
 S' 1 
 log( )  (r  2 )(t'  t) 
 S 2 
1
where p (S, t;S', t')  e 2 2 (t'  t)
is the probability density function
 S ' 2 (t' t)

for the continuous risk neutral random walk given by

dS
  dX  rdt .
S

Under the circumstance of the discrete binomial random walk, the expected value of

38
S m 1 , given S m is

Ed  S m 1 , S m    pu  (1  p) d  S m .

Equating these two expected values gives

pu  (1  p) d  e r t . (3.16)

In the continuous case,


Ec (Sm 1 ) 2 | S m    ( S ') 2 p (Sm , m  t;S', (m  1) t) dS'
0

2
 e(2r  ) t
(Sm ) 2 .

Thus, the variance of S m 1 , given S m , is defined as

Varc  S m 1 | S m   Ec (Sm 1 ) 2 | S m   ( Ec  S m 1 | S m  ) 2

2
 e 2 r t (e  t  1)(Sm ) 2 .

In the discrete case,

Ed (Sm 1 ) 2 | Sm   (pu 2  (1  p) d 2 )(Sm ) 2 .

Therefore, under the discrete binomial process, the variance is given by

39
Vard  S m 1 | S m   (pu 2  (1  p) d 2  e 2 r t )(Sm ) 2 .

Equating these two variance the result is

2
pu 2  (1  p) d 2  e(2r  ) t
. (3.17)

Equation (3.16) and (3.17) represent two equations in 3 unknowns u, d, p. Thus, an

additional constraint is required to determine these three unknown parameters. Since

(3.16) and (3.17) determine all the statistically important properties of discrete

random walk, the choice of another equation is arbitrary to some extent. There are

two common choices,

1
u (or ud  1 ), (3.18)
d

and

1
p . (3.19)
2

1
a. The case u  .
d

In this case, u, d, and p are determined by equation (3.16), (3.17) and (3.18).

From equation (3.16),

40
e r t  d
p .
ud

From equation (3.17),

2
e(2r  ) t  d 2
p . (3.20)
u2  d 2

Equating above expressions gives

2
e(2r  ) t  d 2
ud  .
e r t  d

In this case, consider ud  1 , then

2
(u  d)(e r t  d)  e(2r  ) t
d2

which gives

1 r t 2
e  de r t  1  d 2  e(2r  ) t  d 2 ,
d

or

2
d 2 e r t  (1  e(2r  ) t
) d  e r t  0 .

then gives the quadratic equation

41
d 2  2 Ad  1  0 ,

1 2
where A  (e  r t  e(r  ) t ) .
2

Solving for d and using (3.18) to determine u and (3.20) to find p, which gives

e r t  d
d  A  A2  1 , u  A  A2  1 , p  .
ud

Note that 0  d  1 , u  1 and 0  p  1 . Thus if too large a time step is taken, it is

possible for the method to fail.

1
b. The case p  .
2

1
If p  , equations (3.16) and (3.17) yield
2

2
u  d  2e r t , u 2  d 2  2e(2r  ) t
.

These equations gives

2
(2e r t  d ) 2  d 2  2e(2r  ) t
,

or

2
4e 2 r t  4de r t  2d 2  2e(2r  ) t

42
Which gives

2 2 1
d  e r t (1  e t
 1) , u  e r t (1  e t
 1) , p  ,
2

where once again  t cannot be too large due to the requirement u  1 and

0  p 1.

With the above result of the value of u,d and p, a binary tree of possible asset prices

could be built. Let S nm denote the n possible values of the asset at time step m with

S nm  d m  nu n S00 for n  0,1, 2,..., m and m  0,1, 2,.., M , where S00 is the current asset

price. The coefficient n represents the number of up jumps. Note that the total number

of lattice points growth quadratically with the number of time steps, which means that

a large number of time steps can be taken. After determining the values of asset price

S nm at all lattice points in the binary tree, the value of option at the expire date

t  T with m  M can be obtain according to the payoff function. For example, the

payoff function for a vanilla put with strike price E is

VnM  max(E  SnM , 0) , for n  0,1, 2,..., M .

For a vanilla call with strike price E, the payoff function is

VnM  max(SnM  E, 0) , for n  0,1, 2,..., M .

The next step is to move backwards down the tree and calculate the value of the

option denoted by Vnm .

43
The present value of the option can be calculated by discounting the expected value

of the option at time step m t obtained from the values at time step (m  1) t using

risk-free interest rate r,

e r tVnm  pVnm11  (1  p )Vnm 1 .

This gives

Vnm  e  r t  pVnm11  (1  p)Vnm 1 

where m  M  1, M  2,..., 0 with n  0,1, 2,..., m .

For American options, the possibility of early exercise of an option can be easily

incorporate into the binomial model. The American option can be exercised at any

time t before maturity T, its payoff function is denoted by  (S) . Then V (S, t)   (S) , if

it is optimal to exercise the option, otherwise, if V (S, t)   (S) , it is optimal to retain

the option. The value of the option is the maximum of two possibilities, i.e.

Vnm  max( (Snm ), e  r t  pVnm11  (1  p)Vnm 1  ) .

The option prices need to be evaluated from the payoff functions in the case of

American options, thus the value of S nm must be restored throughout the

construction of the binomial tree, which implies that the memory requirements vary

quadratically with the number of time steps, as does the execution time.

44
4. C++ Code for the Algorithm

In this section, the implementation of LSM approach and Binomial methods in C++

will be introduced. The version of C++ is “Dev-C++ 5.0 beta 9.2”.

4.1. The C++ Implementation Using LSM approach

This section provide a brief description of functions and variables used in the C++

project.

The functions created to implement LSM approach is listed as follows:

void NormalDistribution(matrix<double> & R);

void Cumprod(matrix<double> R, matrix<double> & S, double S0, double r,


double sigma, double dt);

void End(matrix<double> S, matrix<double> & CF, double K);

void Find(matrix<double> S, vector<int> &vec, matrix<double> &X, double


K, int x);

void SubMatrix(matrix<double> CF, vector<int> vec, matrix<double> & Y,


int x);

Void MatrixMerge(matrix<double> m1, matrix<double> & m2, int


basefunction);

void Laguerre(double current, matrix<double> & m);


void Power(double current, matrix<double> & m);
void Hermite(double current, matrix<double> & m);

45
void InverseMatrix(matrix<double> m1, matrix<double> & m2);

void MatrixLeftDivisionMatrix(matrix<double> m1, matrix<double> m2,


matrix<double> & m3);
void MaxK(matrix<double> m1, matrix<double> & m2, double K);
void MaxKC(matrix<double> m1, vector<int> & vec1,double K,
matrix<double> m3);

void Corresponding(vector<int> vec1, vector<int> vec2, vector<int> &


vec3);
void Corresponding1(vector<double> vec1, vector<int> vec2,
vector<double> & vec3);

int isInVector(vector<int> ve1, int temp);

void BinomialMethod(double S0, double K, double r, double T, double sigma,


int N);

void LSM(double S0,double K, double r, double T, double sigma, int N,


int M, int basefunction);

void menu(double S0, double K, double r, double T, double sigma, int N,


int M, int method, int basefunction);

The algorithm of LSM approach is implemented in function LSM(double S0, double K,

double r, double T, double sigma, int N, int M, int basefunction):

void AmericanOption::LSM(double S0,double K, double r, double T, double


sigma, int N, int M, int basefunction)
{
clock_t start, finish;

double dt = T/N;

matrix<double> R(N, M);


matrix<double> S(N+1, M);
matrix<double> CF(N+1, M);

46
NormalDistribution(R);

Cumprod(R, S, S0, r, sigma, dt);

CF=zero_matrix<double>(N+1, M);

End(S, CF, K);

start = clock();

for(int i = N-1; i > 0; i--)


{
vector<int> vec;
matrix<double> X;

Find(S, vec, X, K, i);

matrix<double> Y(1, vec.size());


SubMatrix(CF, vec, Y, i+1);
Y = Y*exp(-r*dt);

matrix<double> X1(1, vec.size());


X1 = X/S0;

matrix<double> R1(X1.size2(), 3);


MatrixMerge(X1, R1, basefunction);

matrix<double> a(3, 1);


MatrixLeftDivisionMatrix(R1, trans(Y),a);
matrix<double> C(R1.size1(), 1);
C=prod(R1, a);

vector<int> Jdx(C.size1());
MaxKC(X, Jdx, K, C);

vector<int> IJdx;
Corresponding(vec, Jdx, IJdx);

vector<double> XJdx;

47
vector<double> tempX(X.size2());
for(int j=0;j<tempX.size(); j++)
tempX(j)=X(0, j);
Corresponding1(tempX, Jdx, XJdx);

for(int j = 0; j < M; j++)


{
int position = isInVector(IJdx, j);
if(position > 0)
{
CF(i,j) = K - XJdx(position) > 0 ? K - XJdx(position): 0;
}else{
CF(i, j) = exp(-r*dt)*CF(i + 1, j);
}
}
}
double Price = 0;
for(int i = 0; i < M; i++)
{
Price += CF(1, i);
}
Price = exp(-r*dt)*Price/M;
Finish = clock();

std::cout << "LSM--the option price is:" << Price << ",the time is(ms):
" << finish-start << std::endl;
}

The matrix R, matrix S and matrix CF are used to store the normal distribution, all the

simulated underlying asset price paths and the option cash flow paths, respectively.

The function NormalDistribution(R) could generate a normal distribution R which have

expected value 0 and variance 1, which could be written as

void AmericanOption::NormalDistribution(matrix<double> & m)


{
boost::mt19937 engine((int32_t)time(0));

48
boost::normal_distribution<double> nor_d(0.0, 1.0);
boost::variate_generator<boost::mt19937 ,
boost::normal_distribution<double> > myrandom(engine, nor_d);

for(int i=0; i < m.size2(); i++)


for(int j=0; j < m.size1(); j++)
{
m(j, i) = myrandom();
}
} .

Then, function Cumprod(matrix<double> m, matrix<double> & m1, double S0, double

r, double sigma, double dt) is introduced to simulate the underlying asset price paths,

the code is as follows,

void AmericanOption::Cumprod(matrix<double> m, matrix<double> & m1, double


S0, double r, double sigma, double dt)
{
for(int i=0; i < m1.size2(); i++){
m1(0, i) = 1.0*S0;
}

for(int i = 0;i < m.size1(); i++)


{
for(int j=0; j<m.size2(); j++)
{
double temp=S0;
for(int k=i; k >= 0; k--)
temp=temp*exp((r-sigma*sigma/2)*dt+sigma*sqrt(dt)*m(k,j));
m1(i+1,j) = temp;
}
}
}

All the elements in matrix CF is initialize to 0, and then use function

49
End(matrix<double> m1,matrix<double> &m2,double K) to change the last row of

matrix CF to the option value at the expire date i.e. the value of payoff function

 (S)  max(E  S, 0) :

void AmericanOption::End(matrix<double> m1,matrix<double> &m2,double K)


{
for(int i=0;i<m1.size2();i++)
{
if(K-m1(m1.size1()-1,i)>0)
m2(m2.size1()-1,i)=K-m1(m1.size1()-1,i);
}
}

Moreover, the key point of LSM approach is to estimate the continuation value and

find the optimal stopping time. First, set vector vec and Matrix X to store the location

and the value the underlying asset prices at a specific time step for all the

in-the-money paths, which can be implemented by the function Find(matrix<double>

S, vector<int> & vec, matrix <double> &X, double K, int x):

Void AmericanOption::Find(matrix<double> S, vector<int> & vec, matrix


<double> &X, double K, int x)
{
int count = 0;
for(int i = 0; i < S.size2(); i++)
{
if(S(x, i) < K)
{
count++;
}
}
vec.resize(count, true);
X.resize(1, vec.size());

50
Count = 0;
for(int i = 0;i < S.size2(); i++)
{
if(S(x, i) < K)
{
vec(count) = i;
X(0, count) = S(x,i);
count++;
}
}
}

Then, use function SubMatrix(matrix<double> m1, vector<int> vec1, matrix<double>

&m2, int x) to save the option price corresponding to in the money paths in the row

i+1 of matrix CF in matrix Y.

void AmericanOption::SubMatrix(matrix<double> m1, vector<int> vec1,


matrix<double> &m2, int x)
{
for(int i = 0; i<vec1.size(); i++)
{
m2(0, i) = m1(x, vec1(i));
}
}

The next step is to store basis functions in matrix R1 which is implemented by

function MatrixMerge(matrix<double> m1, matrix<double> &m2, int basefunction):

Void AmericanOption::MatrixMerge(matrix<double> m1, matrix<double> &m2,


int basefunction)
{
for(int i = 0; i < m1.size2(); i++)
{
matrix<double> temp(1, 3);
switch(basefunction){

51
case 0:{
Laguerre(m1(0, i), temp);
break;}
case 1:{
Power(m1(0, i), temp);
break;}
case 2:{
Hermite(m1(0, i), temp);
break;}
}
Laguerre(m1(0, i), temp);
for(int j = 0; j < 3; j++)
{
m2(i, j) = temp(0, j);
}
temp.clear();
}
}
void AmericanOption::Laguerre(double current,matrix<double> &m)
{
m(0,0)=exp(-current/2);
m(0,1)=(exp(-current/2))*(1.0-current);
m(0,2)=(exp(-current/2))*1.0/2*(2-4*current+current*current);
}

void AmericanOption::Power(double current,matrix<double> &m)


{
m(0,0)=1;
m(0,1)=current;
m(0,2)=current*current;
}

void AmericanOption::Hermite(double current,matrix<double> &m)


{
m(0,0)=exp(current*current);
m(0,1)=2*current;
m(0,2)=-2+4*current*current;
}

52
Then, with the values stored in matrix R1 and matrix Y, the coefficient matrix a of

basis functions is obtained by function MatrixLeftDivisionMatrix(matrix<double> m1,

matrix<double> m2, matrix<double> & m3) and function prod(R1, a).

void AmericanOption::MatrixLeftDivisionMatrix(matrix<double> m1,


matrix<double> m2, matrix<double> & m3)
{
matrix<double> temp(m1.size2(), m1.size1());
Temp = trans(m1);
matrix<double> temp1(m1.size2(), m1.size2());
temp1 = prod(temp, m1);
matrix<double> temp2(m1.size2(), m1.size2());
matrix<double> temp3(m1.size2(), 1);
InverseMatrix(temp1, temp2);
temp3 = prod(temp, m2);
m3 = prod(temp2, temp3);
}

where the inverse matrix is calculated by

void AmericanOption::InverseMatrix(matrix<double> m1,matrix<double> &m2)


{
for(int i=0;i<m2.size1();i++)
for(int j=0;j<m2.size1();j++)
{
if(i==j)
m2(i,j)=1;
else
m2(i,j)=0;
}

for(int i=0;i<m1.size1()-1;i++)
for(int j=i+1;j<m1.size1();j++)
{
double Proportion=m1(j,i)/m1(i,i);
for(int k=i;k<m1.size1();k++)

53
{
m1(j,k)=m1(j,k)-m1(i,k)*Proportion;
}
for(int k=0;k<m1.size1();k++)
{
m2(j,k)=m2(j,k)-m2(i,k)*Proportion;
}
}

for(int i=m1.size1()-1;i>=1;i--)
for(int j=i-1;j>=0;j--)
{
double Proportion=m1(j,i)/m1(i,i);
for(int k=m1.size1()-1;k>=i;k--)
{
m1(j,k)=m1(j,k)-m1(i,k)*Proportion;
}
for(int k=0;k<m1.size1();k++)
{
m2(j,k)=m2(j,k)-m2(i,k)*Proportion;
}
}

for(int i=0;i<m1.size1();i++)
for(int j=0;j<m1.size1();j++)
{
m2(i,j)=m2(i,j)/m1(i,i);
}
}

After that, determine the stopping rule by compare value of exercise immediately and

continuation, which can be done by MaxKC(matrix<double> m1, vector<int> &vec1,

double K, matrix<double> m3), and set the elements representing time step when

option is exercised to one, others to zero.

void AmericanOption::MaxKC(matrix<double> m1, vector<int> &vec1, double K,

54
matrix<double> m3)
{
for(int i = 0; i < m1.size2(); i++)
{
if(K - m1(0, i) > m3(i, 0))
vec1(i) = 1;
else
vec1(i) = 0;
}
}

Then, setting vector IJdx and Xjdx to store the location and value that option is

exercised early. This is implemented by function Corresponding(vector<int> vec1,

vector<int> vec2, vector<int> & vec3) and function Corresponding1(vector<double>

vec1, vector<int> vec2, vector<double> &vec3).


AmericanOption::Corresponding(vector<int> vec1, vector<int> vec2,
vector<int> & vec3)
{
int count = 0;
for(int i = 0; i < vec2.size(); i++)
{
if(vec2(i) == 1)
count++;
}
vec3.resize(count, true);
count = 0;
for(int i = 0; i < vec2.size(); i++)
{
if(vec2(i) == 1)
{
vec3(count) = vec1(i);
count++;
}
}
}
void AmericanOption::Corresponding1(vector<double> vec1, vector<int> vec2,
vector<double> & vec3)

55
{
int count = 0;
for(int i = 0; i < vec2.size(); i++)
{
if(vec2(i) == 1)
count++;
}
vec3.resize(count, true);
count = 0;
for(int i = 0; i < vec2.size(); i++)
{
if(vec2(i) == 1)
{
vec3(count) = vec1(i);
count++;
}
}
}

The function isInVector(vector<int> vec, int temp) is used to determine whether a

path is one of the elements of vector IJdx.

int AmericanOption::isInVector(vector<int> vec, int temp)


{
int i = 0;
for(i = 0; i < vec.size(); i++)
{
if(temp == vec(i))
break;
}
if(i != vec.size())
return i;
else
return -1;
}

Moreover, the following loop is used to update the data in matrix CF:

56
for(int j = 0; j < M; j++)
{
int position = isInVector(IJdx, j);
if(position > 0)
{
CF(i,j) = K - XJdx(position) > 0 ? K - XJdx(position): 0;
}else{
CF(i, j) = exp(-r*dt)*CF(i + 1, j);
}
}
}

Eventually, calculate the average of the discounted cash flows over all paths to get

the option price:

double Price = 0;
for(int i = 0; i < M; i++)
{
Price += CF(1, i);
}
Price = exp(-r*dt)*Price/M;

4.2. The C++ Implementation Using Binomial methods

The following code is the C++ implementation of using Binomial method to pricing

American option.

void AmericanOption::BinomialMethod(double S0, double K, double r, double


T, double sigma, int N)
{
clock_t start, finish;
Start = clock();
double deltat = T/N;
double A = 1.0/2*(exp(-r*deltat) + exp((r + sigma*sigma)*deltat));
double d = A - sqrt(A*A - 1);

57
double u = A + sqrt(A*A - 1);
double p = (exp(r*deltat) - d)/(u - d);

double q = 1 - p;

matrix<double> S(N, N+1);


matrix<double> V(N, N+1);

for(int i=0; i<N; i++)


{
for(int j = 0; j <= i + 1; j++)
{
S(i, j) = S0*pow(u, (double)i + 1 - j)*pow(d, (double)j);
if(K - S(i, j) > 0)
V(i, j) = K - S(i, j);
else
V(i, j) = 0;

}
}

matrix<double> F(N, N);


F = zero_matrix<double>(N, N);

for(int i = 0; i < N; i++)


{
double t1 = V(N - 2, i);
double t2 = exp(-r*deltat)*(p*V(N - 1, i) + q*V(N - 1, i + 1));
if(t1 > t2)
F(N - 2, i) = t1;
else
F(N - 2, i) = t2;
}

for(int g = N - 3; g >= 0; g--)


for(int h = 0; h <= g + 1;h++)
{
double t1 = V(g, h);
double t2 = exp(-r*deltat)*(p*F(g + 1,h) + q*F(g + 1, h + 1));
if(t1 > t2)

58
F(g,h) = t1;
else
F(g,h) = t2;
}

double Price;
if(exp(-r*deltat)*(p*F(0, 0) + q*F(0, 1)) > 0)
Price = exp(-r*deltat)*(p*F(0, 0) + q*F(0, 1));
else
Price = K - S0;

Finish = clock();
std::cout << "Binomial--the option price is:" << Price << ",the time
is(ms):" << finish-start << std::endl;
}

4.3. The Result of C++ Project

Figure 4.1. The result of C++ project.

The users of this project could choose the items they want to change from the list in

59
figure 4.1, or the option price will be calculated using the default values. The result will

be the value of American option and running time.

60
5. Numerical Results

Number of paths Wn (x) Ln (x) H n (x)

1000 2.41193 2.42409 2.22432

Running Time 1296 864 959

5000 2.27066 2.3045 2.31596

Running Time 14862 10449 14356

10000 2.33745 2.32963 2.33589

Running Time 35356 42060 26735

20000 2.32585 2.3062 2.32463

Running Time 101896 101049 100085

30000 2.30807 2.3049 2.29215

Running Time 225780 239048 224000

Table 5.1. American put option prices

The parameters of the option are:   0.2 , r  0.06 , T  1 , S 0  40 , E  40 .

Besides, the American option is approximated for 70 exercise dates. The data in table

5.1 American option prices and running time simulated using 1000, 5000, 10000,

20000, 30000 stochastic processes respectively. The first row shows the 3

polynomial used. For Binomial method with the same parameters and 1000 time

steps, the option value is 2.31952.

61
As expected, for a specific type of polynomial, the option prices do not fluctuate

significantly, since the coefficient of each of these three polynomials with respect to

power functions form a nonsingular matrix, which implies that the span generated by

each of polynomial is identical to the one generated by power functions (Moreno &

Navas, 2001).

Notice that the option prices estimated using LSM approach are generally lower than

those calculated by Binomial methods, this is because that only 100 stopping points is

considered.

62
6. Conclusion

In this dissertation a detailed analysis of Least-Squares Monte Carlo (LSM) approach

proposed by Longstaff and Schwartz (2001) is performed. This method is accurate,

easy in implementation. To illustrate this approach, we first introduce some financial

background knowledge for better understanding of this algorithm. And we use an

realistic example to pricing American put options as well. To compare the different

results of numerical methods for American option pricing, the binomial method is

introduced in the dissertation.

However, the C++ project for the implement of the LSM technique is still inefficient in

some respects. The running time become much too long when the number of

simulation paths increase, thus the algorithm in C++ still need to be optimized in the

future. Moreover, the implementation should also be extended to include the pricing

of other type of derivatives, such as American -Bermuda-Asian option and cancelable

index amortizing swaps, and some high dimensional problems.

For further research, LSM methods should compare the results with more other

approaches for American option pricing such as the traditional finite difference

methods to test the accuracy of its results.

63
References

Abramowitz, M., & Stegun, I. (1972). Handbook of mathematical functions (1st ed.).

Amemiya, T. (1985). Advanced econometrics (1st ed.). Cambridge, Mass.: Harvard

University Press.

Boyle, P. (1977). Options: A monte carlo approach. Journal Of Financial

Economics, 4(3), 323--338.

Choudhury, A., King, A., Kumar, S., & Sabharwal, Y. (2008). Optimizations in

financial engineering: the least-squares Monte Carlo method of Longstaff and

Schwartz, 1--11.

Clément, E., Lamberton, D., & Protter, P. (2002). An analysis of a least squares

regression method for American option pricing. Finance And Stochastics, 6(4),

449--471.

Cox, J., Ross, S., & Rubinstein, M. (1979). Option pricing: A simplified

approach. Journal Of Financial Economics, 7(3), 229--263.

Föllmer, H., & Schied, A. (2002). Stochastic Finance (2nd ed.). Berlin: Walter de

Gruyter.

64
Glasserman, P. (2004). Monte Carlo methods in financial engineering (1st ed.). New

York: Springer.

Harrison, J., & Pliska, S. (1981). Martingales and stochastic integrals in the theory of

continuous trading. Stochastic Processes And Their Applications, 11(3), 215--260.

Kienitz, J., & Wetterau, D. (2012). Financial modelling (1st ed.). Chichester, West

Sussex, U.K.: Wiley.

Longstaff, F., & Schwartz, E. (2001). Valuing American options by simulation: A

simple least-squares approach. Review Of Financial Studies, 14(1), 113--147.

Moreno, M., & Navas, J. (2001). On the robustness of least-squares Monte Carlo

(LSM) for pricing American derivatives.

Moreno, M., & Navas, J. (2003). On the robustness of least-squares Monte Carlo

(LSM) for pricing American derivatives. Review Of Derivatives Research, 6(2),

107--128.

Peskir, G., & Shiryaev, A. (2006). Optimal stopping and free-boundary problems (1st

ed.). Basel: Birkhäuser Verlag.

Rao, C., & Toutenburg, H. (1999). Linear models (2nd ed.). New York: Springer.

65
Sarwar, B., Karypis, G., Konstan, J., & Riedl, J. (2002). Incremental Singular Value

Decomposition Algorithms for Highly Scalable Recommender Systems.

Stentoft, L. (2004). Assessing the least squares Monte-Carlo approach to American

option valuation. Review Of Derivatives Research, 7(2), 129--168.

Wilmott, P., Howison, S., & Dewynne, J. (1995). The mathematics of financial

derivatives(1st ed.). Oxford: Cambridge University Press.

ukessays,. (2014). Comparing Binomial Tree, Monte Carlo Simulation And Finite.

Retrieved 10 September 2014, from

http://file:///C:/Users/apple/Downloads/ukessays.com-Comparing_Binomial_Tree_Mo

nte_Carlo_Simulation_And_Finite.pdf

66

You might also like