• Nie Znaleziono Wyników

Application of the finite difference cn method to value derivatives

N/A
N/A
Protected

Academic year: 2021

Share "Application of the finite difference cn method to value derivatives"

Copied!
11
0
0

Pełen tekst

(1)

University of Technology and Life Sciences in Bydgoszcz

Summary

Application of finite difference methods to approximate the partial differential equations is a technique used for the valuation of financial instruments. The article examines the financial and mathematic applications of the Crank-Nicolson (CN) method, which is the combination of the patterns of the two other methods – overt and non-overt. The results of the CN method in the valuation and risk management are briefly discussed here. The analysis shows that it is worthwhile to introduce and implement such patterns as the Crank-Nicolson finite difference method.

Keywords: Crank-Nicolson finite difference method, option valuation, implicit method, explicit method, derivatives, Black-Scholes, financial engineering, implementation 1. Introduction

Financial institutions, aiming at more effective management of capital on the finance markets, in the second half of the twentieth century began to use widely the option contracts together with the advent of first discrete [7], [10] Monte-Carlo [2] and analytical [1], [9], [11] valuation models of these financial products. The development of the already existing schemes and the creation of the new valuation models of financial instruments expand the possibility to use the products and enables better management of the risk. In addition, there is a technological development, manifest-ed by a rapid increase in computing power. Thanks to that, the new generation hardware allows real-time calculation of the complex numerical problems, including solving differential equations.

Option contracts are the financial instruments, which provide the possibility to obtain above-average investment returns regardless of market conditions. They may be based on various under-lying instruments such as materials, currencies, interest rates, indices and equities. Option contract can be defined [10] as a contract between the seller and buyer, which gives the buyer a right (but not the obligation) to call or put underlying assets during a specified period of time in the future at a reference price in return for a fee called the option premium. The option price depends on the value of the primary instruments. Having the option gives the right, but not the obligation. Thus, the option holder enforces the right in the case when it is beneficial for him. The enforcement of the right is called option exercise or its settlement. The European type option can be exercised only on the expiration date. In the case of the European type of option the completion and the expira-tion deadlines are the same. The holder of the American-style opexpira-tion can do that at any time since its acquisition until the expiration date. American and European types of option contracts are known as standard or vanilla. All other contracts are known as exotic ones.

(2)

Option market price is often referred to as the option premium or the option price. This is the price that we must to pay to acquire the option. Option premium during the period of validity may vary and it is dependent on supply and demand on the market. If the market price deviates from the theoretical price determined by means of mathematical models then that is the indicator for the investors whether the purchase or option is beneficial at a time. Due to the ever-changing calcula-tion parameters – such as the price of the underlying instrument (e.g. shares) – an important thing is that applications based on mathematical models are able to calculate and refresh evaluation quickly and accurately. This allows traders to control their investment positions and to seek new investment possibilities in the market.

To find the value of the option an appropriate pricing model should be used. Only selected types of options can be measured by analytical models. In turn, even the simplest valuation cases should be also checked with an alternative method. Using numerical methods to evaluate the value of financial products under consideration, makes sense in such cases. Among the numerical schemes, finite difference method for pricing options deserves special attention. They will be applied to valuate options by an approximate solution of partial differential equations (PDE), which describes diffusion process to which these derivatives are subjected. Finite difference methods are the tools for generating numerical solutions to partial differential equations. Finite difference formulas are useful for the valuation of derivative instruments, in case there are no corresponding analytical solutions and in case some complex multivariate models are to be solved. By discretization of continuous partial differential equations, to which the derivative is subject to, you can bring the present value of the security [17].

Among the methods of finite difference, one can distinguish between explicit method, implicit method, and Crank Nicolson method. In this article, examples of numerical schemes, based on my own studies [16], [17] and descriptions from finite difference methods books [8], [12] are ana-lyzed. In Chapter 2 and 3 the explicit and implicit methods of finite differences are briefly discussed. In chapter 4 CN method is presented based on two previous chapters. In chapter 5 the results of Crank Nicolson finite difference method are outlined. In addition, in chapter 5 the summary of the analysis and the characteristics of the CN schemes are discussed. Chapter 5 also includes the comparison of the final results of the explicit method.

2. Explicit method of the option contracts

Chapters regarding mathematical approach to finite difference methods are mainly based on [16], [12], [10] and [8]. Numerical methods of the financial instruments valuation derived from the finite difference approach can be applied for the valuation of standard options as well as for the option contracts with more complex, nonlinear payment function [5]. Finite difference methods are applied for the valuation of the derivatives by solving the differential equation including the initial price of asset condition and boundary conditions (such as payment of function), which also have to be met by this instrument. Differential equation is transformed into a system of difference equations solved in chains through multiple repetitions. Consider the Black-Scholes partial differ-ential equation (PDE) [1], [10], [14]:

(

)

rV

S

V

S

S

V

S

q

r

t

V

=

+

+

2 2 2 2

2

σ

(1)

(3)

the payment function for this equation is as follows W(ST, T) = (ST - X).

where:  – variable, r – risk-free short term interest rate, q – dividend, return of the underlying instrument, X – the option exercise price, S – the price of the underlying instrument, ST – the

market price of the underlying instrument at time T, t – time, T – the time of option contract expiration, V – the option price.

One should divide time and space into separate items into t and t, which form a spatial grid (according to Trigeorgis [13], [9] good results are achieved for

2 2 2

t

t

x

=

+

σ

µ

). The grid should be supplemented by boundary conditions, determining the option price as a function of assets prices for high and low values, in such a way that

V

/

S

=

1

holds for large S and

1

/

=

V

S

for small S.

Black- Scholes partial differential equation can be simplified by replacing it with finite differ-ences. By doing that, you can make the digitalizing of PDE into the developed finite difference numerical formula.

First PDE must be simplified. Let x=ln (S), one will get:

rV

x

V

x

V

t

V

=

+

+

2 2 2

2

σ

µ

where  = r – q. Let u(x,t) be the new function that will help to get rid of rV on left side of the above equation. The function u is the future price of the option V and fulfils the following PDE:

t

x

u

x

u

=

+

µ

µ

σ

2 2 2

2

Next, the PDE digitalization has to be made, taking the median difference of state variable x, and the difference in the future time t. We denote

x

j

=

j

x

,

u

i,j

=

u

(

x

j

,

t

i

)

and

t

i

=

i

t

.

Then substitute finite differences for PDE:







=







+







+

+ + − + + + − + + +

t

u

u

x

u

u

x

u

u

u

i j i j i j i 1,j 1 i 1,j 1 i 1,j i,j 2 1 , 1 , 1 1 , 1 2

2

2

2

µ

σ

(2) After transformation we obtain the relation of repeating segments for the future options price:

1 , 1 1 , 1 , 1 ,j

=

m i+ j

+

u i+ j+

+

d i+ ji

p

u

p

u

p

u

u

(3)

where pm, pu and pd have the following values:

2 2

1

x

t

p

m

=

σ

x

t

x

t

p

u

+

=

2

2

2 2

µ

σ

x

t

x

t

p

d

=

2

2

2 2

µ

σ

(4)

Note that

p

m

+

p

u

+

p

d

=

1

. After the determination of

x

t

=

µ

β

and

( )

2

x

t

=

α

one can write the equation in the following way:

(4)

2

1

ασ

=

m

p

2

2

β

ασ

+

=

u

p

2

2

β

ασ

=

d

p

Let’s substitute the values of option

( ) j i t T r j i

e

u

V

i , , − −

=

into equation (3). We Obtain the formula used by backwards induction:

(

1, 1 1, 1, 1

)

, + + + + − ∆ −

+

+

=

r t u i j m i j d i j j i

e

p

V

p

V

p

V

V

(5)

This formula shows us the value of the discounted, expected future option price (under condi-tions of risk neutrality) [12]. It worth to note, that this equation is comparable to the backwards induction formula used in trinomial trees method.

Figure 1. Schematic finite difference digitalization in the explicit method Source: Based on [16]. u(i,j+1) u(i,j) u(i,j-1) u(i+1,j) i∆t (j-1)∆x j∆x (j+1)∆x (i+1)∆t 0

(5)

3. Implicit method

If the backward difference

t

u

u

i j i j

− ,1 ,

in the equation (2) is put into the forward difference at time variable we obtain implicit differences formula, where

u

i+1,j indirectly depends on

u

i,j+1,

j i

u

, and

u

i,j−1. 1 , , 1 , , 1 + − + j

=

u i j

+

m ij

+

d ij i

p

u

p

u

p

u

u

(6)

where the probabilities

p

m,

p

u,

p

d have been defined in equations (4). If we substitute

the current value of the option in equation (6), we obtain the expected, neutral to the value risk:

(

, 1 , , 1

)

, 1 + − ∆ − +

=

u i j

+

m i j

+

d i j t r j i

e

p

V

p

V

p

V

V

(7)

The option value tends to zero when the share price goes to infinity. One can use the boundary condition

V

i,M

=

0

for i = 0,l,...,N (8). Conversely, if

V

i,j is a put option, and the stock price is zero, we obtain the boundary condition:

V

i,−M

=

X

i = 0,l,...,N (9). The value of selling option at the expiry time T is:

V

N,j

=

max

(

X

S

j

,

0

)

j = -M,…,-1,0,l,...,M (10).

Boundary conditions (8), (9), (10) describe above determine the value of the option along the edges of the grid (Fig. 2). To calculate the value V at any other point you should use equation (7). First, the points will be calculated corresponding to the T-∆t. From the equation (7) for i = N – 1 follows 2M-1 linear equations:

(

u N j m N j d N j

)

t r j N

e

p

V

p

V

p

V

V

,

=

−∆ 1,

+

1,

+

1, j = -M+1,…,-1,0,l,...,M+1 (11) Figure 2 shows the digitalization of finite implicit differences.

(6)

Figure 2. Digitalization scheme of finite differences in implicit method. Source: Based on [16].

After transformation using matrix, the following results are obtained:

∗ +

=

i M M i

u

u

, 1, , ∗ + ∗ +

=

i j i j jd j i

u

u

p

u

, 1, , 1 , i = 0,l,...,N-1, j=-M+1,…,M-1 (18) For the solution ui from (13) LU decomposition or iterative methods without need to turn the matrix M, can also be used. LU and iterative method are further described in Clewlow book [6]. 4. Crank Nicolson method

Crank Nicolson method is finite difference technique developed to remove stability and con-vergence restrictions of finite explicit differences method. This method has higher rate of convergence than explicit and implicit methods depicted above. Rate of convergence for the Crank-Nicolson method is O((t)2), for explicit and implicit methods, on the other hand, it is O(t).

By design, Crank Nicolson method is the average of explicit and implicit methods – consider (19) and (20). Consider the simple diffusion equation. If the derivative partial time approximation by backward differences is applied, one obtains the following implicit formula (based on [8], [12]): u(i+1,j+1) u(i,j) u(i+1,j-1) u(i+1,j) i∆t (j-1)∆x j∆x ( j+1)∆x (i+1)∆t 0

(7)

( )

(

( )

)

t

O

( )

t

u

u

t

O

x

u

u

u

i j i j i j i j i j

+

=

+

+

+ + − + + + 2 1, , 2 1 , 1 , 1 1 , 1

2

In case of forward differences on obtains explicit formula:

( )

( )

(

( )

)

2 2 1 , , 1 , , , 1

2

t

O

x

u

u

u

t

O

t

u

u

i j i j i j i j i j

+

+

=

+

+ − +

Taking the arithmetic mean of these two equations, one gets:

( )

(

( )

)

t

O

( )

t

u

u

t

O

x

u

u

u

u

u

u

i j i j i j i j i j i j i j i j

+

=

+

+

+

+

+ + + + + + 2 1, , 2 1 , , 1 , 1 , 1 , 1 1 , 1

2

2

2

(19) After ignoring the errors, we get the final CN formula:

(

, 1 , , 1

)

1,

(

1, 1 1, 1, 1

)

,

2

2

2

2

+

+

=

+

+ +

+

+

+ −

+

i j i j i j i j i j i j i j j i

u

u

u

u

u

u

u

u

α

α

(20) where

( )

2

x

t

=

α

. It should be noted that,

u

i+ j1, 1,

u

i+1,j and

u

i+ j1, +1 are implicitly de-fined in components

u

i,j,

u

i,j+1 and

u

i,j1.

Equation (20) can be matrix solved, because everything that is on the right side can be calcu-lated explicitly in case

u

i,jare known.

In the matrix approach, indicating the left side of equation (20) as

L

i,j, one first calculates:

(

i j i j

)

(

)

i j j i

u

u

u

L

, , 1 , 1

1

,

2

α

α

+

+

=

− + (21) Next, we calculate:

(

)

u

i 1,j

(

u

i 1,j 1

u

i 1,j 1

)

L

i,j

2

1

+

+

+ −

+

+ +

=

α

α

(22)

Equation (22) can be recorded as a system of linear equations:

i i

w

Ru

+1

=

(23)

(8)





















































+

+

+

+

=

α

α

α

α

α

α

α

α

α

α

1

2

0

0

2

0

1

2

0

2

1

2

0

0

2

1



















R

,

































=

− + + + + + + − 1 , 1 0 , 1 1 , 1 1 N i i N i i

u

u

u

u





, (24)

while vector w is:

































+

































=

+ − + − + + − + N i N i N i i N i i

u

u

L

L

L

w

, 1 , 1 1 , 0 , 1 ,

0

0

2







α

, (25)

Vector far right in the formula in wi in (25) arises from the boundary conditions used in the terminal points of a finite mesh, where x = x N-and x = x. N+ and N- must be integers, large enough to avoid significant error [12]. Although from the other point of view, its worth to take under consideration, that applying the Crank-Nicolson scheme, one obtain a system of (2N+ – 1)(2N- – 1) linear equations.

In applying the Crank-Nicolson formula, first the vector w is generated by the substitution of known quantities. Then either LU decomposition solver or SOR solver [6] is used, to solve the system (23).

5. Analysis, summary and conclusions

To use the computational model for financial instruments in practice, high demands set by in-vestors in the speed and accuracy of calculations must be met. Development of the technology and growing computational capabilities of computers allow for the use of real-time pricing option contracts schemes based on finite difference method.

Described in the previous chapters schemes have been implemented in C++ as a part of finan-cial instruments library [16]. Some data and information have been used from [16], [8] and [12]. Schemes tests were carried out for the values of the standard European call option for the follow-ing data r=0,1, =0,1, S=100, T-t=0,25 (time to expiration). All times of the tests are standardized, which means that they are presented as a multiple of the time measurement for the calculation with the fewest nodes. Sample results are shown in the table below.

(9)

Method Explicit Implicit NC Nodes 2500 8100 22500 2500 8100 22500 2500 8100 22500 X 95 6,137 6,126 6,121 6,137 6,125 6,121 6,124 6,122 6,121 100 1,843 1,874 1,868 1,874 1,873 1,868 1,870 1,869 1,868 105 0,217 0,169 0,162 0,209 0,167 0,162 0,193 0,165 0,162 Performance time 1 7,08 49,2 1 8,25 54,37 1 11,34 76,42

The analysis shows that the CN method of finite differences gives similar results as the explic-it method. Sometimes there may be differences between the obtained results due to method stability level. Some different behaviour due to boundary conditions can also be noticed. There-fore, what is characteristic for the CN and explicit methods is that Crank-Nicolson method provides slightly better results from the accuracy and the stability point of view. Although it has to be stated, that CN schemes have problems to handle discontinuous initial data. Therefore, special initialization steps are necessary (e.g. usage of fully implicit finite difference method). The CN is also the most numerically intensive. The explicit scheme is the least accurate and can be unstable, but is least numerically intensive. These implications are consistent with the findings in the litera-ture (e.g. [8]).

It should be noted that if the underlying assets are stocks, then one should also consider the presence of dividends. However, in the case of calculations for an American-type option, one should take into account the possibility of the earlier exercise. We must then check each node whether the assets would be worth more in case of immediate delivery.

From the discussion above it follows that the approach of the CN and other differential meth-ods can solve the problems of derivatives valuation of a similar level of complexity as in trinomial trees. Usually, the CN method can be used when other methods are inadequate. Like the methods based on polynomial trees, differential methods are not optimal for determining the value of the instruments based on a number of underlying instruments. When there are a lot of underlying instruments or a lot of problems with multi dimensions the Monte Carlo method is usually pre-ferred [2], [15].

Using the Crank-Nicolson method involves the introduction of additional precautions to en-sure convergence. Various tests have shown that the advantage of the CN method is a relatively high stability in relation to the explicit method.

Crank Nicolson method is the average of explicit and implicit methods [16]. This method has the rate of convergence O((t)2). To compare, the rate of convergence for the explicit method is lower and is O(t). In relation to the explicit method the described method is also more stable.

Implemented pricing model allows contracts to support investment decisions on stock ex-changes and on the non-market transactions. Implementations of models based on the presented solutions can be a practical tool to assist the Polish market investment [16]. In addition, in outlined cases, the analyzed schemes ensure stability and accuracy of financial products evaluation.

This work can also be a base for further studies of advanced finite difference methods and schemes that are presently discussed in finance literature [8]. These potential areas includes: Crank-Nicolson, exponentially fitted and higher order methods for multi-factor and one-factor options. Analysing CN method cases when it doesn’t work properly. Problems of different and changing boundary values. Premature exercise approximation and features using front fixing, variational and penalty schemas. Application of primary asset jumps simulation within Partial

(10)

Integro Differential Equations (PIDE) theory. As well as adjusting stochastic volatility models with the usage of Splitting schemas.

%LEOLRJUDSK\

[1] Black F., Scholes M. (1972): The valuation of option contracts and a test of market efficiency, Journal of Finance, 399–418.

[2] Broadie M., Glasserman P. (1997): Monte Carlo methods for security pricing, Journal of Economic Dynamics and Control 21, p. 1267–1321.

[3] Cerny A. (2004): Mathematical techniques in finance, Princeton University Press, New Jersey.

[4] Chorafas D. (1995): Financial models and simulation. McMillan Press, London.

[5] Clarke F.H., Parrot K. (1996): The multigrid solution of two factors American put options. Tech. Rep. 96–16, Oxford Computing Laboratory, Oxford.

[6] Clewlow L., Strickland C. (1998): Implementing derivatives models. John Wiley & Sons, Chichester UK.

[7] Cox J., Ross S., Rubinstein M. (1979): Option pricing. A simplified approach. Journal of Financial Economics, p. 229–263.

[8] Duffy D. (2006): Finite Difference Methods in Financial Engineering. A Partial Differential Equation Approach. Wiley Finance, Hoboken, New Jersey.

[9] Haug E. (1998): The complete guide to option pricing formulas, McGraw Hill, New York. [10] Hull, J.C. (2006): Options, Futures and Other Derivatives, 6th Edition, Prentice Hall, New

Jersey.

[11] Jakubowski J., Palczewski A., Rutkowski M, Stettner Ł. (2003): Financial mathematics, WNT, Warsaw, (in Polish).

[12] London J. (2005): Modeling Derivatives in c++, Wiley Finance, Hoboken, New Jersey. [13] Trigeorgis L. (1991): A log-transformed binomial numerical analysis method for valuing

complex multi-option investments, Journal of Financial and Quantitative Analysis 26, p. 309–326.

[14] Willmot P., Dewynne J., Howison S. (1993): Option pricing. Oxford Financial Press, Oxford. [15] Zarzycki H. (2009): Computer system for valuing options with Monte Carlo approach, Studies and proceedings of Polish Association for Knowledge Management, Bydgoszcz, (in Polish).

[16] Zarzycki H. (2006): Decision support in a computer system for managing investments in the option markets, PhD Thesis, Technical University of Szczecin, Szczecin, (in Polish).

[17] Zarzycki H. (2010): Application of finite difference approach to option pricing, Studies and proceedings of Polish Association for Knowledge Management, Bydgoszcz.

(11)

ZASTOSOWANIE METODY CN RÓĩNIC SKOēCZONYCH DO ANALIZY I WYCENY FINANSOWYCH INSTRUMETNÓW POCHODNYCH

Streszczenie

Zastosowanie metod róĪnic skoĔczonych do aproksymacji równaĔ róĪniczko-wych cząstkoróĪniczko-wych jest techniką stosowaną przy wycenie instrumentów finansoróĪniczko-wych. Ten artykuł analizuje matematyczne i finansowe zastosowanie metody Cranka-Nicolsona (CN), która jest złoĪeniem schematów innych dwóch metod – jawnej i nie-jawnej. Krótko opisane są rezultaty stosowania metody CN w wycenie i zarządzaniu ryzykiem. Analiza pokazuje, Īe warto wprowadzaü i implementowaü schematy takie jak metoda róĪnic skoĔczonych Cranka-Nicolsona.

Słowa kluczowe: Rónice skoczone, metoda Cranka-Nicolsona, jawna metoda rónic skoczo-nych, niejawna metoda rónic skoczoskoczo-nych, wycena opcji, Black-Scholes, inynieria finansowa

Hubert Zarzycki

Department of Computing in Management University of Technology and Life Sciences

ul. Kaliskiego 7, bud. 3.1., 85-796 Bydgoszcz, Poland e-mail: hzar@utp.edu.pl

Cytaty

Powiązane dokumenty

we demand assumptions about a and p closed to that one in Chapter 2 and if £2 is such a domain that the values of ii M occuring on the right -hand side of (19) can be obtained

Czy kiedy prawo ostatecznie zapanuje, stanie się najistotniejsze w życiu społeczeństw a, czy wtedy prawo nie wyruguje sum ienia?. - Tak, w jakim ś sensie ma pan

ponieważ byliśmy sobie pisani teleologiczna II 4 po prostu, takie rzeczy nie mają celu anty-teleologiczna 1 ponieważ widocznie tak miało być teleologiczna I 3 ponieważ

Let us consider the Banach space L(Ω h ) consisting of all mesh functions y h which are bounded and such that the norm ky h k ∗ defined by (3.1)

udział w imporcie białek błony wewnętrznej, zawierających 4 lub 6 odcinków transbłonowych o strukturze helisy, w obrębie których znajdują się sygnały

W Totalité et Infini znajdujemy takie oto określenie istoty miłości: „Miłość, która jest transcendencją, idzie w kierunku Drugiego i rzuca nas z powrotem w samą

Es wird angenommen, dass Sprachzei- chen (Lexeme, Äußerungen) komplexe Vorstellungsbilder auslösen können, wozu nicht nur die visuelle Dimension, sondern auch andere sensomo-

In this paper we present some recent results concerning convergence rate esti- mates for finite-difference schemes approximating boundary-value problems.. Special attention is given