The mechanics of the finite difference method matter when you compute an option price numerically on a grid, or check the value of an option that can be exercised before expiry.
Prerequisites
- Introduction to Stochastic Calculus (Ito's Lemma) AdvancedTo see first how the partial differential equation that the price satisfies is derived.
- The Black-Scholes Model PractitionerTo see first the conditions of the common example call and the formula that gives the price to compare against.
Key points
- The explicit method has a time step limit, while the implicit and Crank-Nicolson methods have none.
- For a call, halving the grid spacing cuts the Crank-Nicolson error to about a quarter.
- For an American option, each time step keeps the larger of the grid value and the exercise value.
- More risk factors multiply the grid points, so valuations with many underlying assets suit the Monte Carlo method.
Replacing a partial differential equation with differences on a grid
Under the Black-Scholes model, the option price satisfies a partial differential equation. The finite difference method places grid points over the range where you want prices, replaces the derivatives in the equation with differences between neighboring points, and finds the price at each point1.
The log-price equation
Let be the price of a European option, the price of the underlying asset, and the time to expiry. The interest rate and the volatility are constant, and the underlying pays no dividends. The equation is as follows2.
Because time is measured as the time to expiry , expiry is and today is . The payoff at expiry is the starting value (the initial condition), and the calculation advances by increasing until it reaches today's price. Changing the variable to gives an equation whose coefficients do not depend on 3. is the strike price.
Difference formulas and the order of calculation
Place a grid with spacing in the direction and in the direction. Let be the approximate price at the point and time . The three derivatives are replaced by the following differences4.
| Derivative | Difference | Type of difference |
|---|---|---|
| Forward difference | ||
| Central difference | ||
| Central difference |
The calculation runs in this order.
- Put the payoff at expiry on every point of the grid.
- Put the boundary values at the lower and upper ends (and reset them to the values for that time at each step forward).
- Advance one time step and find the value at each point.
- Only for an American option, replace each point's value with the larger of that value and the exercise value (covered in "Replacing values for American options").
- Repeat steps 3 and 4 from expiry to today, then read the value at the point that corresponds to the current price of the underlying as the price.
Boundary values and the grid range
The calculation covers only a finite range. So you place boundaries at the lower and upper ends of and fix the values there. For a European option, the boundary values follow from put-call parity.
A call approaches where the underlying price is high and approaches 0 where it is low. A put approaches where the price is low and 0 where it is high5. A condition that fixes the value at a boundary is called a Dirichlet boundary condition5.
| Type | Value at the lower end (small ) | Value at the upper end (large ) |
|---|---|---|
| Call | 0 | |
| European put | 0 |
The value at expiry () is the payoff: for a call option and for a put option6.
Three methods and the time step
The equation in difference form splits into three methods, according to how time is stepped. Collect the differences in the price direction at each point into one operator, written as follows.
With (the coefficient of the second derivative) and (the coefficient of the first derivative), the coefficients are , , and 7.
Three methods chosen by θ
The parameter chooses whether is evaluated at the earlier time , at the next time , or as the average of the two7.
is the explicit method, is the implicit method, and is the Crank-Nicolson method. The three differ as follows.
| Method | One time step | Time step limit | Error (for smooth initial values) | |
|---|---|---|---|---|
| Explicit | 0 | Computes the next values directly from three values at the earlier time | Has a limit (the guide from the diffusion term alone is ) | |
| Implicit | 1 | Solves a system of equations for the values at the next time | None (unconditionally stable) | |
| Crank-Nicolson | 1/2 | Also solves a system of equations | None (unconditionally stable in the norm) |
The explicit method's time step limit
The explicit method needs no system of equations. The next value is the three earlier values added with weights.
However, the explicit method for a diffusion equation becomes unstable when the time step exceeds 8. In the log-price equation the coefficient of the second derivative is , so the guide from the diffusion term alone is 9. Halving the grid spacing multiplies the number of time steps by 4 and the number of points by 2, so the computation takes about 8 times as long8.
For a diffusion equation without discounting and advection (first-derivative) terms, the three coefficients lie between 0 and 1 and sum to 1 under the stability condition. They can therefore be read as probabilities, and the explicit method is the same as a backward calculation on a trinomial tree10. The formula above has a discounting term, so its coefficients sum to .
The implicit and Crank-Nicolson methods
The implicit and Crank-Nicolson methods solve a tridiagonal system (nonzero coefficients only on the diagonal and its two neighbors) for the values at the next time. A tridiagonal system can be solved in time and memory proportional to the number of points11. The implicit method has no restriction on the time step and is unconditionally stable12.
For smooth initial values, the error of the Crank-Nicolson method is , which shrinks faster than the of other values of . For , the size of the solution (its norm) does not grow whatever the time step. So you can make the time step proportional to and keep both accuracy and efficiency13.
Deep diveHow to check the stability of the explicit and implicit methods
Split the solution of the heat equation into components of the form . Suppose each component is multiplied by in one time step. If , the component does not grow, and if exceeds 1, it keeps growing. With , for the explicit method () and for the implicit method () is as follows14.
can come arbitrarily close to 1, so the condition for to hold for every component is . This corresponds to . For the implicit method, is greater than 0 and at most 1 for any positive , so the time step has no restriction.
The common example call
Consider a hypothetical example in which a call option is valued with an underlying price of 100, a strike price of 100, one year to expiry, an interest rate of 1%, and a volatility of 20%. The Black-Scholes formula gives a price of 8.433315.
The grid covers from to ( from 36.79 to 271.83). Each end is 5 times the standard deviation of the log price at expiry, , away from the current point16.
One time step by hand
Follow one time step of the explicit method by hand. Take a grid spacing of and a time step of (one year divided into 40 steps). With and , the coefficients are as follows.
| Coefficient | Formula | Value |
|---|---|---|
| (weight of the point below, ) | 0.05125 | |
| (weight of the same point, ) | 0.89975 | |
| (weight of the point above, ) | 0.04875 |
All three weights are at least 0, and they sum to 0.99975 (). Advance the point (underlying price 110.5171) by one time step from the payoff at expiry.
| Point | Underlying price | Payoff at expiry | Weight | |
|---|---|---|---|---|
| One below | 0 | 100.0000 | 0.0000 | 0.05125 |
| Same point | 0.1 | 110.5171 | 10.5171 | 0.89975 |
| One above | 0.2 | 122.1403 | 22.1403 | 0.04875 |
The weighted sum is . This equals the underlying price 110.5171 minus the present value of the strike, 17.
Comparing the three methods
Next, spread the grid over the whole range and solve with the three methods. The grid spacing is (100 intervals), and the explicit method's guide from the diffusion term alone is , that is, 100 steps or more. The table shows the price at the point () and its difference from the Black-Scholes price.
| Number of time steps () | Explicit (difference) | Implicit (difference) | Crank-Nicolson (difference) |
|---|---|---|---|
| 40 (0.025) | Diverges (about ) | 8.3980 (−0.0353) | 8.4236 (−0.0097) |
| 200 (0.005) | 8.4285 (−0.0048) | 8.4184 (−0.0149) | 8.4235 (−0.0098) |
With a time step of 0.025, the explicit method is at 2.5 times the guide, and the calculation diverges. Cutting the time step to a fifth hardly changes the Crank-Nicolson difference. This difference comes mainly from the grid spacing 18. The implicit method's difference shrinks as the time step gets smaller.
With the same conditions and a grid spacing of 0.01 (200 intervals), the explicit method's guide becomes , that is, 400 steps or more. The explicit method with 300 steps diverges, and with 400 steps it gives a price of 8.4284 (difference −0.0049)19. The product of the number of points and the number of steps rises from to , 8 times as much.
Grid spacing and error
Now refine the grid with the Crank-Nicolson method. The time step is , and each time is halved, the time step is halved too.
| Grid spacing | Intervals | Time steps | Price | Difference from the Black-Scholes price |
|---|---|---|---|---|
| 0.1 | 20 | 20 | 8.1735 | −0.2598 |
| 0.05 | 40 | 40 | 8.3711 | −0.0622 |
| 0.025 | 80 | 80 | 8.4179 | −0.0154 |
| 0.0125 | 160 | 160 | 8.4295 | −0.0038 |
Each time is halved, the difference falls to about a quarter, which matches the error order in the table20. Other valuations need not show differences of the same size.
- Price at S = 100 (grid)
- 8.4235
- Black-Scholes price (European)
- 8.4333
- Difference (grid − Black-Scholes)
- −0.0098
- Largest absolute difference for S = 70 to 145
- 0.0099
- The difference row is the difference of the two displayed prices; this row is the largest unrounded value.
- Grid spacing h
- 0.02
- Time step Δτ
- 0.005
- Stability guide for the explicit method, h²/σ²
- 0.01
- Time step ÷ guide
- 0.50
- At most 1. The explicit method does not diverge (checked over this range).
- Grid points computed (intervals × time steps)
- 20,000
Simplifications
- The common example (price 100, strike 100, 1 year, rate 1%, volatility 20%, no dividends) is solved on a grid of the log price x = ln(S/K) from −1 to 1. S = 100 is the point x = 0.
- Boundary values: for the call, 0 at the lower end and S − Ke^(−rτ) at the upper end; for the European put, Ke^(−rτ) − S at the lower end and 0 at the upper end. For the American put, after each time step each point is replaced by the larger of its value and the exercise value, and the lower end is K − S.
- The stability guide Δτ ≤ h²/σ² looks at the diffusion term only. That the explicit method does not diverge at or below the guide was checked over this simulator's range (it is not a proof).
- The difference in the chart is from the European Black-Scholes price. It is larger near the strike, where the payoff has a kink.
This simulator uses simplified calculations for learning. It cannot be used for valuing actual transactions or managing their risk. (Terms of Use)
About this simulator
Change the method, the number of grid intervals, and the number of time steps, and see how far the price of the common example call is from the Black-Scholes price of 8.4333. The initial values are the Crank-Nicolson method, a grid spacing of (100 intervals), and 200 steps, the same conditions as the 200-step row of the table comparing the three methods. If you switch to the explicit method and reduce the number of time steps, the time step passes the stability guide and the screen shows an instability or divergence warning. If you choose the put and American, the price is higher because the option can be exercised before expiry. The difference on the screen is from the Black-Scholes (European) price, which is a different definition from the difference in the American table (from the European price on the same grid).
Replacing values for American options
An American option can also be exercised before expiry. Its value at any time is the larger of the value of holding it and the value of exercising it now. The American put equation is the Black-Scholes equation with an added condition that the value never falls below the exercise value 21. Unlike the European case, the boundary condition cannot be fixed in advance, and the problem becomes a free boundary problem, in which the exercise boundary is determined together with the solution22.
On a grid, after each time step you compare each point's value with the exercise value (the intrinsic value) and replace it with the larger one23. Another approach is the penalty method. It adds a term that can be ignored where the option is not exercised, so that the solution is almost equal to the exercise value where it is exercised24.
The next table shows a put with the same conditions as the common example call, solved with the Crank-Nicolson method and the replacement at each time step. The European price is the value solved on the same grid and time step without the replacement23.
| Grid spacing | Time steps | European put | American put | Difference (American − European, same grid) |
|---|---|---|---|---|
| 0.02 | 200 | 7.4284 | 7.5020 | 0.0736 |
| 0.01 | 400 | 7.4358 | 7.5104 | 0.0746 |
| 0.005 | 400 | 7.4377 | 7.5124 | 0.0747 |
The European put from the Black-Scholes formula is 7.4383. The American put is higher than the European put by the value of exercising before expiry. A 2,000-step tree of the binomial model gives an American put of 7.5127, and the finite difference prices approach this value as the grid is refined23.
Choosing between finite differences and Monte Carlo
An option with few risk factors that can be exercised before expiry is well suited to finite differences25. A valuation with many risk factors suits the Monte Carlo method26. Both the binomial model and finite differences are grid calculations that work backward from expiry.
The Monte Carlo method approximates a price by averaging over many random paths. How paths are built and how the error behaves are covered in Monte Carlo Simulation. The two methods differ as follows.
| Aspect | Finite differences | Monte Carlo |
|---|---|---|
| How the price is found | Solves the equation at grid points | Averages many random paths27 |
| As the number of factors (dimensions) grows | The number of grid points grows, and the cost of solving the system far exceeds the one-dimensional case25 | The statistical error shrinks as in the sample size , whatever the dimension26 |
| American options | Adds the condition that the value stays at or above the exercise value | One path makes it hard to decide the exercise point, so a modified method is needed28 |
| Greeks | Finds delta and gamma from differences of grid values29 | Uses a difference approximation that revalues with the input shifted slightly (bumping)30 |
The difference in dimension shows in the number of points. Consider a hypothetical example in which each axis has 100 points. With 1, 2, or 3 axes there are 100, 10,000, or 1,000,000 points, which is points for axes. Deterministic methods that do not use random numbers, grid calculations included, suffer the curse of dimensionality, in which the points grow exponentially as axes are added31.
The bumping difference approximation is a different use from the finite difference method that solves an equation on a grid. Ways to compute sensitivities quickly are covered in Adjoint Algorithmic Differentiation (AAD).
Assumptions and limits
The finite difference method solves an equation numerically. The price is determined by the model that the equation assumes. The Black-Scholes equation assumes that the interest rate and the volatility are constant over the period32. If this assumption fails, the solved price need not match the market price.
In the common example, the grid range hardly affects the price. Narrowing the range of from to (2.5 standard deviations from the current point) changes the Crank-Nicolson price with and 200 steps only from 8.4235 to 8.423416.
A payoff that is not smooth is also a source of error. The call payoff has a kink at the strike, so delta and gamma found by central differences of the grid values have larger errors than the price itself. The largest gamma error appears at the strike29. The Crank-Nicolson method is unconditionally stable only in the norm, and when the payoff is not smooth, the convergence of delta and gamma in the maximum error gets worse29.
As a remedy, there are methods in the family of Rannacher time stepping, which replaces the first few time steps with half steps of the implicit method. Replacing the first two steps with four half steps makes the maximum errors of the price, delta, and gamma shrink at second order33. The examples on this page use the Crank-Nicolson method without this replacement.
What this page does not cover
- The definition and interpretation of sensitivities are not covered on this page. They are covered in The Greeks.
- The difference between European and American exercise is not covered on this page. It is covered in Exercise Styles: European, American and Bermudan.
Notes
-
Page 543, "Finite-Difference Methods", of Yuh-Dauh Lyuu, "Finite-Difference Methods and Monte Carlo Simulation" (external site) (National Taiwan University lecture notes; the "Lyuu 2006 lecture notes"). ↩
-
Section 2 (page 2) of M. B. Giles, "Crank-Nicolson time-marching" (external site) (Oxford-Man Institute of Quantitative Finance; the "Giles Crank-Nicolson note"). The equation written with , and the form after changing to . ↩
-
The source uses . This page uses , which shifts the variable by and leaves the form of the derivatives unchanged. ↩
-
Pages 547–548 ("Explicit Methods", equations (59)–(61)) of the Lyuu 2006 lecture notes (external site), and Sections 1 and 2 (pages 1–2) of the Giles Crank-Nicolson note (external site). Section 2 of Giles uses the central difference for the first derivative. ↩
-
Section 1.5 (page 8), equations (1.36)–(1.43), of Michael Holst, "Computational Finance: Differential Equation Techniques [Lectures 8-10]" (external site) (the "Holst lecture notes"). The notes use the term "Dirichlet boundary conditions". ↩ ↩2
-
Section 2 (page 2) of the Giles Crank-Nicolson note (external site). The initial value of the call is . ↩
-
Section 1 (pages 1–2) of the Giles Crank-Nicolson note (external site), the scheme. The coefficients are the source's discretization operator divided by the time step. ↩ ↩2
-
Page 551, "Stability", of the Lyuu 2006 lecture notes (external site). The explicit method for the diffusion equation is unstable unless , and halving multiplies the computation time by 8. ↩ ↩2
-
The condition obtained by putting the coefficient of the second derivative in the log-price equation, , into the source's . ↩
-
Page 552, "Explicit Method and Trinomial Tree", of the Lyuu 2006 lecture notes (external site). Under the stability condition the three coefficients lie between 0 and 1 and sum to 1, so the explicit formula equals a backward calculation on a trinomial tree. The sum with a discounting term is calculated from the formula on this page. ↩
-
Pages 553–556, "Implicit Methods", of the Lyuu 2006 lecture notes (external site). A tridiagonal system can be solved in time and memory. ↩
-
Page 554, "Implicit Methods (continued)", of the Lyuu 2006 lecture notes (external site). The notes call the implicit formula "unconditionally stable". ↩
-
Section 1 (page 2) of the Giles Crank-Nicolson note (external site). Unconditional stability for , and the error orders ( for Crank-Nicolson, for other ). is on this page. ↩
-
Rutgers University lecture notes "Numerical Solution of PDEs" (external site) (page 65, "Example 1: explicit scheme for the heat equation", and page 68, "Example: implicit scheme for the heat equation"). The source's is the diffusion coefficient, which corresponds to on this page, and is the time step. ↩
-
The value 8.433319 from the Black-Scholes formula (, ), rounded at the fifth decimal place. ↩
-
A calculation for the conditions in the text (, 200 steps, Crank-Nicolson method). With the range of at the price is 8.4234, and with and it is 8.4235 (rounded at the fifth decimal place). The range of is 36.79 to 271.83 for and 60.65 to 164.87 for . ↩ ↩2
-
The weights and prices were calculated from the formulas in the text. and . ↩
-
A calculation for the conditions in the text. The price is the value at the grid point (). The difference is the price rounded at the fifth decimal place minus 8.4333. The explicit price with 40 steps was . ↩
-
A calculation for the conditions in the text (explicit method, ). The price with 300 steps is , and with 400 steps it is 8.428365. The difference is the price rounded at the fifth decimal place minus 8.4333. ↩
-
A calculation for the conditions in the text. The difference is the price rounded at the fifth decimal place minus 8.4333. The ratios of the absolute differences, from the previous row, are 4.2, 4.0, and 4.1. ↩
-
Page 559 of the Lyuu 2006 lecture notes (external site). The condition ( is the strike price ). The notes give no procedure for the replacement on a grid. ↩
-
Section 2.4, "American Options as a Free Boundary Problem" (page 17), and the opening (page 9) of the Holst lecture notes (external site). American options become a free boundary problem. The section on how to handle it is unfinished. ↩
-
A calculation for the conditions in the text (put, Crank-Nicolson method). After each time step the value is replaced by , with the lower end set to and the upper end to 0. The binomial tree is a CRR tree (2,000 steps). ↩ ↩2 ↩3
-
Section 4 (page 4) of the Giles Crank-Nicolson note (external site). A nonlinear penalty term approximates American options. It can be ignored where the option is not exercised and makes the solution almost equal to the exercise value elsewhere. ↩
-
Section 4 (page 4) of the Giles Crank-Nicolson note (external site). In higher dimensions, solving the system of equations directly costs much more. ↩ ↩2
-
Pages 566–567 ("Accuracy and Number of Replications") of the Lyuu 2006 lecture notes (external site). The statistical error of a sample average decreases at the rate regardless of the dimension , while ordinary numerical integration suffers the curse of dimensionality. The notes say that the Monte Carlo method is more efficient than other procedures for securities that depend on more than one asset. ↩ ↩2
-
Pages 562–564 ("Monte Carlo Simulation", "The Big Idea") of the Lyuu 2006 lecture notes (external site). The notes explain the Monte Carlo method as estimating an expected value by a sample average. ↩
-
Page 570 of the Lyuu 2006 lecture notes (external site). The standard Monte Carlo method is not suited to early exercise because the exercise point is hard to determine from a single path. ↩
-
Section 2 (pages 2–3) of the Giles Crank-Nicolson note (external site). For a European call, delta and gamma computed by central differences deviate more than the price, and the largest gamma error appears at the strike ( in the source). ↩ ↩2 ↩3
-
Pages 571–572 ("Delta and Common Random Numbers") of the Lyuu 2006 lecture notes (external site). Computing delta from two separate simulations has a large variance and is not recommended, and using the same random numbers is better. ↩
-
Section 1, Introduction (page 4 of the PDF), of Paweł Przybyłowicz, "Monte Carlo methods and stochastic simulations: from integration to approximation of SDEs" (external site) (arXiv:2208.05531). Deterministic algorithms are affected by the curse of dimensionality. ↩
-
Section 1.3 (page 5) of the Holst lecture notes (external site). The notes list, among the assumptions of the Black-Scholes-Merton market model, that the interest rate and the volatility are constant on , calling this "an idealization, but required by the model". ↩
-
Section 3 (pages 3–4) of the Giles Crank-Nicolson note (external site). Replacing the first two Crank-Nicolson steps with four half steps of the implicit method gives second-order accuracy in the maximum error of the price, delta, and gamma for puts, calls, and digitals. ↩