Li, Chang - Computational Methods for American Put Options

Embed Size (px)

Citation preview

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    1/48

    COMPUTATIONAL METHODS FOR AMERICAN PUT

    OPTIONS

    Chang Li 759728

    September 25, 2005

    Abstract

    In this paper, we shall study various numerical methods of pricing American vanilla

    put options, including the most popular projected successive overrlaxation (PSOR) al-

    gorithm, parametric principal pivoting (PPP) algorithm, large-scale solution of a linear

    programming formulation, explicit method and well-known tree method. We shall test

    all these five approaches empirically, modeling their timing and accuracy (error) behavior

    as functions of two discretization parameters N t and N s. Then we shall furthermore to

    draw for each case of them the optimal curves capturing the optimal relationship between

    the accuracy (error) level and cputime and henceforth make relevant comparisons among

    algorithms.

    Key Words: American options, parabolic PDEs, linear complementarity problem,

    least elements, linear programming, large-scale method, projected successive overrelax-

    ation, parametric principal pivoting

    1 Introduction

    The aim of this paper is to investigate a number of numerical methods of pricing American

    (vanilla) put optionfive different algorithms are of our great interest: Projected Successive

    OverRelaxation algorithm, Parametric Principal Pivoting algorithm, Linear Programming,

    Explicit method and Tree method. We shall approximate for each case the timing and error

    models (as functions of both time steps and space steps), and thereby describe the relationship

    between the accuracy (error) level and minimum cputime.

    1

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    2/48

    In Section 2, we shall first start with a brief summary of well-known results for Amer-

    ican vanilla put option, then we set up the equivalence between various formulations of an

    American option problem including linear complementarity problem, variational inequality,

    least element and abstract linear program. These equivalence properties are our theoretical

    cornerstones of empirical experiments.

    In Section 3, we shall consider finite difference approximations to various equivalent for-

    mulations of American put problem in Section 2 as well as binomial tree approximation

    mechanism. Standard algorithms are written in matrix language.

    In Section 4, we test numerically the timing and error behaviors of each algorithm, and

    based on these observations, we specify and estimate our empirical timing and error functions

    with respect to two discretization parametersthe numbers of time steps and space steps.

    Then we will be able to go one step further to obtain for each case the optimal curve

    describing the optimal relationship between the accuracy (error) level and cputime.

    2 The American Put Option

    2.1 Pricing in theory

    Let us consider the pricing of American stock option in the standard Black-Scholes setting,

    namely, we postulate that the evolutions of stock price and bond price satisfy the following

    stochastic differential equations (PDEs):

    dSt = Stdt + StdWt

    dBt = rBtdt

    where, for the sake of simplicity, we assume that , r, and are positive constants denoting

    the volatility parameter, risk-less interest rate and drift parameter respectively, and Wt is a

    standard Wiener process with mean zero and variance dt. After the equivalent martingale

    measure transformation (due to the Girsanovs theorem), the stock price process under the

    risk-neutral world can be presented as:

    dSt = rStdt + StdWt,

    where Wt is a Wiener process under this measure. Let (S(t)) = (K S(t))+ denote the

    given payoff function of a standard (vanilla) American put option on a stock with the time

    2

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    3/48

    of expiry T and a given strike price K, that is, the payoff of a American put on exercise at

    any stopping time t

    [0, T] is given by its payoff function. The first main objective of this

    paper is to characterize, in a manner suitable for numerical solution, the value of the option

    V(x, t) : R+ [0, T] R as a function of the stock price x > 0 and time t [0, T].If we first of all consider the case in which the security were European, then the V(x, t)

    of an European option is simply the solution of the linear parabolic (PDE) derived by Black

    and Scholes [1], i.e.

    LBSV + Vt

    = 0

    for (x, t)

    R+

    [0, T] and terminal condition V(

    , T) = , where the differential operator is

    defined as: LBS := 122x2 2

    x2+ rx x r.

    However, pricing an American put is more difficult than just solving a PDE. The value

    function can be dealt with as the solution of a classical optimal stopping problem, namely

    to choose the stopping time that maximizes the conditional expectation of the discounted

    payoff, and this optimal stopping time (t) (which is a stochastic variable) may be shown to

    be given by

    (t) = inf{s [t, T] : V(S(s), s) = (S(s))}

    that is, the first time the option value falls to simply that of the payoff for the immediate

    exercise. Hence, the domain of the value function may be partitioned into an implicitly

    defined region C called continuation region and a stopping region Sgiven by:

    C = {(x, t) R+ [0, T] : V(x, t) > (x)}S = {(x, t) R+ [0, T] : V(x, t) = (x)}

    Clearly this is a partition, because we have V(x, t)

    (x) everywhere.

    On the whole domain R+ [0, T], we have LBSV + (V/t) 0 (the Black-Scholesinequality), since in order to preclude arbitrage opportunities, the drift of the (undiscounted)

    price process cannot be greater than the risk-free rate. Hence, as long as the current stock

    price process (S(t), t) is in C, it is optimal to continue, and the value of the American optionis equal to the value of a European contract that pays (S(t), t) at the exercise boundary

    between the continuation and stopping regions. This is also known as the free boundary

    condition compared with the terminal condition in the European case, and sometimes one

    3

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    4/48

    more condition is necessary to define the exercise boundary, usually the smooth pasting

    condition i.e. (V/x) =

    1 on the boundary.

    6

    PPPPPPPPPPPPPPPq

    BBBBBBBB

    1

    V(x, t)

    T t

    x

    Sp

    Cp

    Figure 2.1 Sketch of American put value function

    However, as soon as the price process crosses this exercise boundary into the stopping

    region meaning that it is optimal to exercise the option right away, the value of the option is

    clearly equal to the payoff function (x), and the Black-Scholes (strict) inequality holds.

    To summarize, the value of an American put option V(x, t) satisfies the following condi-

    tions for all (x, t) R+ [0, T]: either

    LBSV + (V/t) = 0, and V > in C

    or

    LBSV + (V/t) 0, and V = in S.

    If we formally reverse the direction of time of the value function, that is, we can change

    to a more standard setting by introducing a new unknown function v(t) = V(T

    t), in terms

    of this new unknown, the above equations become to: either

    (v/t) = LBSv, and v > in C

    or

    (v/t) > LBSv, and v = in S

    and both of the conditions are consistent in the property ((v/t) LBSv) (v ) = 0,where the notation

    denotes the pointwise minimum of the two functions.

    4

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    5/48

    Figure 2.1 presents a theoretical sketch of the American put value function. The projec-

    tions of the continuation and stopping regions onto the value surface are marked as

    Cp and

    Sp respectively.

    2.2 Formulations of the problem

    There are various standard mathematical expressions for the same American put problem

    described above; in fact, we have already seen the free boundary problem in the previous

    subsection. In this following subsection, I shall briefly introduce some of those remaining

    formulations, namely, the linear order complementarity problem (LOCP), the variational

    inequality (VI), the least element problem (LE) and finally the abstract linear program (LP).

    The (OCP) and its corresponding (LP) formats outlined in the following will eventually allow

    us to compute a numerical approximation to the value function of the American put.

    2.2.1 (OCP) and (VI) formulations

    Now let us first of all express the pricing of the American put option in a form that encap-

    sulates these main complementary properties as the following linear order complementarity

    problem (LOCP):

    Theorem 2.1 The American put value function is the unique solution to the linear order

    complementarity problem:

    (OCP)

    v(, 0) = v v/t LBSv(v/t)

    LBSv)

    (v

    ) = 0 a.e.R

    [0, T]

    This (LOCP) format can be regarded as somehow the most straightforward and simple one to

    the pricing problem of an American put option. However, in order to verify the validity of the

    theorem, we still need to introduce another equivalent formulation, namely, the variational

    inequality (VI)i. The equivalence between these two formulations has been extensively studied

    and proved by many mathematicians in the history. (For more detailed knowledge, readers

    iThe (VI) formulation itself is not among our main interests here, so I simply omit it and keep focus on

    those key results i.e. the equivalence between (VI)and (LOCP) and the condition on the uniqueness for (VI).

    5

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    6/48

    may refer to [2].) Hence, the requirement that the differential operator LBS is coerciveii

    for the uniqueness of the solution to the corresponding (VI) (which the Lions-Stampacchia

    theorem implies) should be also considered as that for the original (LOCP). In the American-

    styled problem, it can be shown (ideally) that the differential operator LBS is indeed coercive(due to [8]), and this may complete the verifying of the uniqueness of the (LOCP).

    2.2.2 (LE) and (LP) formulations

    The main results are that the original linear order complementarity problem for American

    put is also equivalent to a least element problem and hence to an abstract linear program and

    under the condition that LBS is a coercive type Z temporally homogeneous elliptic differentialoperator, these three equivalent problems have a unique solution V. Since it has been proved

    that for Black-Scholes model, LBS is indeed coercive type Z (see [8]), this general result alsoprovides the equivalence between these various formulations hence furthermore suggests a

    simple way to solve the equivalent problems numericallyby a suitable discretization: the

    infinite-dimensional abstract linear program (LP) reduces to an ordinary linear program with

    solution in Rn. I shall elaborate on this issue later in the following section.

    3 Discretization Schemes

    In this section, we consider several numerical solutions of the American vanilla put problem

    as solutions to (LOCP), (LP) and widely-used binomial trees. For the numerical treatment

    of (LOCP) and (LP), we shall discretize space and time by standard finite difference ap-

    proximation in order to reduce them into a linear complementarity problem and an ordinary

    linear program respectively which may allow us to solve by well-known algorithms.

    3.1 Tree method

    3.1.1 Risk neutral valuation

    A realistic binomial tree model is the one that assumes stock price movements are composed

    of a large number of small binomial movements. Each of those small binomial movements

    corresponds to a very small time interval of length t, and we assume that in each time

    iiAn operator T is coercive on a Hilbert space H iff R+s.t. v, Tv v2 v H.

    6

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    7/48

    interval the stock price moves from its initial value of S0 to one of two new values, S0u and

    S0d. In general, the parameter u which denotes an up movement should be greater than 1

    and the down movement parameter d < 1. However, here we impose an extra condition on

    the value of u and d (which is firstly proposed by Cox, Ross, and Rubinstein [6]), namely,

    u = 1d . This model is illustrated in the Figure 3.1.

    1

    PPPPPPPPPq

    S0

    p

    1 p

    S0u

    S0d

    Figure 3.1 Stock price movements in time t

    We are going to apply the risk-neutral valuation principle. In the risk neutral world, the

    expected return from all traded securities is the risk-free interest rate and future cash flows can

    be valued by discounting their expected value at the risk-free interest rate. Mathematically,

    it follows that:

    Sert = pSu + (1

    p)Sd

    or

    ert = pu + (1 p)d (3.1)

    where r is the risk-free interest rate, and p denotes the corresponding risk neutral probability.

    In order to give the correct values for the parameters u , d and p, we still need to establish

    one more connection between the input parameter iii and u, d and p. The stochastic process

    assumed for the stock price implies that the variance of the proportional change in the stock

    price in a small time interval of the length t is 2t. Since the variance of a random variable

    Q is E(Q2) E2(Q), it follows that,

    pu2 + (1 p)d2 [pu (1 p)d]2 = 2t (3.2)

    Substituting from the equation (3.1) for p, this reduces to

    ert(u + d) ud e2rt = 2t (3.3)iii represents the volatility level of the stock which I included uniformly in all the MatLab programs as an

    input parameter.

    7

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    8/48

    Recall the extra condition imposed on the relation between u and d,

    u =

    1

    d (3.4)

    then equations (3.1), (3.3) and (3.4) implyiv

    p =ert d

    u du = e

    t (3.5)

    d = et

    3.1.2 Pricing backward through the stock tree

    We shall first of all investigate the generating of a complete tree of stock prices. At time

    zero, the stock price, S0, is known. At time t, according to the mechanism of binomial tree

    described previously, there are two possible stock prices, namely, S0u and S0d; each of these

    nodes are going to be treated as a new initial point, therefore at time 2t, three possible

    stock prices have been evolved, they are S0u2, S0, S0d

    2; and so on. In general, at time idt,

    i + 1 stock prices will be considered, the calculative formula for them are

    S0ujdij j = 0, 1, . . . , i (3.6)

    Note that the tree combines in the sense that an up movement followed by a down

    movement leads to the same stock price as a down movement followed by an up movement.

    The pricing procedure is to work back through the tree from the end to the beginning,

    checking at each node whether early exercise is preferable to holding the option for a further

    time period t. Assuming that our pricing is in a risk-neutral world, this procedure therefore

    requires us to reserve the greater number between the discounted value from the later nodes

    applying the risk-neutral valuation principle and the payoff of immediate exercise as the value

    of American put at current time and stock price. The option values for the final nodes are the

    same as for the European option which are known as (K S(t))+. Eventually, by workingback through all the nodes, the option value at time zero is obtained.

    To summarize, let us express the approach in an algebraical way: the value of an American

    put at its expiration date is

    fN,j = max(K S0ujdNj, 0) j = 0, 1, . . . , N (3.7)ivThe solutions of u and d are only the closely approximate ones to the equations systems (3.1), (3.3)and

    (3.4) where the terms of higher order than dt are ignored.

    8

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    9/48

    where we designate the (i, j) as the jth node at time it. The value at (i, j) of the option

    therefore can be formulated as:

    fi,j = max(K S0ujdij , ert[pfi+1,j+1 + (1 p)fi+1,j]) (3.8)

    for 0 i N, 0 j i.

    3.2 Finite difference approximation

    Before we apply the finite difference discretization scheme to (LOCP) and (LP), it may be

    advantageous to adopt the usual log-transformation to the stock price S, i.e. we define again

    a new function by (t, ) = v(t,exp()). Based on this transformation, the original Black-

    Scholes PDE for an American put therefore reduces to (/t) = L, where L is the constantcoefficient elliptic operator which doesnt have state dependent coefficients, in contrast to the

    original LBSL = 1

    22

    2

    2+ (r 1

    22)

    r (3.9)

    and now refers to the option value as a function of . Correspondingly, some revisions

    are also needed to be made for the payoff function () = (K

    e)+ and continuation and

    stopping regions C and Swhich are defined with respect to the new variable .

    3.2.1 Implicit schemes

    Discretization scheme

    As the first approximation, lets just restrict the domain of the value function R [0, T] to afinite region [L, U] [0, T], for any L < log K < U, this is called the localized version of thevalue function. To avoid those unnecessary inaccuracy arising from the approximation on the

    boundaries points and hence the bad influence on those inside the boundaries, we initialize

    the value function on the boundaries as (L, ) = (L) and (U, ) = (U). It can be shownthat as L, U the solution to the localized (LOCP) and (LP) i.e. the localized functiontends uniformly to the exact solution of (LOCP) and (LP), which are the same American

    put value function on the whole domain. This result is firstly demonstrated by Jaillet et al.

    (1990) for the equivalent localized variational inequality.

    As a usual numerical procedure, we shall discretize the localized (LOCP) by approxi-

    mating the value function by a piecewise constant function, constant on rectangular interval

    9

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    10/48

    points in a regular mesh, on the domain [L, U] [0, T]. In order to retain the simplicity, letsfurthermore introduce some shorthand notations: first of all write mi for the value of the

    general function at points (i, m) defined by:

    mi = (L + i, mt) (3.10)

    where m {0, 1, . . . , M } := M, and i {0, 1, . . . , I } := I; then write i = (L + i)as the terminal payoff at each space point; and corresponding to the initialization we made

    previously, the boundary values therefore follow that m0 = 0, mI = I, and since m is a

    backwards time index, 0i = i.

    Now we are ready to translate the partial derivatives that appear in L into their corre-sponding discrete analogues, using finite difference approximations. We estimate the partial

    derivatives of the value function at a point indexed by (i, m) in the interior of the domain

    I M by

    mi+1 mi1

    2+ (1 )

    m1i+1 m1i1

    2

    2

    2

    mi+1 2mi + mi1

    ()2+ (1 )

    m1i+1 2m1i + m1i1

    ()2(3.11)

    t

    m1i mi

    t

    for [0, 1]. The cases = 0, = 12 , = 1 correspond to explicit, Crank-Nicolson, and theimplicitv discretization schemes, respectively, all of which are second-order accuracy in

    and first-order accurate in t, except for = 12 , which gives second-order accuracy in t.

    Substitution of these discrete forms for their counterparts in (LOCP) gives the discrete

    order complementarity problem (DOCP):

    mi i, 0i = i, mI = 0, m0 = 0ami1 + b

    mi + c

    mi+1 + d

    m1i1 + e

    m1i + f

    m1i+1 0

    (ami1 + bmi + c

    mi+1 + d

    m1i1 + e

    m1i + f

    m1i+1 ) (mi i) = 0

    i I/{0, I}, m M/{0},

    (3.12)

    vWe distinguish between the full implicit method which has = 1, and general implicit methods, which

    have > 0.

    10

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    11/48

    where

    a := 2t

    22 (r2/2)t

    2

    b := 1 + rt +

    2t

    2

    c := 2t22

    + (r2/2)t2

    d := (1 )

    2t22 (r

    2/2)t2

    e := (1 )2t2

    1 f := (1 )2t22

    + (r2/2)t2

    (3.13)

    For the next step, lets write the above element-wise complementarity condition of equation

    (3.12) in a matrix form by collapsing the space and time indices into vectors. Define

    m :=

    m1

    ..

    .mI1

    :=

    1...

    I1

    :=

    (a + d)00

    ...

    0

    . (3.14)

    Then, substituting m0 = 0 and mI = 0 into the equation (3.12), the complementarity

    condition becomes

    m Bm1 + Am 0(m ) (Bm1 + Am ) = 0

    (3.15)

    with the boundary values ()I = 0,

    ()0 = 0, and

    0 = , where A and B are the (I 1)-square tridiagonal matrices given by

    A =

    b c

    a b c

    . . .. . .

    . . .

    a b c

    a b

    B =

    e f

    d e f

    . . .. . .

    . . .

    d e f

    d e

    (3.16)

    Since those boundary conditions have been substituted into (3.15) and hence do not appear

    in its solution, they also have to be given, although separately.

    The complementarity problem described in equation (3.15) is usually referred to a discrete

    (LOCP), because m1 is known at each time step and hence we can get all those solutions

    m, m = 1, . . . , M by running iterations through out time indices. Correspondingly, the

    global linear complementarity problem requires encapsulating all the solution vectors m, m =

    11

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    12/48

    1, . . . , M into an even bigger vector, if we denote

    =

    1

    ...

    M

    , (3.17)

    we can express the discrete (LOCP) problem as

    C ( ) (C ) = 0

    (3.18)

    where, C, are given by

    =

    B...

    C =

    A

    B A

    . . .. . .

    B A

    =

    ...

    (3.19)

    However, before we write down the well-posed equivalent linear programs for both dis-

    crete and global cases, we still have to verify that the equivalence conditions, namely, the

    type Z property and coercivity of the differential operator indeed holds in the matrix sense.Considering the early discrete complementarity problem presented in (3.15), since m1 is

    known at step m, the discretized operator L is represented in finite dimensions by matrix A,so we require that A be type Z and coercive. It is simple to show that a matrix is type Z iff

    it has nonnegative off-diagonal coefficients, which is the classic definition of a Z matrix. It is

    clear here that A is of type Z iff a 0 and c 0, which imposes thatr 2/2

    2/ (3.20)

    As a matter of fact, as long as we take I large enough, this condition holds for all parameter

    values, that is for realistic parameter values the critical value of I is very small. It is also

    simple to be shown that under this condition, A is coercive [7]. We now give the corresponding

    formats of linear program in both discrete and global senses. For any fixed c1 > 0 in R(I1)M

    and c2 > 0 in R(I1)[4],

    (OLP)

    min c1

    s.t.

    C

    min c2m

    s.t. m

    Am Bm1

    (3.21)

    12

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    13/48

    with the boundary values ()I = 0,

    ()0 = 0, and

    0 = .

    Jaillet et al. have shown that as M, I

    , and in case < 1, such that the mesh

    ratio := [t/()2] 0, the solution of the equivalent discretized localized variationalinequality converges to the solution of the localized variational inequality, which, as already

    mentioned previously, itself converges uniformly, as L, U , to the American put valuefunction on the whole domain. Due to the (conditional) equivalence of these various formu-

    lations, the same convergence properties also hold for (DOCP) and (OLP).

    Though the unconditional convergence and stability for the case 12 1 is not yetproven, it is well known for the case of equations, i.e. it will be routinely assumed that there

    is no condition on the time step that is needed to guarantee stability in the (full) implicit

    scheme; for 0 < 12 , we have convergence of the scheme if and only if

    0 12(1 2) . (3.22)

    Solving the discrete problem

    There are two main approaches to solving the discrete order complementarity problem in

    equation (3.15) at each time step: the iterative algorithm of Projected Successive OverRelax-

    ation (PSOR)[9] and the direct algorithm of Parametric Principal Pivoting (PPP)[3]. Start-

    ing with an initial guess vector, say, x0, the (PSOR) method updates the current processing

    vector at each iteration until a certain tolerance condition (which has been specified previ-

    ously) is met. It can be shown that as k , xk x, the solution of the problem at eachtime step, and by properly choosing the constant called the relaxation parameter within the

    interval (1, 2) (which depends on the coefficient matrix at that time step), the convergence

    can be optimized. Since we assume t is small, it could be expected that the solution of one

    subproblem has only a few basic variables changed from that of preceding problem, hence

    once we hot-start the (PSOR) solver from the previous time steps solution, this revised

    one should be superior to the primal.

    In contrast, the backbone of (PPP) algorithm [3], is the parametric (LOCP)(q+ d, M)

    with a specially chosen parametric vector d > 0 (which is called an n-step vector). The

    parametric is initially set at a sufficiently large positive value so that x = 0 is a solution

    of the (LOCP)(q+ d, M). The goal is to decrease until it reaches zero, at which point, a

    solution of the original (LOCP)(q, M) is obtained. The decrease of is accomplished by the

    13

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    14/48

    parametric principal pivoting method, and it also can be shown that the (PPP) method with

    a predetermined n-step vector d can compute a solution of the (LOCP)(q, M) in at most n

    iterations.

    For solving the equivalent discrete version of linear program in equation, we shall concen-

    trate on the Large-scalealgorithm which is based on LIPSOL (Linear Interior Point Solver)a

    variant of Mehrotras predictor-corrector algorithm, a primal-dual interior-point method.

    3.2.2 Explicit method

    The finite-difference discretization scheme we formed earlier is quite general, in fact, as

    can be chosen as any value within the closed interval [0, 1], these various algorithms for

    solving discrete problem described above are theoretically applicable to the implicit scheme

    corresponding to = 1, Crank-Nicolson scheme with = 1/2, and explicit scheme when is

    set to be zero. However, for the explicit method, we can write each times problem in a very

    simple way: the coefficient matrix A defined by equation (3.16)reduces to the (I 1)-squarediagonal matrix diag(1 + rt), so that the mth subproblems of discrete (LOCP) and (OLP)

    given by (3.15) and (3.21) both reduce to

    um =

    11 + rt

    ( Bum1)

    . (3.23)

    This is clearly a very rapid calculation for each iteration, since the only significant calcu-

    lation is a single matrix multiplication. However, the inherited stability constraint for explicit

    scheme represented by the equation (3.22) with = 0 implies that one should always take a

    number of time steps of the order of the square of the number of the space steps in order to

    maintain the stability of the scheme, i.e.

    t x, (3.24)

    therefore, if for instance the step in the space direction is halved in order to improve the

    accuracy of approximation along the x-direction, then the number of time steps must be

    quadrupled so that the computation time is multiplied by four, in addition to the effects of

    working with a larger matrix A. This big disadvantage of explicit scheme could make itself

    computationally very demanding sometimes.

    14

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    15/48

    4 Numerical Tests

    In this section, I am going to report some computational results from empirical tests of

    various algorithms pertaining to finite-difference method (including both the explicit and

    (full) implicit schemes) and tree method. Five algorithms with their corresponding MatLab

    codes are of our great interest, namely, tree, explicit, (PSOR), (PPP) and (OLP) for American

    put. All the program codes employed herein can be found in the Appendix attached behind.

    Our main purpose is somehow to reveal the connection between timings and accuracy for

    each algorithm and furthermore to determine the optimal curve between the number of time

    steps and the number of space steps.

    This section has been organized as follows: the first subsection presents some computa-

    tional details as the basis of all the empirical experiments; the second subsection aims to for

    each algorithm characterize both the cputime and max |error| as functions of two technicalparameters N s and N t denoting the number of space steps and time steps respectively, and

    furthermore to find out the optimal relation between N s and N t, in other words, given cer-

    tain cputime, say, cputime = c, which N s and N t we should adopt in order to minimize the

    approximation error, and the same procedure for the determination given certain accuracy

    level; in the following the third subsection, comparison among various algorithm based on

    the results of subsection 2 are made; the whole section ends up with a plot of solution surface

    based on the exact solution also used in the determination of the error in each algorithm

    earlier.

    4.1 Computational details

    All results in the sequel are computed in double precision on an Intel Pentium 4-M 2.2

    GHz computer with 256 megabytes (MB) of RAM, running under Microsoft XP OS. All the

    program codes were written and executed in MatLab (Release 14). In the (PSOR) algorithm,

    relaxation parameter is set as 1.5 (the optimal value of is not known analytically, but

    empirically found as close to 1.5 for a range of problems), convergence tolerance as 108, i.e.

    the tolerance condition asxk+1 xk < and starting vector is chosen to be the previous

    time steps solution vector.

    15

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    16/48

    For (PPP) algorithm, the n-step vector is determined by[5]

    p =A + A

    2

    d (4.1)

    for any vector d such that Ad > 0, where A denotes the comparison matrix of A, which is

    defined by

    Aij :=

    |Aij| if i = j, |Aij| if i = j.

    (4.2)

    With the above p, (PPP) algorithm computes the unique solution of the (LOCP) in at most

    n pivots.

    For the explicit method, a stable method must be used. The stability constraint of

    equation (3.24) implies that the number of time steps N t N tmin, where

    N tmin :=2T(N s)2

    (U L)2 . (4.3)

    4.2 The determination of optimal curve

    Experiments are set up as follows: unless otherwise stated, all problems are solved on the

    truncated log-stock interval [log(50), log(300)] with maturity T = 1 (1 year), strike price

    K = 100, riskless interest rate r = 0.05 (per annum), and volatility level = 0.2 (per

    annum), and the exact solution(the most reliable solution) is calculated applying (PPP)

    algorithm under the (full) implicit scheme ( = 1) with the number of time steps and the

    space steps being set as 100 and 400 respectively. For each pair of time step and space step,

    5 cputime samples (measured in seconds) were taken and resulting sample mean was hence

    calculated and assigned to that pair.

    4.2.1 Timings of numerical algorithms

    Table 4.1 firstly gives times for the vanilla put for three algorithms, namely, (PSOR), (PPP)

    and (OLP), and corresponding plots of each methods time as function of time steps N t are

    given in Figure 4.1.

    16

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    17/48

    Table 4.1 Times for Varying Time Steps

    Time Space steps N s = 50

    steps N t 30 40 50 60 70 80 90 100 120 150

    PSOR 0.96 1.23 1.52 1.82 2.11 2.41 2.74 3.09 3.74 4.79

    PPP 2.55 3.14 3.91 4.69 5.51 6.32 6.99 7.80 9.45 12.50

    OLP 2.89 3.36 4.14 4.91 5.67 6.53 7.35 7.83 9.31 11.49

    0 50 100 1502

    0

    2

    4

    6

    8

    10

    12

    14

    time steps

    times(secs)

    PSOR, PPP and OLP times (Ns=50)

    PSOR

    PPP

    OLP

    Figure 4.1 PSOR, PPP and OLP times for varying time steps

    Clearly enough, all above three algorithms show the linear dependence on the number

    of time steps, so that each time step takes approximately the same amount of time. The

    reason for this is quite straightforward: since the number of space steps is kept as constant

    and t is small, the size (depends on the size of the constraint matrix A) and complication

    level of each subproblem therefore is very close or even the same, hence the time spent in

    solving the whole problem can be expected to be proportional to the number of time steps it

    takes. However, the sloping of these three algorithms are different, comparatively, the line of

    (PSOR) is the most flat one indicating the least time demanding among three. However, the

    time of PSOR fail to show much sub-linear dependence on time steps as time steps increase,

    which suggests that the hot-start design does not function as well as we expected earlier

    (at least for N s = 50), reflecting that the previous steps solution, used as the starting point

    for the iteration, is not that closer to the current time steps solution even for smaller t.

    Mathematically, times of three algorithms as functions of number of time steps N t can be

    17

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    18/48

    estimated empirically by

    TimePSOR = 0.077695 + 0.031868N t f or N s = 50TimePPP = 0.18182 + 0.081862N t f or N s = 50 (4.4)TimeOLP = 0.57579 + 0.073072N t f or N s = 50.

    For explicit algorithm, since much less effort is involved per time step to calculate the

    solution of each subproblem (as mentioned previously, the only significant calculation the

    explicit method works with is a matrix multiplication), therefore it would be reasonable to

    practice with much larger number of time steps. In fact, this is also due to the consideration

    of stability. Some results were collected in Table 4.2 and represented as Figure 4.2.

    Table 4.2 Times for Explicit (Space steps N s = 200)

    Time steps N t Times Time steps N t Times

    600 0.0742 1300 0.1502

    700 0.08 1400 0.1582

    800 0.0962 1500 0.1722

    900 0.1042 1600 0.1802

    1000 0.1122 1800 0.2024

    1100 0.1282 2000 0.2262

    1200 0.1382 2500 0.2804

    600 800 1000 1200 1400 1600 1800 2000 2200 2400 26000.05

    0.1

    0.15

    0.2

    0.25

    0.3Explicit times(Ns=200)

    times(se

    cs)

    time steps

    Figure 4.2 Explicit times

    Similarly, Table 4.2 and Figure 4.2 both show the linear dependence of explicit method

    time on the number of time steps. Based on these 14 observations, empirical function of

    18

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    19/48

    Explicit time can be estimated using standard Ordinary Least Squares estimation technique:

    TimeExp = 0.006148 + 0.00010962N t f or N s = 200. (4.5)

    In contrast, samples taken for the tree method clearly present a power functions nature

    of the time dependence rather than a linear. The reason for this phenomenon may lie in

    the inverse structure of the tree scheme. Instead of solving N t subproblems backwards along

    time axis, the tree method first of all generates a stock tree for each single space point, and

    whereafter repeat pricing the options value at each space point by discounting backwards

    the stock tree. Thus, if we vary the number of time steps keeping the number of space steps

    as constant, the size and hence the complication level for each space grid are modified quite

    a lot from time to time. On the other hand, if we test the time dependence in another way

    around by varying the number of space steps, we could probably expect a linear dependence

    of time on the number of space steps. To linearize the function, log-transformation were

    made for both the number of time steps and time of each sample before I did the regression.

    Table 4.3 and Figure 4.3 give the outcomes of tree method, and resulting empirical function

    can be expressed as

    TimeTree = e10.621N t2.0911 for Ns = 50. (4.6)

    Table 4.3 Times for Tree method (Space steps N s = 50)

    N t 30 40 50 60 70 80 90 100 120 150

    Times 0.04 0.05 0.08 0.11 0.16 0.21 0.28 0.35 0.55 1.16

    0 50 100 1500

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4Explicit times(Nt=1000)

    times(secs)

    space steps

    Figure 4.3 Times of Tree method

    19

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    20/48

    After modeling the time dependence on number of time steps for each algorithm, our next

    aim is to determine the time dependence of number of space steps for certain fixed N t. All

    the estimation procedures are similar. Lets first of all check our early conjecture about the

    linear dependence of tree methods time upon N s. Results were summarized as in Table 4.4

    and Figure 4.4.

    Table 4.4 Times for Tree method (Time steps N t = 50)

    N s 30 40 50 60 70 80 90 100 120 150

    Times 0.05 0.06 0.08 0.09 0.11 0.12 0.14 0.15 0.18 0.23

    0 50 100 1500

    0.05

    0.1

    0.15

    0.2

    0.25Tree times(Nt=50)

    times(secs)

    space steps

    Figure 4.4 Times of Tree method

    As we can see from the plot, a perfect match between 10 sample points and the regres-

    sion line clearly indicates that our earlier guesswork is indeed correct. We hence can express

    the estimated function as:

    TimeTree = 0.0044 + 0.0015N s f or N t = 50. (4.7)

    Finally, I give mathematical expressions and plots of time functions for remaining 4 algo-

    rithms.

    Comparing timing behaviors of first three algorithms as in Figure 4.5 (the first plot), OLP

    has the most flat sloping curve indicating the least time required per space steps, so that for

    larger N s, OLP would be highlighted. Whereas for smaller N s, PSOR is faster, and PPP is

    faster still. In case of explicit method, much shorter time than any of first three algorithms is

    required to achieve the solution even though N t is kept as 1000, and due to this special feature

    of explicit method, any negligible invariant operating time by MatLab (in cases of PSOR,

    20

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    21/48

    0 50 100 1500

    5

    10

    15

    20

    25

    30

    35

    40

    space steps

    times(secs)

    PSOR, PPP and OLP times (Nt=50)

    PSOR

    PPP

    OLP

    0 0.005 0.01 0.015 0.02 0.0250.84

    0.86

    0.88

    0.9

    0.92

    0.94

    0.96

    0.98

    1

    1.02Seleting of c0

    Rs

    quarevalue

    c00 50 100 150 200 250

    0

    0.05

    0.1

    0.15

    0.2

    0.25

    0.3

    0.35

    0.4

    0.45Explicit times(Nt=1000)

    times(secs)

    space steps

    Figure 4.5 Times of PSOR, PPP and OLP and Times of Explicit

    PPP and OLP) such as fetching data and plotting graph now becomes far more significant

    so that it can not be ignored any more. Therefore, a revised version of timing function for

    explicit method with an unspecified constant term, namely, Time = c0+a(N s)b is preferable.

    The estimating of this constant coefficient is based on the maximum R2 principle, and the

    above left lower plot presents the curve of R2 with varying c0 values. Obviously, a constant

    coefficients value of 0.023 gives the maximum R2 which is 0.9862, and corresponding curve

    of timing function is described aside. All empirical functions are listed as follows:

    TimePSOR = e4.6089(N s)1.2955 for N t = 50

    TimePPP = e6.4487(N s)2.0060 for N t = 50

    TimeOLP = e0.2439(N s)0.4361 for N t = 50

    TimeExp = 0.0230 + e20.2646(N s)3.4272 for N t = 1000.

    Now we are ready to characterize the full timing function with two technical variables N t

    and N s, i.e. cputime = f(N t,N s). Based on all above empirical functions we have obtained

    either along N t-axis or N s-axis, we can further conjecture that: for PSOR, PPP and OLP,

    similar timing functions are of the form: (+N t)N s; for explicit method, a revised version

    21

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    22/48

    is adopted, that is + N t(N s); and for tree method, we need exchange the roles ofN t and

    N s: (+N s)N t. Notice that, except for explicit method, specifying these three parameters

    requires solving a overdetermined linear system with 4 equations but only 3 unknowns for

    each algorithm (there are 5 equations with 3 unknowns in case of explicit method), hence I

    approximate them again applying OLS technique. After some tedious calculations, we have

    P S OR cputime = (0.00048891 + 0.00020903N t)N s1.2955

    P P P cputime = (0.00007102 + 0.00003307N t)N s2.0060

    OLP cputime = (0.1046 + 0.0136N t)N s0.4361

    T ree cputime = (0.000001233 + 0.000000463N s)N t2.0911

    (4.8)

    For explicit method, since the resulting equation system has a considerably large discrep-

    ancy in the intercept (N t data implies = 0.006148, whereas N s data implies = 0.023),

    a tradeoff has to be made between the intercepts as determined by the N s data and by the

    N t data. Instead of simply taking the average of the two values, I also took the R2 values

    for different intercepts for the N t data, just as I did for the N s data. It might be that the

    R2 for the N t data is less sensitive to the choice of the constant than the R2 for the N s

    data. In that case the final estimated should be closer to 0.023 than to 0.006148. Formally,

    I maximize the sum of the two R2s, and the following plot displays the findings:

    0 0.005 0.01 0.015 0.02 0.025.84

    .86

    .88

    1.9

    .92

    .94

    .96

    .98

    c0

    Sum of RSquare Value

    Figure 4.6 The determination of two estimated intercepts

    Clearly, the R2 of N s data completely dominates that of N t data, since the shape of the

    above curve is almost the same as the R2 of N s data. Hence, the final estimated intercept

    is determined as 0.023. We have:

    Explicit cputime = 0.023 + 1.5011

    1012

    N t(N s)3.4272. (4.9)

    22

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    23/48

    4.2.2 Accuracy analysis of numerical algorithms

    In this subsection, we are going to build up the connection between accuracy and twotechnical parameters N s and N t for each algorithm. Our accuracy here is defined in terms of

    maximum absolute error compared with our most reliable solution, and due to the global sense

    of maximum absolute error, we may expect a nice convergence property for some algorithms.

    Before we start our standard estimation procedure, it may be of great interest to get a first

    impression of the errors behavior from the following comparison (N t = 60, N s = 60 for

    PSOR, PPP, OLP and Tree method; N t = 1500, N s = 200 for Explicit method; error =

    exact solution

    resulting solution)

    0 100 200 30015

    10

    5

    0

    5x 10

    3 Error of Explicit

    stock price

    0 100 200 300 .005

    0

    .005

    0.01

    .015

    0.02

    .025Error of ImplicitPSOR

    stock price0 100 200 300

    0.01

    0

    0.01

    0.02

    0.03

    0.04Error of ImplicitPivoting

    stock price

    error

    0 100 200 3000.005

    0

    0.005

    0.01

    0.015

    0.02

    0.025Error of ImplicitLP

    error

    stock price

    0 100 200 3000.04

    0.03

    0.02

    0.01

    0

    0.01Error of Treemethod

    stock price

    error

    Figure 4.7 Error comparison of various algorithms

    As exhibited by the above graph, the errors of PSOR, PPP and OLP are roughly similar:

    all have maximum (positive) errors appearing at (or around) strike price K = 100 and

    much smaller but still observable (negative) errors somewhere in the middle of (100, 200),

    in particular, for PSOR and OLP, the errors behavior are even the same at some accuracy

    level; on the contrary, Explicit and Tree method seem as in the same category except that

    tree method displays a much irregular behavior fluctuating so heavily around strike price.

    We may also check out the corresponding comparison of relative error:

    Although the maximum errors occur closely around the neighborhood of strike price for

    all algorithms, they are relatively small enough such that none of them have any significant

    influence on final solutions. On the other hand, the errors from larger values of stock price

    are magnified, since the exact solution are very close to zero for some points in that area,

    23

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    24/48

    0 100 200 3000.1

    0

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6Relative Error of Explicit

    stock price

    0 100 200 3001.5

    1

    0.5

    0

    0.5Relative Error of ImplicitPSOR

    stock price0 100 200 300

    1.5

    1

    0.5

    0

    0.5Relative Error of ImplicitPivoting

    relativee

    rror

    stock price0 100 200 300

    4

    3

    2

    1

    0

    1Relative Error of ImplicitLP

    stock price

    relativee

    rror

    0 100 200 3000.2

    0

    0.2

    0.4

    0.6

    0.8

    1

    1.2Relative Error of Treemethod

    stock price

    relative

    error

    Figure 4.8 Relative error comparison of various algorithms

    and we may also see clearly that for PSOR, PPP and OLP, errors from larger values of stock

    price always remain negative, whereas for latter two positive.

    Lets first of all try to express the max |error| as a function of N t for PSOR, PPP andOLP. Figure 4.9 and Table 4.5 give some ideas:

    20 40 60 80 100 120 140 1600

    0.01

    0.02

    0.03

    0.04

    0.05

    0.06

    0.07

    0.08

    0.09

    time steps

    maximuma

    bsoluteerror

    PSOR, PPP and OLP Errors

    PSOR

    PPP

    OLP

    Figure 4.9 Errors of PSOR, PPP and OLP

    Table 4.5 Errors for PSOR, PPP, and OLP

    Time PSOR & OLP: N s = 80 PPP:N s = 100

    steps N t 30 40 50 60 70 80 90 100 120 150

    PSOR 0.040 0.030 0.024 0.020 0.017 0.014 0.013 0.012 0.012 0.012

    PPP 0.033 0.023 0.017 0.014 0.011 0.011 0.009 0.010 0.009 0.008

    OLP 0.040 0.030 0.024 0.020 0.017 0.014 0.013 0.012 0.012 0.012

    24

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    25/48

    The decreasing of the maximum absolute errors of first three algorithms also present a

    power functions nature, so that we may try to trace errors behavior by building up our

    model as max |error| = c + aN tb, b > 0. In order to estimate these three parameters, wemay again use OLS technique and choose the constant c that maximizes the R2 value. Also

    notice the fact that maximum absolute errors of PSOR and OLP are exactly the same at 3

    decimal accuracy, hence it leads to a very close empirical function for both cases (this is why

    there are only two different curves on above graph). The following are collected empirical

    functions:

    PSOR : max

    |error

    |= 0.0102 + e3.5195N t2.0395 f or N s = 80

    P P P : max |error| = 0.0064 + e2.4381N t1.7883 f or N s = 100OLP : max |error| = 0.0102 + e3.5212N t2.0400 f or N s = 80

    (4.10)

    Next we are going to capture the error dependence for explicit method. Experiment is

    set up along the axis of time steps at 20 frequency in the range of [600 , 2500] with N s kept

    as 200. Table 4.6 and Figure 4.10 collect all summarized results:

    Table 4.6 Errors for Explicit (Space steps N s = 200)

    Time steps N t Error Time steps N t Error Time steps N t Error

    600 0.015232 1300 0.01397 2000 0.013602

    700 0.014891 1400 0.013895 2100 0.01357

    800 0.01464 1500 0.01383 2200 0.01354

    900 0.014444 1600 0.013773 2300 0.013513

    1000 0.01429 1700 0.013723 2400 0.013489

    1100 0.014161 1800 0.013677 2500 0.013466

    1200 0.014057 1900 0.013637 2600

    Assuming again the error function for explicit method follows a power form, estimation of

    parameters therefore is simply a repeat of the previous. The resulting R2 is 0.9999 implying

    a nearly perfect coincidence of theoretical curve and samples. Our empirical function of error

    for explicit method is:

    Explicit method : max |error| = 0.0129 + e0.2584N t0.9894 f or N s = 200 (4.11)

    However, in case of tree method, resulting maximum absolute errors from various inputs

    of time steps clearly show an oscillatory behavior depending on whether the number of time

    25

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    26/48

    0 500 1000 1500 2000 25000.013

    0.014

    0.015

    0.016

    0.017

    0.018

    0.019

    0.02Explicit times(Nt=1000)

    times(secs)

    space steps

    Figure 4.10 Errors of Explicit (Ns=200)

    steps is odd or even (which is a well known phenomenon, and also seen in the pricing of

    European options). We can see this point from the following graph:

    0 20 40 60 80 1000

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8Error of Tree (Ns=50)

    maximuma

    bsoluteerror

    time steps50 60 70 80 90 100

    0.02

    0.022

    0.024

    0.026

    0.028

    0.03

    0.032

    0.034

    0.036

    0.038

    0.04

    Time steps

    maximuma

    bsoluteerror

    Error of Tree

    Figure 4.11 Oscillatory behavior of errors for Tree method

    The plot at left hand side is a full image of errors generated at 20 frequency on the whole

    range of [5, 100] along the axis of time steps, whereas the right-hand-side only magnifies those

    errors located in indifferent area from 50 to 100. Although there are always some slightly

    oscillatory movements depending on whether the number of time steps is odd or even (as

    we can see from the right-hand-side plot, errors occurring at odd numbers of time steps

    deviate slightly downwards from those occurring at even numbers of time steps), an overall

    view still implies that the error function could roughly follow the power form. Based on

    this observation, we may model the error function for tree method as (an intercept c is not

    included in the case of tree method, the reason for this might be clear as revealed later on):

    T ree method : max |error| = e0.3117

    N t0.7472

    f or N s = 50 (4.12)

    26

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    27/48

    In order to approximate the full error function with two variables N s and N t, we still

    need to formulate the connection along the space direction. All modeling procedures would

    remain the same. As before, lets first of all check out PSOR, PPP and OLP cases.

    Table 4.7 Errors for PSOR, PPP, and OLP

    Space Time steps N t = 50

    steps N s 30 40 50 60 70 80 90 100 120 150

    PSOR 0.054 0.031 0.029 0.026 0.027 0.024 0.019 0.016 0.015 0.016

    PPP 0.061 0.034 0.052 0.036 0.029 0.025 0.034 0.017 0.016 0.017

    OLP 0.054 0.031 0.029 0.026 0.027 0.024 0.019 0.016 0.015 0.016

    20 40 60 80 100 120 140 1600.01

    0.02

    0.03

    0.04

    0.05

    0.06

    0.07

    0.08

    0.09

    space steps

    maximuma

    bsoluteerror

    PSOR, PPP and OLP Errors (Nt=50)

    PSOR

    PPP

    OLP

    Figure 4.12 Errors of PSOR, PPP, and OLP (Nt=50)

    As similar as we approximate the link between the error and the number of time steps,

    it appears that maximum absolute errors of PSOR, PPP and OLP also decrease in some

    reciprocal proportion rates as the number of space steps increases, and this again (possibly)

    implies the power forms of the error functions for these three cases. Particularly, the er-

    rors of PSOR and OLP remain exactly the same at 3 decimal accuracy predicting a closely

    linked empirical functions for both of them. Under the assumption that they all function as

    max |error| = c + aN sb, b > 0, we may obtain them empirically as follows:

    PSOR : max |error| = 0.0069 + e0.2437N s1.0198 f or N t = 50P P P : max |error| = 0.0004 + e0.0091N s0.8347 f or N t = 50OLP : max |error| = 0.0069 + e0.2447N s1.0201 f or N t = 50

    (4.13)

    27

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    28/48

    In case of explicit method, experiment is designed along the axis of space steps at 50

    frequency in the range of [5, 250] with N t kept as 2000. Figure 4.13 plots the results:

    0 50 100 150 200 2500

    0.5

    1

    1.5

    2

    2.5Explicit error (Nt=2000)

    maximuma

    bsoluteerror

    space steps50 100 150 200 250

    0

    0.005

    0.01

    0.015

    0.02

    0.025

    0.03

    Space steps

    maximuma

    bsoluteerror

    Error of Explicit (Nt=2000)

    Figure 4.13 Errors of Explicit (Nt=2000)

    As revealed by the above graph, almost all the errors generated at larger numbers of

    space steps are quite close to zero, in fact, if we microscope these approximately constant

    errors as we did in the tree case, we may observe a slightly upward trendas presented

    by the right-hand-side plot. However, from a wider windows view, this tiny trend can be

    regarded as negligible, and hence we could still approximate the errors behavior of explicit

    method using the standard power form. The empirical functions for explicit method can be

    represented as (maximum R2 principle implies the intercept c = 0):

    Explicit method : max |error| = e0.3159N s0.9639 f or N t = 2000 (4.14)

    The experiments on tree method do not show us much causal relationship between the

    maximum absolute error and space steps, as we can see from the following several plots:

    0 20 40 60 80 1000.04

    0.045

    0.05

    0.055

    0.06

    0.065

    Space steps

    maximum

    absoluteerror

    Error of Tree (Nt=30)

    0 20 40 60 80 1000.0388

    0.039

    0.0392

    0.0394

    0.0396

    0.0398

    0.04

    0.0402

    0.0404

    0.0406

    0.0408Error of Tree (Nt=50)

    maximum

    absoluteerror

    space steps0 20 40 60 80 100

    1

    0.5

    0

    0.5

    1

    1.5

    Space steps

    maximum

    absoluteerror

    Error of Tree (Nt=80)

    0 20 40 60 80 1000.005

    0.01

    0.015

    0.02

    0.025

    0.03

    0.035

    Space steps

    maximum

    absoluteerror

    Error of Tree (Nt=85)

    Figure 4.14 Error for Tree: Indifference of space steps

    (From left to right N t = 30, 50, 80, 85)

    However, this result is actually not so surprising as it may sound like at first. Lets

    once again recall the pricing mechanism of the tree method. As mentioned before, tree

    method simply prices every single space point (that is every initial stock price) by discounting

    28

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    29/48

    backwards the stock tree generated in the earlier phase, therefore different inputs of space

    steps only result in different set of initial space grids that we are going to price and what we

    finally obtain is still the same solution although appearing as a new vector whose elements

    corresponding to this new set of initial space grids. Above four plots with N t = 30, 50, 80, 85

    show totally distinct version of errors behavior, but at least they are only visible from a

    microscopic viewindeed, noises at that accuracy level could arise form many sources, such

    as interpolation and half-adjusting procedures, therefore for sake of simplicity, we would

    rather assume that all results are approximately constant hence indifferent with space steps.

    Now we are ready to merge our two error functions of each algorithm (except for tree

    method) either in time step direction or space step direction togeter into a whole one with both

    variables. For this purpose, we may further conjecture the function forms for each case, that

    is, we assume that all the error functions follow a function form of max |error| = c1(N t)1 +c2(N s)

    2. The specifying of all 4 parameters also requires solving 2 overdetermined linear

    systems, for instance, in case of PSOR, we are confronted with:

    c1 = e3.5195, 1 = 2.0395

    c1(50)1 = 0.0069

    c2 = e0.2437, 2 = 1.0198

    c2(80)2 = 0.0102

    (4.15)

    Hence the final estimated values of all 4 parameters are determined by applying OLS (pro-

    jecting) technique. All empirical error functions for various algorithms are summarized as

    follows:

    PSOR : max |error| = e3.4896(N t)2.1564 + e0.2267(N s)1.0943

    P P P : max |error| = e2.2493(N t)2.5267 + e0.0433(N s)1.0761

    OLP : max |error| = e3.4913(N t)2.1569 + e0.2277(N s)1.0945

    Explicit : max |error| = e0.2458(N t)0.9894 + e0.3306(N s)0.8863

    Tree : max

    |error

    |= e0.3117(N t)0.7472

    (4.16)

    4.2.3 Optimizations and Comparisons

    Having estimated both the timing function and error function for all algorithms, our next

    step would be to decide the minimum time expense given certain error level, say, u. Then it

    becomes natural that we express the min |cputime| as a function of error level u. Since thosemodels we constructed for PSOR, PPP and OLP cases are of the same type, optimization

    problems for them therefore inherit this similarity as well. More specifically, we are confronted

    with

    29

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    30/48

    min{(a + bN t)(N s)}s.t. c1(N t)1 + c2(N s)2 = u , i > 0 i = 1, 2.

    (4.17)

    Such an equality-constrained optimization problem can be easily reduced to an uncon-

    strained one by introducing the Lagrangian L(Nt,Ns,). After taking the First Order Con-

    dition (FOC), one can show that the optimal N t and N s satisfy the following equation

    system:

    (2c1 + c11)(N t)1 + ac11b (N t

    )11 2u = 0

    N s =uc1(Nt)1

    c21/2

    (4.18)

    The left-hand side of first equation can be seen as a polynomial but with non-integer power

    terms, the root to which is therefore hard to derive analytically. Instead, I approximate

    its numerical solution by implementing the Newton method, namely, to iterate N tk+1 =

    N tk f(Ntk)f(Ntk) as long as the absolute value of above polynomial is not small enough (the zero-tolerance level is set as 108 in practice). By substituting both N t and N s (as functions of

    u) back into the criterion, we arrive at the optimal curves of PSOR, PPP and OLP (y-axis

    denotes the log-cputime rather than the original).

    0 0.02 0.04 0.06 0.08 0.12

    1

    0

    1

    2

    3

    4Optimal Curve and LogCputime/Error Combinations (PSOR)

    LogCputime

    maximum absolute error0 0.02 0.04 0.06 0.08 0.1

    4

    3

    2

    1

    0

    1

    2

    3

    4Optimal Curve and LogCputime/Error Combinations (PPP)

    LogCputime

    maximum absolute error

    0 0.02 0.04 0.06 0.08 0.10

    0.5

    1

    1.5

    2

    2.5

    3Optimal Curve and LogCputime/Error Combinations (OLP)

    LogCputime

    maximum absolute error

    Figure 4.15 Optimal Curves for PSOR, PPP and OLP

    30

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    31/48

    All above three curves are lying northwest towards southeast which is consistent with our

    straightforward experience that the rougher precision it requires, the less computational time

    it is needed to calculate the result. Also notice that, for all three algorithms, some random

    sample points combining error level and log-cputime distribute right above the optimal curves

    (although in case of PPP algorithm, samples seem deviating the curve a little further away,

    which probably indicates that we might be too optimistic about the minimum cputime for a

    certain range of error level), therefore this evidence may in turn provide some confidence in

    the validity of our models.

    Another result we may also derive from the optimization problem is the optimal pairs

    of time steps and space steps defined in the sense of minimum cost of cputime. The following

    table maps each number of time steps to its corresponding number of space steps:

    Table 4.8 Optimal Pairs of Time steps and Space steps

    Time steps N t 30 50 60 80 70 90 100 120 150

    Space steps PSOR: 19 50 71 96 124 156 192 274 424

    N s PPP: 89 286 436 622 849 1116 1426 2180 3670

    OLP: 39 114 167 229 301 384 475 688 1080

    In case of Explicit method, a similar optimization procedure can be adopted except that

    an analytical solution now is derivable. The optimal N t and N s given error tolerance level

    u are

    N t =

    2uc11+2c1

    1/1N s =

    uc1(Nt)1

    c2

    1/2 (4.19)

    Again by substituting both N t and N s (as functions ofu) back into the criterion, we arrive

    at the optimal curves of Explicit method (y-axis denotes the log-cputime rather than the

    original).

    The most apparent feature of the optimal curve for Explicit method would be that the

    log-cputime becomes invariant when the error level goes large. This phenomenon coincide

    with the existence of the intercept term in the timing model for Explicit method which we

    previously interpreted as unnegligibly constant operating time by MatLab. In order to get

    some idea about the validity, I also sampled some error/log-cputime combinations in the plot:

    6 out of 9 sample points located right above the curve whereas the rest 3 below indicates

    31

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    32/48

    0 0.02 0.04 0.06 0.08 0.14

    3

    2

    1

    0

    1

    2

    3Optimal Curve and LogCputime/Error Combinations (Explicit)

    LogCputime

    maximum absolute error

    Figure 4.16 Optimal Curve for Explicit method

    that we might be too conservative about the minimum cputime for a certain range of error

    level. The following gives the optimal pairs for Explicit method:

    Table 4.9 Optimal Pairs for Explicit method

    Time steps N t 1000 1200 1400 1500 1800 2000 2200 2500

    Space stepsN s 541 663 787 850 1042 1172 1304 1504

    For the purpose of comparison among algorithms, we could also gather all the optimal curves

    in one single plot:

    0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10

    5

    10

    15

    20

    25

    30

    35

    maximum absolute error

    Optimal Curves of Various Algorithms

    PSOR

    PPP

    OLP

    Explicit

    Figure 4.17 Optimal Curves for Various Algorithms

    Assuming all the curves we estimated are approximately valid, then Explicit method

    would be our best choice for a long range of accuracy (error) level from approximately 0.005

    to 0.1, since its optimal curve always lies the lowest among all 4 algorithms. However, the

    time demanding of Explicit method increases very fast as soon as the error level goes below

    0.01 (even more accurate) such that it wont be optimal again when for instance we require

    32

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    33/48

    the maximum absolute error of the solution no larger than 0.003. Also notice that the optimal

    curves for PSOR, PPP and OLP almost intersect at the same point around (0.01, 10), and

    they have a complete reversed ranking of optimality at each side of this point: PSOR always

    shows a mediocre behavior; for larger error level, PPP algorithm is superior; whereas for

    smaller error, OLP is the fastest.

    However, special (simpler) care need to be taken in case of Tree method, since its error

    function does not depend on the number of space steps. Therefore, one can always optimize

    his criterion (timing function) by reducing the number of space steps to 1, in other words, by

    pricing the options value only for one specific stock price, and this so-called optimal curve

    we finally arrive at is actually the time expense of doing that. Equivalently, we can also draw

    the dependence of computational time on the accuracy (error) level for a fixed number of

    space steps, say 50. The following graph gives some idea:

    0 0.02 0.04 0.06 0.08 0.16

    5

    4

    3

    2

    1

    0

    1

    2

    3

    4Connection between Logcputime and Error for Tree method

    Logcputime

    maximum absolute error

    Figure 4.18 Connection between log-cputime and error for Tree method

    4.2.4 American option solution surface graphically

    Finally I shall give the plot of the solution surface of the American vanilla put option solved

    for this section. Figure 4.19 shows the American vanilla put value function with respect to

    the true stock price (N s = 50, N t = 50), and we can recognize in it all the theoretical features

    of Figure 2.1.

    5 Conclusion

    In this paper, we discuss and test five computational methods for American vanilla put op-

    tion, namely, Projected Successive OverRelaxation algorithm, Parametric Principal Pivoting

    33

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    34/48

    0

    0.5

    1

    050

    100150

    200250

    300

    10

    0

    10

    20

    30

    40

    50

    60

    Time to maturity

    American vanilla put

    stock price

    option

    value

    Figure 4.19 Solution surface with true stock price axis

    algorithm, Linear Programming, Explicit method and Tree method. Tree method is somehow

    the most straightforward and simplest method, and it is mainly developed for the illustration

    purpose pricing the options value at one single stock grid (the optimization problem for Tree

    method also reflects this argument). Hence, it is always not efficient to apply Tree method

    proposed here to price a solution vector. Apart from Tree method, all the rest 4 algorithms

    are built up under the Finite Difference Discretization framework sharing the same problem

    format (or equivalent problem format), that is LOCP (or equivalent OLP), and furthermore

    they can be categorized into implicit scheme( = 1) and explicit scheme( = 0). A com-

    parison among all the optimal curves drawn from the empirical functions implies that: for

    rougher precision requirement, Explicit method would be our best choice for its lowest time

    demanding. However, when the accuracy must be made such that the maximum absolute

    error in a solution vector can not exceed 0.005, we should otherwise consider PPP algorithm

    our optimal choice.

    Until now, all the conclusions are made under the assumption that those timing and errorfunctions we estimated for each case are approximately valid. As a matter of fact, we only

    exploited very few of sample points to model either the timing behavior or the error behavior

    of each algorithm, estimation error is therefore inevitable. Even though all the empirical

    functions were perfectly correct, it would be the case that they are only reliable for a certain

    range of cputime and accuracy (error) level, in other words the explanatory power of the

    functions are limited within our interest region.

    Also consider that the PSOR algorithm used here is specifically designed for this problem,

    34

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    35/48

    but the large-scale and PPP solver utilized are somehow general purpose algorithms. There-

    fore, we may expect that more recent (or specially developed) large-scale and PPP codes

    would perform even better.

    Appendix

    function [z,nu]=Projected_SOR(q0,M,omega,eps,z0)

    %LCP solver applying PSOR algorithm; q0 and M are the characteristic

    %parameters describing the LCP, omega is relaxation parameter, and eps

    %denotes the tolerance level.

    z(:,1)=10*ones(length(M),1);

    z(:,2)=z0; %in order to realize the first round of the looping,

    %i.e. norm((z(:,2)-z(:,1))>=eps for sure

    y(:,1)=zeros(length(M),1); %initializations

    nu=2; %step-counter

    while norm((z(:,nu)-z(:,nu-1)))>=eps

    y(1,nu+1)=1/M(1,1)*(-q0(1,:)-M(1,[2:1:length(M)])*z([2:1:length(M)],nu));

    z(1,nu+1)=max(0,z(1,nu)+omega*(y(1,nu+1)-z(1,nu)));

    for i=2:length(M)-1

    y(i,nu+1)=1/M(i,i)*(-q0(i,:)-M(i,[1:1:i-1])*z([1:1:i-1],nu+1)

    -M(i,[i+1:1:length(M)])*z([i+1:1:length(M)],nu));

    z(i,nu+1)=max(0,z(i,nu)+omega*(y(i,nu+1)-z(i,nu)));

    end

    y(length(M),nu+1)=1/M(length(M),length(M))*(-q0(length(M),:)

    -M(length(M),[1:1:length(M)-1])*z([1:1:length(M)-1],nu+1));

    z(length(M),nu+1)=max(0,z(length(M),nu)+omega*(y(length(M),nu+1)-z(length(M),nu)));

    nu=nu+1;

    end

    z=z(:,nu);

    35

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    36/48

    function [z,nu]=Pivoting(q0,d0,M)

    %LCP solver applying PPP algorithm

    alpha=[];nu=0; %alpha denotes index set of interest, and nu is step-counter

    z=ones(length(M),1); %initialization of the solution

    indexset=[1:1:length(M)];

    while length([setdiff(indexset,alpha)])~=0

    %looping as long as alpha is not equal to the whole index set

    alpha1=setdiff(indexset,alpha); %alpha1 denotes the complement of alpha

    if nu==0

    q(alpha1,nu+1)=q0;

    d(alpha1,nu+1)=d0;

    else

    q(alpha1,nu+1)=q0(alpha1,:)-M(alpha1,alpha)*inv(M(alpha,alpha))*q0(alpha,:);

    d(alpha1,nu+1)=d0(alpha1,:)-M(alpha1,alpha)*inv(M(alpha,alpha))*d0(alpha,:);%updating

    end

    if d(alpha1,nu+1)0

    temp(l,:)=-q(alpha1(:,j),:)/d(alpha1(:,j),:);

    %temp is a temporarily used vector to determine the pivot element

    indextemp(l,:)=alpha1(:,j);%indextempcontains the indices of each element in temp

    l=l+1;

    end

    end

    [lambda,r]=max(temp);

    if lambda

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    37/48

    function F=tree4American(S0,sigma,r,K,T,Nt)

    %S0 denotes the initial price of the underlying;sigma represents the

    %volatility level; r is the riskfree interest rate; T is the length of the

    %period we consider;K denotes the strike price; Nt is the number of

    %steps we discretize.

    %-------computing the upwards rate and downwards rate-----

    dt=T/Nt;%length of each step

    u=exp(sigma*sqrt(dt));

    d=exp(-sigma*sqrt(dt)); %-----imposing u=1/d as the third condition

    p=(exp(r*dt)-d)/(u-d); %-----risk nuetral probability

    f=zeros(Nt+1); x=cumprod(d^2*ones(Nt+1,1));

    M=diag(p*ones(Nt+1,1))+diag((1-p)*ones(Nt,1),1);

    f(:,Nt+1)=max(K*ones(Nt+1,1)-S0*x*u^(Nt+2),zeros(Nt+1,1)); %terminal conditions

    for j=1:Nt

    f(:,Nt+1-j)=max(K*ones(Nt+1,1)-S0*x*u^(Nt+2-j),zeros(Nt+1,1));

    f(:,Nt+1-j)=max(exp(-r*dt)*M*f(:,Nt+2-j),f(:,Nt+1-j));

    end

    F=f(1,1);

    function output=Treemethod1(r,sigma,T,K,Nt,Ns,omega,theta)

    %This function is used to apply tree4American to a vector of

    %different state grids; ds=(log(300)-log(50))/Ns;

    s=[log(50):ds:log(300)]; % L=50 and U=300

    v=zeros(Ns+1,2); S=(exp(s([1:1:Ns+1])));

    v(:,2)=max(K*ones(Ns+1,1)-S,0);

    for i=1:Ns+1

    v(i,1)=tree4American(S(i),sigma,r,K,T,Nt);

    end

    output=[v(:,1) S];

    37

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    38/48

    function output=LCP4American_ProjectSOR1(r,sigma,T,K,Nt,Ns,omega,theta)

    %implicit method using logarithmically transformed variables:T is the final

    %time point; K is strike price; Ns is the number of the grid in state

    %space;Nt is the number of the grid in time direction.

    eps=10^(-8);

    dt=T/Nt; % step of time

    ds=log(6)/Ns; % step of state space

    y=[log(50):ds:log(300)]; % L=50 and U=300

    t=[0:dt:T]; a=-theta*(sigma 2*dt/(2*ds^2)-(r-sigma^2/2)*dt/(2*ds));

    b=1+r*dt+theta*sigma^2*dt/(ds^2);

    c=-theta*(sigma 2*dt/(2*ds^2)+(r-sigma^2/2)*dt/(2*ds));

    d=-(1-theta)*(sigma^2*dt/(2*ds^2)-(r-sigma^2/2)*dt/(2*ds));

    e=(1-theta)*sigma^2*dt/ds^2-1;

    f=-(1-theta)*(sigma^2*dt/(2*ds^2)+(r-sigma^2/2)*dt/(2*ds));

    %definition of six reduced parameters

    A=diag(c*ones(Ns-2,1),1)+diag(a*ones(Ns-2,1),-1)+b*eye(Ns-1);

    B=diag(f*ones(Ns-2,1),1)+diag(d*ones(Ns-2,1),-1)+e*eye(Ns-1);

    %definition of two (Ns-1)-square tridiagonal matrices

    Aa=abs(A);

    A1=-Aa+2*diag(diag(Aa)); %creation of the comparison matrix

    vt(:,1)=max(K*ones(Ns-1,1)-(exp(y([2:1:Ns]))),0); %terminal condition

    S=(exp(y([2:1:Ns])));

    psi_zero=max(K-exp(y(1)),0);

    S=[(exp(y(1)));S;(exp(y(Ns+1)))];

    %to complete the calculation at the first and the last state grids

    phi=[-(a+d)*psi_zero;zeros(Ns-2,1)];

    nu=zeros(1,Nt);%counter of looping times at each time grid

    q0=zeros(Ns-1,Nt); x=zeros(Ns-1,Nt);

    q0(:,1)=B*vt(:,1)-phi+A*vt(:,1); x(:,1)=ones(length(A),1); for

    j=1:Nt

    [z(:,j),nu(:,j)]=Projected_SOR(q0(:,j),A,omega,eps,x(:,j));

    vt(:,j+1)=vt(:,1)+z(:,j);

    q0(:,j+1)=B*vt(:,j+1)+A*vt(:,1)-phi;

    x(:,j+1)=z(:,j);

    end

    38

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    39/48

    function output=LCP4American_Pivoting1(r,sigma,T,K,Nt,Ns,omega,theta)

    %implicit method using logarithmically transformed variables:T is the final

    %time point; K is strike price; Ns is the number of the grid in state

    %space;Nt is the number of the grid in time direction.

    dt=T/Nt; % step of time

    ds=log(6)/Ns; % step of state space

    y=[log(50):ds:log(300)]; % L=50 and U=300

    t=[0:dt:T]; a=-theta*(sigma 2*dt/(2*ds^2)-(r-sigma^2/2)*dt/(2*ds));

    b=1+r*dt+theta*sigma^2*dt/(ds^2);

    c=-theta*(sigma 2*dt/(2*ds^2)+(r-sigma^2/2)*dt/(2*ds));

    d=-(1-theta)*(sigma^2*dt/(2*ds^2)-(r-sigma^2/2)*dt/(2*ds));

    e=(1-theta)*sigma^2*dt/ds^2-1;

    f=-(1-theta)*(sigma^2*dt/(2*ds^2)+(r-sigma^2/2)*dt/(2*ds));

    %definition of six reduced parameters

    A=diag(c*ones(Ns-2,1),1)+diag(a*ones(Ns-2,1),-1)+b*eye(Ns-1);

    B=diag(f*ones(Ns-2,1),1)+diag(d*ones(Ns-2,1),-1)+e*eye(Ns-1);

    %definition of two (Ns-1)-square tridiagonal matrices

    Aa=abs(A);

    A1=-Aa+2*diag(diag(Aa)); %creation of the comparison matrix

    d0=((A+A1)/2)*inv(A1)*0.05*ones(Ns-1,1); %n-step vector

    vt=zeros(Ns-1,Nt);

    vt(:,1)=max(K*ones(Ns-1,1)-(exp(y([2:1:Ns]))),0); %terminal condition

    S=(exp(y([2:1:Ns]))); psi_zero=max(K-exp(y(1)),0);

    S=[(exp(y(1)));S;(exp(y(Ns+1)))];

    %to complete the calculation at the first and the last state grids

    phi=[-(a+d)*psi_zero;zeros(Ns-2,1)]; nu=zeros(1,Nt);

    q0(:,1)=B*vt(:,1)-phi+A*vt(:,1); for j=1:Nt

    [z(:,j),nu(:,j)]=Pivoting(q0(:,j),d0,A);

    vt(:,j+1)=vt(:,1)+z(:,j);

    q0(:,j+1)=B*vt(:,j+1)+A*vt(:,1)-phi;

    end

    vt=[psi_zero*ones(1,Nt+1);vt;zeros(1,Nt+1)];

    %assuming vt(1,:)=psi_zero and vt(Ns+1,:)=0 hold for all time points

    output=[vt S;

    zeros(1,Nt+1) sum(nu)];

    39

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    40/48

    function output=LP4American1(r,sigma,T,K,Nt,Ns,omega,theta)

    %American option pricing by Linear Programming method(discrete) with logarithmically

    %transformed variables,i.e. s=logS.

    %T is the final time point; K is strike price; Ns is the number of the grid

    %in state space; Nt is the number of the grid in time direction; theta is

    %anther parameter corresponding different schemes(those are implicit, explicit

    %Crank-Nicolson)being applied.

    dt=T/Nt; % step of time

    ds=log(6)/Ns; % step of state space

    y=[log(50):ds:log(300)]; % L=50 and U=300

    t=[0:dt:T]; a=-theta*(sigma 2*dt/(2*ds^2)-(r-sigma^2/2)*dt/(2*ds));

    b=1+r*dt+theta*sigma^2*dt/(ds^2);

    c=-theta*(sigma 2*dt/(2*ds^2)+(r-sigma^2/2)*dt/(2*ds));

    d=-(1-theta)*(sigma^2*dt/(2*ds^2)-(r-sigma^2/2)*dt/(2*ds));

    e=(1-theta)*sigma^2*dt/ds^2-1;

    f=-(1-theta)*(sigma^2*dt/(2*ds^2)+(r-sigma^2/2)*dt/(2*ds));

    %definition of six reduced parameters

    A=diag(c*ones(Ns-2,1),1)+diag(a*ones(Ns-2,1),-1)+b*eye(Ns-1);

    B=diag(f*ones(Ns-2,1),1)+diag(d*ones(Ns-2,1),-1)+e*eye(Ns-1);

    %definition of two (Ns-1)-square tridiagonal matrices

    x=ones(Ns-1,1); % an arbitray vector that satisfy x>0

    vt=zeros(Ns-1,Nt+1);

    vt(:,1)=max(K*ones(Ns-1,1)-(exp(y([2:1:Ns]))),0); %terminal condition

    S=(exp(y([2:1:Ns]))); psi_zero=max(K-exp(y(1)),0);

    S=[(exp(y(1)));S;(exp(y(Ns+1)))];

    %to complete the calculation at the first and the last state grids

    phi=[-(a+d)*psi_zero;zeros(Ns-2,1)];

    for j=1:Nt

    vt(:,j+1)=linprog(x,-[eye(Ns-1);A],-[vt(:,1);(phi-B*vt(:,j))]);

    end

    vt=[psi_zero*ones(1,Nt+1);vt;zeros(1,Nt+1)];

    %assuming vt(1,:)=psi_zero and vt(Ns+1,:)=0 hold for all time points

    output=[vt S];

    40

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    41/48

    function output=Explicit4American1(r,sigma,T,K,Nt,Ns,omega,theta)

    %explicit method using logarithmically transformed variables:T is the final

    %time point; K is strike price; Ns is the number of the grid in state

    %space;Nt is the number of the grid in time direction.

    dt=T/Nt; % step of time

    ds=(log(300)-log(50))/Ns; % step of state space

    y=[log(50):ds:log(300)]; % L=50 and U=300

    t=[0:dt:T]; d=-(sigma^2*dt/(2*ds^2)-(r-sigma^2/2)*dt/(2*ds));

    e=sigma^2*dt/ds^2-1;

    f=-(sigma^2*dt/(2*ds^2)+(r-sigma^2/2)*dt/(2*ds));

    %definition of six reduced parameters

    B=diag(f*ones(Ns-2,1),1)+diag(d*ones(Ns-2,1),-1)+e*eye(Ns-1);

    vt=zeros(Ns-1,Nt+1);

    vt(:,1)=max(K*ones(Ns-1,1)-(exp(y([2:1:Ns]))),0); %terminal condition

    S=(exp(y([1:1:Ns+1]))); psi_zero=max(K-exp(y(1)),0);

    %to complete the calculation at the first and the last state grids

    phi=[-d*psi_zero;zeros(Ns-2,1)]; for j=1:Nt

    vt(:,j+1)=max((1/(1+r*dt))*(phi-B*vt(:,j)),vt(:,1)); %explicit scheme

    end

    vt=[psi_zero*ones(1,Nt+1);vt;zeros(1,Nt+1)];

    %assuming vt(1,:)=psi_zero and vt(Ns+1,:)=0 hold for all time points

    output=[vt S];

    41

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    42/48

    function output=Picturing1(NT,NS)

    %to plot the log-cputime against different space steps

    LOGCPU=zeros(length(NT)*length(NS),1);

    M1=kron(NT,ones(1,length(NS))); M2=kron(ones(1,length(NT)),NS);

    M=[M1;M2]; c=input(choose one method you want to test:\n1 for PSOR;

    2 for PPP;3 for LP;\n4 for Explicit; 5 for Tree.\n); t=zeros(5,1);

    if c==1

    for i=1:length(NT)*length(NS)

    for j=1:5

    tic; LCP4American_ProjectSOR1(0.05,0.2,1,100,M(1,i),M(2,i),1.5,1);

    t(j,:)=toc;

    end

    LOGCPU(i,:)=log(mean(t));

    end

    plot(NS,LOGCPU(:,1),*);

    xlabel(Space steps); ylabel(Log-Times(secs));

    output=[NS;LOGCPU(:,1)];

    elseif c==2

    for i=1:length(NT)*length(NS)

    for j=1:5

    tic; LCP4American_Pivoting1(0.05,0.2,1,100,M(1,i),M(2,i),1.5,1);

    t(j,:)=toc;

    end

    end

    LOGCPU(i,:)=log(mean(t)); end plot(NS,LOGCPU(:,1),*);

    xlabel(Space steps);ylabel(Log-Times(secs));

    output=[NS;LOGCPU(:,1)] elseif c==3 for i=1:length(NT)*length(NS)

    for j=1:5

    tic; LP4American1(0.05,0.2,1,100,M(1,i),M(2,i),1.5,1);

    t(j,:)=toc;

    end

    LOGCPU(i,:)=log(mean(t));

    end

    plot(NS,LOGCPU(:,1),*);

    xlabel(Space steps);ylabel(Log-Times(secs));

    output=[NS;LOGCPU(:,1)]

    elseif c==4

    for i=1:length(NT)*length(NS)

    for j=1:5

    42

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    43/48

    tic; Explicit4American1(0.05,0.2,1,100,M(1,i),M(2,i),1.5,1);

    t(j,:)=toc;

    end

    LOGCPU(i,:)=log(mean(t));

    end

    plot(NS,LOGCPU(:,1),*);

    xlabel(Space steps); ylabel(Log-Times(secs));

    output=[NS;LOGCPU(:,1)]

    else

    for i=1:length(NT)*length(NS)

    for j=1:5

    tic; Treemethod1(0.05,0.2,1,100,M(1,i),M(2,i),1.5,1);

    t(j,:)=toc;

    end

    LOGCPU(i,:)=mean(t);

    end

    plot(NS,LOGCPU(:,1),*);

    xlabel(Spacesteps); ylabel(Times(secs));

    output=[NS;LOGCPU(:,1)]

    end

    43

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    44/48

    function output=Picturing3(NT,NS,S0)

    %to plot the error against different space steps

    ERROR=zeros(length(NT)*length(NS),1);

    M1=kron(NT,ones(1,length(NS))); M2=kron(ones(1,length(NT)),NS);

    M=[M1;M2]; c=input(choose one method you want to test:\n1 for PSOR;

    2 for PPP;3 for LP;\n4 for Explicit; 5 for Tree.\n);

    if c==1

    for i=1:length(NT)*length(NS)

    S1=LCP4American_ProjectSOR1(0.05,0.2,1,100,M(1,i),M(2,i),1.5,1);

    S1=S1([1:1:M(2,i)+1],M(1,i)+1);

    S_exact=interp1(S0([1:1:401],102),S0([1:1:401],101),(exp([log(50):log(6)/M(2,i):log(300)])));

    ERROR(i,1)=max(abs(S_exact-S1));

    end

    plot(NS,ERROR(:,1),*);

    xlabel(Space steps); ylabel(Error);

    output=[NS; ERROR(:,1)];

    elseif c==2

    for i=1:length(NT)*length(NS)

    S1=LCP4American_Pivoting1(0.05,0.2,1,100,M(1,i),M(2,i),1.5,1);

    S1=S1([1:1:M(2,i)+1],M(1,i)+1);

    S_exact=interp1(S0([1:1:401],102),S0([1:1:401],101),(exp([log(50):log(6)/M(2,i):log(300)])));

    ERROR(i,1)=max(abs(S_exact-S1));

    end

    plot(NS,ERROR(:,1),*);

    xlabel(Space steps); ylabel(ERROR);

    output=[NS; ERROR(:,1)];

    elseif c==3

    for i=1:length(NT)*length(NS)

    S1=LP4American1(0.05,0.2,1,100,M(1,i),M(2,i),1.5,1);

    S1=S1([1:1:M(2,i)+1],M(1,i)+1);

    S_exact=interp1(S0([1:1:401],102),S0([1:1:401],101),(exp([log(50):log(6)/M(2,i):log(300)])));

    ERROR(i,1)=max(abs(S_exact-S1));

    end

    plot(NS,ERROR(:,1),*);

    xlabel(Space steps); ylabel(ERROR);

    output=[NS; ERROR(:,1)];

    elseif c==4

    for i=1:length(NT)*length(NS)

    S1=Explicit4American1(0.05,0.2,1,100,M(1,i),M(2,i),1.5,1);

    44

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    45/48

    S1=S1([1:1:M(2,i)+1],M(1,i)+1);

    S_exact=interp1(S0([1:1:401],102),S0([1:1:401],101),(exp([log(50):log(6)/M(2,i):log(300)])));

    ERROR(i,1)=max(abs(S_exact-S1));

    end

    plot(NS,ERROR(:,1),*);

    xlabel(Space steps); ylabel(ERROR);

    output=[NS; ERROR(:,1)];

    else

    for i=1:length(NT)*length(NS)

    S1=Treemethod1(0.05,0.2,1,100,M(1,i),M(2,i),1.5,1);

    S1=S1([1:1:M(2,i)+1],1);

    S_exact=interp1(S0([1:1:401],102),S0([1:1:401],101),(exp([log(50):log(6)/M(2,i):log(300)])));

    ERROR(i,1)=max(abs(S_exact-S1));

    end

    plot(NS,ERROR(:,1),*);

    xlabel(Space steps); ylabel(ERROR);

    output=[NS; ERROR(:,1)];

    end

    45

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    46/48

    function output=Newton(a0,b0,c0,alpha,x0)

    %Newton method utilized to solve an equation as ax^alpha+bx^(alpha-1)+c=0,

    %x0 denotes the initial guess point

    eps=10^(-8); x=x0;

    while abs(a0*x^alpha+b0*x^(alpha-1)+c0)>=eps

    x=x-(a0*x^alpha+b0*x^(alpha-1)+c0)/(a0*alpha*x^(alpha-1)+b0*(alpha-1)*x^(alpha-2));

    end

    output=x;

    function OptiCurv(a,b,c1,c2,beta,alpha1,alpha2)

    %to obtain optimal curves for PSOR, PPP, OLP algorithms

    u=[0.0005:0.0001:0.1];

    for i=1:length(u)

    Nt(i,:)=Newton(alpha2*c1+beta*c1*alpha1,a*beta*c1*alpha1/b,-alpha2*u(i),-alpha1,40);

    end

    Ns=((u-c1*(Nt).^(-alpha1))/c2).^(-1/alpha2);

    cpu=(a+b*Nt).*Ns.^beta;

    plot(u,cpu);

    46

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    47/48

    function Surface_Drawing(S0,Nt,Ns)

    %to draw the solution suface of American put option graphically

    T=1;

    dt=T/Nt; % step of time

    ds=log(6)/Ns; % step of state space

    y=[log(50):ds:log(300)]; % L=50 and U=300

    t=T*ones(1,Nt+1)-[0:dt:T]; S=(exp(y([1:1:Ns+1]))); [U

    V]=meshgrid(t,S); S0=S0([1:1:401],[1:1:101]);

    Z=interp1(exp([log(50):log(6)/400:log(300)]),S0,S);

    Z=interp1((T*ones(1,101)-[0:0.01:T]),Z,t); colormap(white);

    surf(U,V,Z);

    47

  • 7/29/2019 Li, Chang - Computational Methods for American Put Options

    48/48

    References

    [1] F. BLACK and M. SCHOLES, The pricing of options and corporate liabilities, J.Political Econ. 81 (1973),

    637659.

    [2] J.M. BORWEIN and M.A.H.DEMPSTER, The linear order complementarity problem, Math. Operations

    Res. 14(3) (1989), 534558.

    [3] R.W. Cottle, Jong-Shi Pang, and R.E. Stone, The linear complementarity problem, Computer science and

    scientific computing, Academic Press, 1992.

    [4] M.A.H. DEMPSTER and J.P. HUTTON, Pricing american stock option by linear programming, Mathe-

    matical Finance 9 (1999), no. 3, 229254.

    [5] J. Huang and Jong-Shi Pang, Option pricing and linear complementarity, Computational Finance 2 (1998),

    no. 1, 3160.

    [6] J.C. Hull, Options, futures, and other derivatives, 4th ed., Prentice Hall International, 2000.

    [7] J.P. HUTTON, Fast pricing of derivative securities, Ph.D.Thesis (1995).

    [8] P.JAILLET, LAMBERTON, and B. LAPEYRE, Variational inequalities and the pricing of american

    options, Acta Appl.Math. 21 (1990), 263289.

    [9] P. Wilmott, J. De