Numerical approximation of Black-Scholes-Merton PDE using Crank-Nicolson with Rannacher smoothing and TR-BDF2 for European and Barrier options.
This problem deals with spurious oscillations for payoff functions with discontinuities for numerical approximations of the Black-Scholes-Merton PDE (below) for European and barrier options. The point of this mini-app is to show various methods of handling these discontinuities via two second-order accurate finite differencing methods. This notebook will highlight how Rannacher time-stepping (smoothing) handles these oscillations for the Crank-Nicolson (CN) discretization by applying the
I will define
For
Crank-Nicolson is second-order accurate but has spurious oscillations due to its
The last paragraph of page 107 in this article explains why I used quarter steps for ONE iteration of Rannacher smoothing.
The following system of equations solves the Crank-Nicolson discretization:
where
and
It appears as two parts in the implementation, but
where
Following the same form (
where
Also,
This method was originally implemented for Black-Scholes in this paper. This was part of Fabien Le Floc’h's Ph.D. dissertation.
The trapezoidal steps are helper values for the BDF2 method and are ghosts on the final grid. I have satisfied all of the main method requirements, which include preprocessing half the grid with Crank-Nicolson, assembling the second-order backward method with the preprocessed grid, and implementing the boundary conditions for the TR and BDF2 steps.
There is an issue at the underlying price cross sections at
I do not believe in "close enough," so I will instead say that the TR-BDF2 implementation is accurate up to (exclusive) the first and last space iterations. This imputation showed a negligible difference during error analysis, but there are some trivial workarounds to these oscillations.
One may simply increase the upper bound of the grid and add more iterations if he desires a more robust estimate (such as if the underlying is predicted to increase many times its original price). One could also make the grid finer to increase the method's accuracy. Hence, the imputation yields a practically infinitesimal difference (if the underlying likely will not increase more than twice its current price before
To the readers who may have found the issue causing these oscillations, please let me know, and I will fix it.
I will defer a detailed explanation of TR-BDF2 to the article at the top of this section and will provide a basic explanation instead. TR-BDF2 uses a second-order accurate, fully implicit Runge Kutta timestepping technique for which ghost/intermediate time steps are used to quell accuracy loss using variable timesteps in the standard BDF2 method. Given
The mentioned "intermediate grid" is the sequence of terms with
Crank-Nicolson is used to solve for the price at these timesteps before using them for BDF2. One may find the explanation of the Crank-Nicolson discretization in the CN section.
The discretization of BDF2 yields a system of equations of the form
Modifications to
$u[0] = 0$ $u[-1] = -\frac{(r - q)S[-1]}{2\Delta S}$ $v[0] = \frac{1}{2}\left(\frac{(r - q)S[0]}{\Delta S} + r\right)$ $v[-1] = \frac{1}{2}\left(r - \frac{(r - q)S[-1]}{\Delta S}\right)$ $w[0] = \frac{(r - q)S[0]}{2\Delta S}$ $w[-1] = 0$
This yields the solution on the standard
CN with Rannacher smoothing is more accurate than CN because it removes the oscillations from CN. This is because Backward Euler is
TR-BDF2 is also
The results seem to highlight the goal of my mini-app as the oscillations in the CN implementation became mild/negligible after Rannacher smoothing. The TR-BDF2 method seems to be without oscillations as it is more stable than the plain Crank-Nicolson scheme.
In creating this mini-app, I learned how to apply discretization schemes to second-order linear partial differential equations and how various dynamics of the Black-Scholes-Merton equation affect the payoff functions. I have also become much more familiar with novel finite differencing techniques for pricing said equation through literature analysis. I also learned the lesson of patience when implementing techniques described in academic papers.
Among the issues that could be improved, the oscillations at the edges of the space grid could be smoothed out in the TR-BDF2 method. TR-BDF2 is a rather uncommon method for pricing options so it was difficult to determine whether the oscillations were caused by an implementation issue or whether they were an artifact of the algorithm. At the time of this writing, there is no other open-source TR-BDF2 implementation that I am aware of. I would also like to extend these methods to different, more exotic, option types to test their accuracy in a variety of contexts.
Future directions for this project include but are not limited to: fixing TR-BDF2 to remove the barrier oscillations, implementing other exotic options to determine which scenarios each method works best in, adding varying risk-free rate and volatility dynamics, and implementing higher-order schemes to achieve greater accuracy.