• No results found

Finite Differences Based on Radial Basis Functions to Price Options

N/A
N/A
Protected

Academic year: 2021

Share "Finite Differences Based on Radial Basis Functions to Price Options"

Copied!
25
0
0

Loading.... (view fulltext now)

Full text

(1)

U.U.D.M. Project Report 2014:36

Examensarbete i matematik, 30 hp

Handledare: Lina von Sydow

Examinator: Anders Öberg

Juni 2014

Department of Mathematics

Uppsala University

Finite Differences Based on Radial Basis Functions

to Price Options

(2)
(3)

Abstract

(4)

Contents

1 Introduction . . . 5

2 Background . . . 7

2.1 Black Scholes Equation . . . 7

2.2 Finite Difference Method . . . 7

2.3 Radial Basis Function . . . 9

3 Radial Basis Functions Based on Finite Differences Techniques (RBF-FD) . . . .11

4 Implementation . . . 13

5 Comparison of Different Radial Basis Functions for RBF-FD . . . .15

6 Improvement on Accuracy . . . 18

7 Final Results and Conclusion . . . 21

(5)
(6)

1. Introduction

The financial markets are becoming more and more complex, with trading not only of stocks, but also of numerous types of financial derivatives. Options are one kind of derivative financial instrument, which financial investors use for the arbitrage and hedging transactions [13]. And the most important and difficult part of option problems is option valuation, which requires a con-tinuous effort in modeling and development of numerical solution methods in order to determine fair prices. As an example, we can consider the widely used Black-Scholes model. The underlying assumption is Brownian motion of stock prices and this leads to a parabolic partial differential equation (PDE). Since option prices must be computed in real time, over and over again de-pending on the changing market conditions we need efficient computational methods.

Numerical methods have greatly influenced the development of option valua-tion. Advances in numerical methods offer the opportunity to examine issues in options with greater details and precision. These methods can explore ex-tremely complicated options in far greater detail than previously. A number of practical numerical methods are used in today’s financial derivative market, e.g. Monte Carlo methods, finite-difference methods, and methods based on approximation with radial basis functions.

Monte Carlo simulations are a broad class of computational algorithms that rely on repeated random sampling. This approach has been proved to be an easy and flexible numerical method in security pricing, even in high dimen-sional problems [11]. However, the convergence of this method is slow. To achieve reliable results many thousands of simulations are needed,leading a lot computation and time.

(7)

The last method presented here is approximation with Radial Basis Functions (RBF). A radial basis function is a real-valued function whose value depends only on the distance from the origin. This method became popular as a truly mesh-free method for the solution of partial differential equations (PDEs) on irregular domains and was proposed by Kansa [7] that compute a global so-lution. This method simplifies the approximations in high dimensions, give spectral convergence but result in full, ill-conditioned linear system of equa-tions to solve each time-step. Later, a local version of the method was pro-posed by several authors [3, 20, 21]. It is to sacrifice the spectral accuracy inherent to the global version, in order to have a sparse better-conditioned lin-ear system capable of solving large multidimensional PDEs. However, in this paper, accuracy is the one that I considered most, so I choose global version to compare and the best accuracy for a given number of node points is typically achieved when the basis functions are scaled to be nearly flat, which means that smaller shape parameter is needed.

(8)

2. Background

2.1 Black Scholes Equation

We are interested in solving the Black-Scholes equation, a PDE describing the option price over time, to solve option valuation problems. Consider a stock option price described as Pt= f (t, St) , where f is a second-order differential

operator in stock price S and time t, and K is the strike price. Then we have a transformed version with following properties

Kx= s, r= ¯r ˆ σ2, KP(t, x) = F(ˆt, s), (2.1) σ =σ¯ ˆ σ, t= ˆσ 2( ˆT− ˆt), Kψ = Φ(s),

where K is the strike price, more details can be found in [15] and the trans-formed PDE reads

 ∂ P ∂ t =L P, P(T, xT) = Φ(x), (2.2) L P = rx∂ P ∂ x + 1 2σ 2x2∂2P ∂ x2 − rP, (2.3)

ris the risk-free interest rate, σ is the volatility. In this study, European call options are considered as an example of contract function

ψ (x) = max(x − 1, 0). (2.4)

2.2 Finite Difference Method

(9)

where x_max = 4.

Then we have the initial condition boundary conditions of European call op-tion as follows

P(0, x) = max(x − 1, 0), (2.7)



P(t, 0) = 0,

P(t, xmax) = (xmax− 1)e−rt. (2.8)

The spatial derivatives are approximated by ∂ P ∂ x = Pj+1− Pj−1 2∆x +O(∆x 2), (2.9) ∂2P ∂ x2 = Pj+1− 2Pj+ Pj−1 ∆x2 +O((∆x) 2), (2.10) where Pj= P(t, Sj(t)), j = 1, 2, ..., N − 1, see [19]

For the time evolution of the problem, we can use the unconditionally stable BDF2 method [12]. Denote Pjn≈ Pj(tn), which yields

Pjn+ β1Pjn−1+ β2P n−2

j = kβ0L P n

j, (2.11)

where β0= 1,β1= −1 and β2= 0 for the first time-step and β0=23,β1= −43

and β2= 13 for subsequent steps. For more information about this method to

price option, see [17]

Figure 2.1.Pricing European call option price using finite differences method with 30 as strike price

(10)

2.3 Radial Basis Function

A radial basis function is a real-valued function of the form Φ(kx − xik) whose

value only depends only on the distance from the origin (xi= 0) or

alterna-tively on the distance from some other point c, called a center (xi= c).

The reasons for using RBFs for option pricing are that is easy to use in higher dimensions, it allows adaptive node placement, and can gives spectral accu-racy.

Radial Basis Functions are often used in function approximations, [2] , on the form:

y(x) = ΣNj=1wjφ (kx − xjk) (2.12)

Here, y(x) is the sum of N radial basis functions, each function associated with a different center xi, and weighted by an appropriate coefficient wi.

Commonly used are four types of the radical basis functions below (let r = kx − xik) [18]:

Multiquadric (mq) φ (r) =p1 + (εr)2 Inverse quadric (iq) φ (r) = 1+(εr)1 2

Gaussian (gs) φ (r) = e−(εr)2 Polyharmonic spline (r3) φ (r) = r3, k = 3

where ε is a shape parameter.

Approximating the solution with a time-dependent linear combination of RBF’s centered at the node points xj, we get

P(t, x) = ΣNj=1λj(t)φ (εkx − xjk) = ΣNj=1λj(t)φj(x), (2.13)

where φ (r) is the radial basis function and λj(t) represent the coefficients to

(11)

Figure 2.2. Error as a function of stock price and option price as a function of stock price using RBF method

(12)

3. Radial Basis Functions Based on Finite

Differences Techniques (RBF-FD)

The radial basis functions based finite difference method (RBF-FD) extracts the best features from both radial basis function approximations and finite dif-ferences. Rather than having all basis functions coupled to each other leading to the full linear system of equation, a nearest neighbor region is connected to each basis function. This leads to a sparse matrix, and we found that good convergence properties are retained.

Given N total nodes in the domain, here we have a set of initial stock price {xj}Nj=1. First we should find the inner weights for each {xj}Nj=1. We assume

n neighboring points for each xj, this means that for each xjthere are 2m points

that should be used and n = 2m + 1, where m is introduced for computation in programming. Then we have the equation

A(n×n)wj= B(n×1) (3.1)

where

A= ai j, ai j= φ (εkxi− xjk), i, j = {1, 2, ..., n},

B= bj, bj=L φ(εkx − xik)x=xj, i = {1, 2, ..., n}, j = {2, 3, ..., N − 1},

and the vector wj contains the weights. In matrix form this is

φ (ε kx1−x1k) φ (εkx1−x2k) ... φ (εkx1−xnk) φ (ε kx2−x1k) φ (εkx2−x2k) ... φ (εkx2−xnk) ... ... ... ... φ (ε kxn−x1k) φ (εkxn−x2k) ... φ (εkxn−xnk) !  w1j w2j ... wnj  =   L φ(εkx−x1k)x=x j L φ(εkx−x2k)x=x j ... L φ(εkx−xnk)x=x j   (3.2)

Solving 3.2 we get n weights for x = xj. Do the same procedure for each

stencil center xj, j = {2, 3, ..., N − 1} and plug them into a matrix of size (N ×

(13)

W=                         1 0 0 ... 0 0 0 ... 0 0 w12 w22 w32 ... wnn 0 0 ... 0 0 w13 w23 w33 ... wn3 0 0 ... 0 0 .. . ... ... ... ... 0 0 ... 0 0 w1m+1w2m+1w3m+1 ... wnm+1 0 0 ... 0 0 0 w1m+2w2m+2wm+23 ... wnm+2 0 ... 0 0 0 0 w1m+3w2m+3 w3m+3 ... wnm+3 0 ... 0 0 0 0 w1m+4 w2m+4 ... wnm+4 0 ... 0 .. . ... ... ... ... ... ... ... ... ... 0 0 ... 0 w1N−m−1 wN−m−12 w3N−m−1 ... wnN−m−1 0 0 0 ... 0 0 w1N−m w2N−m w3N−m ... wnN−m .. . ... ... ... ... ... ... ... ... ... 0 0 ... 0 0 w1 N−2 w2N−2 w3N−2 ... wnN−2 0 0 ... 0 0 w1N−1 w2N−1 w3N−1 ... wnN−1 0 0 ... 0 0 0 0 0 0 1                         N×N

Then we use the BDF2 scheme as described above. After combination of similar terms and simplification we get

(I − kβ0W)Pn(x) = −β1Pn−1(x) − β2Pn−2(x),

Inserting boundary conditions gives

(14)

4. Implementation

During the implementation of the algorithm, it was obvious that many things were computed several times. By using a clever algorithm, an amount of time and calculation can be saved.

Naively, N square matrices with n × n are used in formula 3.2 in order to calculate the weight matrix. For example, for the case of n = 7 and N = 20, 14 distance matrices are shown in table 4.1. For simplicity, the elements of all the distance matrices are represented as either 0 or 1, where 1 means the distance is nonzero and 0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0 1 1 1 1 1 1 0

The italic area shows the same values in both tables and ones with star are the values that need to be calculated at each loop.

This means that only need a matrix with size N × (2n − 1) and compute N × (2n − 1) distances rather than N × N. Then use distances in Table 4.2 to get φj(x) and this leads to a lot of time reduction. As we still need the matrix in

the form of Table 4.1, after all computations, we transform back to the old form.

In this study, all the solutions are implemented in Matlab on Mac OS X 10.7.4 and linear system of equations are solved with ’\’.

Because we are only interested in option prices near the strike price. We com-pute norm of the error in the interval [K3,5K3 ] for comparisons.

The Euclidean norm error is calculated as follows:

errorj= estimate valuej− exact valuej, j = 1, 2, ..., N,

kerrork = q

(16)

5. Comparison of Different Radial Basis

Functions for RBF-FD

In this thesis the goal is to find the optimal parameters (n, ε, φ ) to get high accuracy with low computing time. Figure 5.1 and 5.2 to start with, I try out a reasonable range for ε and n. Figure 5.1 demonstrates that choosing n = 7 is enough for all N as there is no much better accuracy when increasing n larger than 7 and larger stencil size cost more computation time and also needs larger shape parameter as the coefficient matrices in 3.1 ill-conditioning. So I will only use n = 3, n = 5 and n = 7 when compare with FD. For the shape parameter ε, it is known that the best accuracy for a given number of node points is typically achieved when the basis functions are scaled to be nearly flat [14]. I take mq as radial basis function and M = 100, N = 60, and n = 5 as an example in 5.2. It shows that the shape parameter ε has a big effect on the error. By choosing 2 as shape parameter we can avoid singular weight matrix in 3.1 when N is large. This result also holds for other radial basis function except r3.

(17)

Figure 5.2. The error as a function of shape parameter ε for the solution using FD-RBF with mq as radial basis function using M = 100 as an example.

The following figure 5.3 shows four graphs to compare radial basis functions described previously, plotting error against N, for different stencil sizes.

Figure 5.3.Error as function of N for the solution of RBF-FD using M = 100, ε = 2 as an example.

When increasing the number of nodes in space, we get a smaller error and larger stencil sizes give smaller error.

(18)

too big compare to the other three radial basis functions.

(19)

6. Improvement on Accuracy

A possible improvement is adding a constant by [9] 

y(x) = ΣN

i=1wiφ (kx − xik) + wi+1,

Σni=1wi= 0,

When apply this alternate procedure to RBF-FD, the inner matrices 3.2 be-comes 6.1.   φ (ε kx1−x1k) φ (εkx1−x2k) ... φ (εkx1−xnk) 1 φ (ε kx2−x1k) φ (εkx2−x2k) ... φ (εkx2−xnk) 1 ... ... ... ... φ (ε kxn−x1k) φ (εkxn−x2k) ... φ (εkxn−xnk) 1 1 1 ... 1 0       w1j w2j ... wnj wn+1j     =    L φ(εkx−x1k)x=x j L φ(εkx−x2k)x=x j ... L φ(εkx−xnk)x=x j −r    (6.1) Solving 6.1 we get n + 1 weights. We only take the first n weights into use and do the same procedure as above. Then we get the following plots.

(20)

Figure 6.2. Error as functions of N to compare new improvements and choosing mq as RBF

Compared with the one without adding constant we can see that adding con-stants generates only a slightly better result.

Since the method is concerned about financial concepts, we can adapt node point distribution to reduce financial error norms. We take p = (N − 2)/3, where p is an integer and distribute 2p + 1 points uniformly in the interval [0, 2K] and the remaining p points in the rest of the computational domain [17].

(21)

Figure 6.4. Error of functions of N using non-equidistant node for the solution of RBF-FD using M=100 as an example

Figure 6.5. Error as functions of N to compare new improvements choosing mq as RBF

(22)

7. Final Results and Conclusion

After a series of tests to improve the technique, we compare RBF-FD with optimal values of parameters decided above with RBF and FD.

Figure 7.1. The error as functions for the solution using RBF-FD, RBF and FD with mq as radial basis function for RBF-FD and M=100

Figure 7.1 demonstrates that RBF-FD has smaller errors than FD and larger than RBF for same N. For n = 3, RBF-FD behaves like FD which is reason-able.

In this paper, we have implemented the algorithm of RBF-FD and made a se-ries of experiments to get best accuracy of the method, we compared four types of radial basis functions, various shape parameters and stencil size n. We also tried to add a constant in our approximations and also to use non-equidistant grids. The main conclusion of the work is following:

• Three of the four radial basis functions examined are applicable, but multiquadric (mq) radial basis function is stable for most cases.

(23)

• Non-equidistant grids show a slightly better accuracy than equidistant ones. Adding a constant to the approximation does not improve the ac-curacy.

• Compared to finite differences, the RBF-FD method shows a better ac-curacy larger than 3.

(24)

References

[1] Victor Bayona, Miguel Moscoso, Manuel Carretero, and Manuel Kindelan. Rbf-fd formulas and convergence properties. J. Comput. Phys.,

229(22):8281–8295, November 2010.

[2] Martin D. Buhmann and M. D. Buhmann. Radial Basis Functions. Cambridge University Press, New York, NY, USA, 2003.

[3] Tom Cecil, Jianliang Qian, and Stanley Osher. Numerical methods for high dimensional hamiltonâjacobi equations using radial basis functions. Journal of Computational Physics, 196(1):327 – 347, 2004.

[4] G. Chandhini and Y. V. S. S. Sanyasiraju. Local rbf-fd solutions for steady convectionâdiffusion problems. International Journal for Numerical Methods in Engineering, 72(3):352–378, 2007.

[5] G. Chandhini and Sanyasiraju V S S Yedida. Local rbf-fd solutions for steady convection-diffusion problems. Int. J Numer. methods in Engineering, 72, January 2007.

[6] João F. Cocco, Francisco J. Gomes, Pascal J. Maenhout, Robert J. Barro, John Y. Campbell, Gary Chamberlain, Luigi Guiso, Per Krusell, David Laibson, Gregory Mankiw, Jonathan Parker, James M. Poterba, Tony Smith, and Luis Viceira For Comments. Consumption and portfolio choice over the life cycle, working paper, 1998.

[7] Gregory F. Fasshauer. Meshfree Approximation Methods with MATLAB. World Scientific Publishing Co., Inc., River Edge, NJ, USA, 2007.

[8] Natasha Flyer, Erik Lehto, Sebastien Blaise, Grady B. Wright, and Amik St-Cyr. A guide to rbf-generated finite differences for nonlinear transport: Shallow water simulations on a sphere. Journal of Computational Physics, 231(11):4078 – 4095, 2012.

[9] Bengt Fornberg and Erik Lehto. Stabilization of rbf-generated finite difference methods for convective {PDEs}. Journal of Computational Physics,

230(6):2270 – 2285, 2011.

[10] Bengt Fornberg, Erik Lehto, and Collin Powell. Stable calculation of

gaussian-based rbf-fd stencils. Comput. Math. Appl., 65(4):627–637, February 2013.

[11] Paul Glasserman. Monte Carlo methods in financial engineering. Applications of mathematics ; 53. Springer, New York, NY ; Berlin ; Heidelberg [u.a.], 2004. [12] E. Hairer, S.P. Nørsett, and G. Wanner. Solving Ordinary Differential Equations

I Nonstiff problems. Springer, Berlin, second edition, 2000.

[13] J. Hull. Options, Futures and Other Derivatives. Options, Futures and Other Derivatives. Pearson/Prentice Hall, 2009.

(25)

[15] Per Lotstedt, Jonas Persson, Lina von Sydow, and Johan Tysk. Space time adaptive finite difference method for european multi-asset options. Computers Mathematics with Applications, 53(8):1159 – 1180, 2007.

[16] Jonas Persson and Lina von Sydow. Pricing american options using a space-time adaptive finite difference method. Math. Comput. Simul., 80(9):1922–1935, May 2010.

[17] Ulrika Pettersson, Elisabeth Larsson, Gunnar Marcusson, and Jonas Persson. Improved radial basis function methods for multi-dimensional option pricing. Journal of Computational and Applied Mathematics, 222(1):82 – 93, 2008. Special Issue: Numerical {PDE} Methods in Finance.

[18] C.M.C. Roque, D. Cunha, C. Shu, and A.J.M. Ferreira. A local radial basis functionsâfinite differences technique for the analysis of composite plates. Engineering Analysis with Boundary Elements, 35(3):363 – 374, 2011. [19] R. Seydel. Tools for Computational Finance. Universitext (1979). Paris, 2004. [20] C Shu, H Ding, and K.S Yeo. Local radial basis function-based differential

quadrature method and its application to solve two-dimensional incompressible navierâstokes equations. Computer Methods in Applied Mechanics and Engineering, 192(7â8):941 – 954, 2003.

References

Related documents

The novelties of this paper are that we, based on the finite element framework, i propose and analyze two methods to construct sparse approximations of the inverse of the pivot block

This thesis describes the pricing of European call options under the Bates model using finite di↵erence discretization and adaptivity in the space di- mension x, i.e the

The results show that there are differences in syntactic maturity between the genders, as the female students in junior high school and the male students in senior high

This table shows that both females and males tend to compliment the ones who are present, because the purpose of compliments is to express respect for the hearer and

The goal of this study is to provide a working, stable and high order accurate numerical method for the Soliton model and for some boundary conditions.. In section 3 a set of

The specific aims of the research were to describe the effects of physical activity and training programmes on bone mass and balance performance in adults, to determine whether a

Magnus Jandinger On a Need t o Know Basis: A Conceptual and Methodological F ramework f or Modelling and Analysis of Inf ormation Demand in an Ent erprise Cont ext.

One of the main design objectives addressed by our admission control architec- tures is to employ efficient early connection discard mechanisms that provide overload protection