Python for Finance: Analyze Big Financial Data

(Elle) #1

The algorithm we describe in the following is called Least-Squares Monte Carlo (LSM)


and is from the paper by Longstaff and Schwartz (2001). It can be shown that the value of


an American (Bermudan) option at any given date t is given as Vt(s) = max(ht(s),Ct(s)),


where is the so-called continuation value of the option


given an index level of St = s.


Consider now that we have simulated I paths of the index level over M time intervals of


equal size . Define Yt,i ≡ e


–rt

Vt+ t,i to be the simulated continuation value for path i at


time t. We cannot use this number directly because it would imply perfect foresight.


However, we can use the cross section of all such simulated continuation values to


estimate the (expected) continuation value by least-squares regression.


Given a set of basis functions bd, d = 1,...,D, the continuation value is then given by the


regression estimate , where the optimal regression parameters


*

are the


solution of the least-squares problem stated in Equation 10-13.


Equation 10-13. Least-squares regression for American option valuation


The function gbm_mcs_amer implements the LSM algorithm for both American call and


put options:


[ 39 ]

In  [ 64 ]: def gbm_mcs_amer(K, option=‘call’):
”’ Valuation of American option in Black-Scholes-Merton
by Monte Carlo simulation by LSM algorithm

                                                    Parameters
==========
K : float
(positive) strike price of the option
option : string
type of the option to be valued (‘call’, ‘put’)

                                                    Returns
=======
C0 : float
estimated present value of European call option
”’
Free download pdf