Differential operator - 2023.2 English

Vitis Libraries

Release Date
2023.2 English

In finite-difference methods, a differential operator \(D\) is used to transform a function \(f(x)\) into one of its derivatives, for instance \({f}'(x)\) or \({f}''(x)\). As differentiation is linear, so it can be written as a matrix while using linear algebra methods to solve it. As you know, FDM doesn’t give the exact discretization of the derivative but an approximation, like \({f}'_{i}={f}'(x_{i})+\epsilon _{i}\), notice that the error will decreasing along with the decreasing of the spacing of the grid, say, the tighter the grids (including \(t\) axis and \(x\) axis), the better approximation quality, but the worse simulation duration.

As you may refer to Tylor’s polynomial, we just provide differential operators including the first and the second derivative to obtain a manageable approximation error, they can be defined as:

\[{f}'{(x_{i})}\approx \frac{f(x_{i+1})-f(x_{i-1})}{2(x_{i}-x_{i-1})}\]
\[{f}''{(x_{i})}\approx \frac{f(x_{i+1})-2f(x_{i})+f(x_{i-1})}{(x_{i}-x_{i-1})^{2}}\]

As we can see from the equations that the value of the derivative at any given index \(i\) only determined by the adjacent three values of the function with the middle of the same index, thus the differential operator can be written as a tridiagonal matrix, like:

\[\begin{split}\begin{bmatrix} m_{0} & u_{0} & & & & & \\ l_{0} & m_{1} & u_{1} & & & & \\ & l_{1} & m_{2} & u_{2} & & & \\ & & ... & ... & ... & & \\ & & & l_{n-4} & m_{n-3} & u_{n-3} & \\ & & & & l_{n-3} & m_{n-2} & u_{n-2}\\ & & & & & l_{n-2} & m_{n-1} \end{bmatrix}\end{split}\]

To save storage resources and avoid redundant computations, we store the upper, main, and lower diagonals of the matrix in the \(dzMap\_\) of the pricing engine and compute it by Thomson algorithm while evolving back, instead of using a traditional matrix with a large number of zeros and many meaningless additions and multiplications in the pricing process.