# Improve Finite Difference Scheme

I understand how to derive and implement standard finite difference schemes. I wonder how to improve such a standard FD scheme? For example, when solving the standard Black-Scholes equation, the following steps are often suggested

• The transformation $$x_t=\ln(S_t)$$ turns the Black-Scholes PDE into a PDE with constant coefficients
• Choose the step sizes $$\Delta S$$ and $$\Delta t$$ such that $$\sqrt{\Delta t} \sim\Delta S$$
• Central difference ($$O(\Delta S^2)$$) are better for spatial derivatives than backward/forward finite difference ($$O(\Delta S)$$)

What further tips can you provide? What other improvements do you know which help with accuracy, speed and stability?

Do you use backward/forward/central difference for the time derivative? Do you recommend explicit, implicit, Crank Nicolson? How can you quickly verify whether your final solution is indeed correct and solves the PDE?

# Don't solve the Black-Scholes PDE, solve the heat equation

One of the major results of mathematical finance is showing that the Black-Scholes PDE can be mapped to the heat equation. The heat equation is both mathematically nicer to handle, analyse, and computationally has much better solvers than other generic PDE solvers. Don't solve the Black-Scholes PDE, solve the heat equation! If this ends up with slightly more awkward boundary condition(s), then the benefits will still likely far out-weight the losses.

# There's a lot to learn

What further tips can you provide? What other improvements do you know which help with accuracy, speed and stability?

There are far too many to list, and there is a trade off between creating the world's best solver and the time taken to program something up. If you spend 6 months building a production level solver optimised for one type of boundary condition/problem which runs in 1s, when a simple implementation knocked up in a day could have ran in 1 hour or overnight, and both are used only once, then the latter is more favourable.

Learning how to make these solvers better, more stable, more accurate, faster, etc. is very complicated, and takes degrees to learn/understand all the tricks (several are still being developed). Some nice references include:

and the standard textbook is:

# An easy trick

One of the best tricks I learnt/saw was that you already know you should choose a small time step (or spatial discretisation) such that $$\mathcal{O}(\Delta t) \sim \mathcal{O}(\Delta x^2)$$, which if I recall makes the scheme have accuracy $$\mathcal{O}(\Delta x^2)$$. However, I think it is for a forward time Euler and central spatial difference scheme that if you pick $$\Delta t = \frac{\Delta x^2}{4}$$ then the spatial and temporal errors exactly cancel to leading order, and hence you get an accuracy $$\mathcal{O}(\Delta x^4)$$. However, I don't have my textbooks with me so I would have to double check the coefficient and accuracies I quoted. Nonetheless, for a clever choice of this ratio you get a much more accurate scheme at no extra cost, which I think is a very useful trick.

• Thank you very much for that amazing answer! The trick $\Delta t=\frac{\Delta x^2}{4}$ is very useful indeed. It only works for the heat equation and not the discretised BS equation with constant coefficient? And it requires a forward difference to approximate the time derivative? Do you have any tips for two dimensional FD schemes? Like in Heston or such where there are two state variables. I know that Monte Carlo becomes better for many factors but two space dimensions plus time dimension seems still doable with FD. Any particular hints to improve such a higher order approximation?
– Alex
Jun 26, 2020 at 18:19
• @Alex I need to repeat, the BS equation Is the heat equation (under an appropriate change of variables), so never try to solve BS, but instead solve the heat equation and transform the solution back to the BS form after! I think the trick I mentioned assumes an explicit forward difference. Alternatives include implicit schemes or Crank Nicolson, but in such circumstances accuracy is only one factor, whereas convergence and stability are other factors to consider. For a 2D grid with a square lattice perhaps the same trick can be used. I recommend most reading the lecture notes I linked. Jun 26, 2020 at 18:43
• Thank you for the references. I started reading with the Oxford notes and it is very well written. Thank you very much! I understand that the BS equation = heat equation under further substitutions. The log-transformation gives constant coefficients, a further substitution eliminates the first derivative, $\left(r-\delta-\frac{1}{2}\sigma^2\right)\frac{\partial V}{\partial x}$ and the value itself, $-rV$. A final time change gives initial values. Is a Crank Nicolson approach in general better than a plain implicit (backwards) scheme? Because we have to solve an equation system anyway?
– Alex
Jun 27, 2020 at 9:49
• @Alex I think Crank Nicolson has better stability, but can't recall it's accuracy properties. Been a while since I did any finite difference analysis. Easy of programming shouldn't not be ignored as well, as in reality this is often the most dominant factor when persuading people to choose one approach over any other. Jun 27, 2020 at 11:56

Some of the standard tricks are mentioned in this paper, Finite Difference Schemes with Exact Recovery of Vanilla Option Prices

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3530561

which also shows how to set up the finite difference scheme so that all vanillas with strikes and expiries on the grid are matched exactly.