Numerical Methods in Computational Finance. Daniel J. Duffy
Чтение книги онлайн.

Читать онлайн книгу Numerical Methods in Computational Finance - Daniel J. Duffy страница 42

СКАЧАТЬ C_; public: MatrixOde(const ublas::matrix<value_type>& A, const ublas::matrix<value_type>& IC) : A_(A), C_(IC) {} void operator()(const state_type &x , state_type &dxdt, double t ) const { for( std::size_t i=0 ; i < x.size1();++i ) { for( std::size_t j=0 ; j < x.size2(); ++j ) { dxdt(i, j) = 0.0; for (std::size_t k = 0; k < x.size2(); ++k) { dxdt(i, j) += A_(i,k)*x(k,j); } } } } };

       S1: Series methods (for example, truncating the infinite Taylor series representation for the exponential).

       S2: Padé rational approximant. This entails approximating the exponential by a special kind of rational function.

       S3: Polynomial methods using the Cayley–Hamilton method.

       S4: Inverse Laplace transform.

       S5: Matrix decomposition methods.

       S6: Splitting methods.

      3.7.1 Transition Rate Matrices and Continuous Time Markov Chains

      An interesting application of matrices and matrix ODEs is to the modelling of credit rating applications (Wilmott (2006), vol. 2, pp. 665–73). To this end, we define a so-called transition matrix P, which is a table whose elements are probabilities representing migrations from one credit rating to another credit rating. For example, a company having a B rating has a probability 0.07 of getting a BB rating in a small period of time. More generally, we are interested in continuous-time transitions between states using Markov chains, and we have the following Kolmogorov forward equation:

      (3.30)StartFraction italic d upper P left-parenthesis t comma t Superscript prime Baseline right-parenthesis Over italic d t EndFraction equals upper P left-parenthesis t comma t Superscript prime Baseline right-parenthesis upper Q

      where t equals current time t prime equals future time and upper P left-parenthesis t comma t right-parenthesis equals upper I identical-to unit matrix unit matrix and upper Q equals left-parenthesis q Subscript italic i j Baseline right-parenthesis comma 1 less-than-or-equal-to i comma j less-than-or-equal-to n is the transition rate matrix having the following properties:

StartLayout 1st Row 1st Column Blank 2nd Column Number 1 period 0 less-than-or-equal-to minus q Subscript italic i i Baseline less-than infinity 2nd Row 1st Column Blank 2nd Column Number 2 period 0 less-than-or-equal-to minus q Subscript italic i j Baseline comma i not-equals j 3rd Row 1st Column Blank 2nd Column 3 period sigma-summation Underscript j Endscripts q Subscript italic i j Baseline equals 0 left-parenthesis upper R o w sums right-parenthesis for-all i equals 1 comma ellipsis comma n period EndLayout

      The Kolmogorov backward equation is:

      (3.31)StartFraction italic d upper P left-parenthesis t comma t Superscript prime Baseline right-parenthesis Over italic d t EndFraction equals minus italic upper Q upper P left-parenthesis t comma t Superscript prime Baseline right-parenthesis period

      The objective is to compute the transition rate matrix Q (that is, states that are in one-to-one correspondence with the integers).

      In the case of countable space, the Kolmogorov forward equation is:

      (3.32)StartFraction partial-differential upper P Subscript italic i j Baseline Over partial-differential t EndFraction left-parenthesis s semicolon t right-parenthesis equals sigma-summation Underscript k Endscripts upper P Subscript italic i k Baseline left-parenthesis s semicolon t right-parenthesis upper Q Subscript italic k j Baseline left-parenthesis t right-parenthesis

      where Q(t) is the transition rate matrix (also known as generator matrix), while the Kolmogorov backward equation is:

      (3.33)StartFraction partial-differential upper P Subscript italic i j Baseline Over partial-differential t EndFraction left-parenthesis s semicolon t right-parenthesis equals sigma-summation Underscript k Endscripts upper Q Subscript italic i k Baseline left-parenthesis s right-parenthesis upper P Subscript italic k j Baseline left-parenthesis s semicolon t right-parenthesis period

      This chapter took over where Chapter 2 left off. We have tried to give a self-contained overview of the analytic properties of scalar ODEs and systems of ODEs as well as their numerical approximation. The topics are important in their own right, and an understanding of them is important in finance applications. We also gave a short introduction to stochastic differential equations (SDEs) in Section 3.4. We discuss SDEs and their relationship with PDEs in Chapter 13.

      There's no sense in being precise when you don't even know what you're talking about.

      John von Neumann

      This chapter introduces vector spaces of finite dimension. They can be seen as the n-dimensional generalisation of the two- and three-dimensional vectors that we have become accustomed to. In three dimensions, for example, a vector is a 3-tuple x equals left-parenthesis x 1 comma x 2 comma x 3 right-parenthesis identical-to left-parenthesis x comma y comma z right-parenthesis consisting of three components (elements), and it can be visualised as a directed line from the point (0, 0, 0) to the point left-parenthesis x 1 comma x 2 comma x 3 right-parenthesis. In higher dimensions this geometric analogy is lost (unless you are Albert Einstein), and we model vectors as an n-tuple left-parenthesis x 1 comma x 2 comma ellipsis comma x Subscript n Baseline right-parenthesis of homogeneous components of a certain type (in most cases real or complex variables). In particular, we discuss the following use cases as we progress:

       U1: Addition of vectors.

       U2: Premultiplication of a vector by a scalar (an element of a field).

       U3: Inner products in vector spaces.

       U4: СКАЧАТЬ