Quants who implement valuation models use the finite difference method when they need an option price on a grid, and risk managers use it when they check the calculated prices. It also comes up in the valuation of options that can be exercised before expiry.
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 of prices of interest, replaces the derivatives in the equation with differences between neighboring points, and solves for the price at each point numerically1. The derivation of the equation is covered in Introduction to Stochastic Calculus (Ito's Lemma).
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 the following equation, whose coefficients do not depend on 3. is the strike price.
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 order of the whole calculation is as follows. The boundary values in step 2 are explained in the section "Boundary conditions fix the values outside the grid", and the comparison with the exercise value in step 4 in the section "An American option never falls below its exercise value".
- 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.
- In the calculation on this page, only for an American option, replace each point's value with the larger of that value and the exercise value (this is not a procedure given in the sources).
- 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.
Three solution methods differ in how time is stepped
The symbols , , , , and below are used only on this page. They mean something different from and the mean reversion speed in the Hull-White model, and from the drift of a stochastic process.
Collect the differences in the price direction at each point into one operation, written as follows.
With (the coefficient of the second derivative) and (the coefficient of the first derivative), the coefficients are , , and . The parameter chooses whether is evaluated at the earlier time , at the next time , or as an average of the two5.
is the explicit method, is the implicit method, and is the Crank-Nicolson method5. 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 | Unstable when exceeds (a guide that looks at the diffusion term only) | |
| 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 (the norm of the solution does not grow) |
The explicit method avoids solving a system of equations. However, for a diffusion equation it becomes unstable when the time step exceeds 6. In the log-price form of the Black-Scholes equation, the coefficient of the second derivative is , so a guide that looks at the diffusion term only is 7. Halving the grid spacing multiplies the number of time steps by 4 and the number of points by 2, so the computation time grows about 8 times6.
The implicit and Crank-Nicolson methods solve a tridiagonal system of equations for the values at the next time. A tridiagonal system can be solved in time and memory proportional to the number of points8. The implicit method has no time step limit and is unconditionally stable9. For smooth initial values, the error of the Crank-Nicolson method is , which shrinks faster than the of the other values of . For , the norm of the solution does not grow whatever the time step (unconditional stability in the norm), so the time step can be taken in proportion to and still give both accuracy and efficiency10.
The explicit formula expresses the value at the next time as a weighted sum of three values at the earlier time.
For a diffusion equation without discounting or advection, 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 takes the same form as a calculation walking a trinomial tree backward from expiry11. In the formula above, the discounting term makes the coefficients sum to 1 minus , which is the probabilities multiplied by one period of discounting.
Deep diveHow to check the stability of the explicit and implicit methods
Split the solution of the heat equation into components of the wave form . Suppose each component is multiplied by in one time step. If , the component does not grow, and if , it keeps growing. With , is as follows for the explicit method () and the implicit method ()12.
Because can come arbitrarily close to 1, 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 there is no limit on the time step.
Boundary conditions fix the values outside the grid
Only a finite range can be computed, so boundaries are placed at the lower and upper ends of and the values there are fixed. 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 at the low end and 0 at the high end13. A condition that fixes the value at the boundary in this way is called a Dirichlet boundary condition13.
| 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 option14. In the common example (next section), the range of is to . In terms of , that is 36.79 to 271.83, which is 5 times the standard deviation of the log price to expiry, . In the table below, the Crank-Nicolson price with and 200 time steps stays at 8.4235 even when this range is widened to . Narrowing it to gives 8.4234, a change of 1 in the fourth decimal place15.
Solving the common example call with the three methods
Consider a fictional example of a call option with underlying price 100, strike price 100, one year to expiry, interest rate 1%, and volatility 20%. The price from the Black-Scholes formula is 8.433316.
First, follow one step of the explicit method by hand. Let the grid spacing be and the time step (the year divided into 40 steps). Then and . The coefficients of the formula take the following values.
| 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 0 or greater, and they sum to 0.99975 (). At the point (underlying price 110.5171), advance 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 . At this point, the price 0.025 years before expiry equals the underlying price of 110.5171 minus the present value of the strike, , which is 10.542117.
Next, spread the grid over the whole range and solve with the three methods. The table shows the price at the point (), with the difference from the Black-Scholes price. The grid spacing is (100 intervals). The guide for the explicit method, looking at the diffusion term only, is , that is, 100 time steps or more.
| 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 time step is 2.5 times the guide limit, and the explicit calculation diverges. Cutting the time step to one fifth hardly changes the Crank-Nicolson difference, so this difference comes mainly from the grid spacing 18. For the implicit method, the difference shrinks as the time step gets smaller.
Next, refine the grid with the Crank-Nicolson method. The time step is , so halving also halves the time step.
| 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 shrinks to about a quarter, which matches the error order in the table above19. Other valuations will not necessarily 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. (Disclaimer)
About this simulator
Move the method, the number of grid intervals and the number of time steps to 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 with grid spacing (100 intervals) and 200 steps: the price is 8.4235 and the difference is −0.0098. Cutting the steps to 40 barely changes it, to 8.4236, so this difference comes mainly from the grid spacing. With the implicit method, 40 steps give 8.3980 (difference −0.0353), and the difference shrinks as the time step is made smaller. With the explicit method and 40 steps, the time step is 2.5 times the stability guide and the calculation diverges; with 100 steps or more it does not. Doubling both the intervals and the time steps with the Crank-Nicolson method cuts the difference to about a quarter. Choosing the put and the American style raises the price by the value of exercising before expiry.
An American option never falls below its exercise value
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 now. The equation for an American put adds to the Black-Scholes equation the condition that the value does not fall below the exercise value 20. Unlike the European case, the boundary conditions cannot be fixed from the start, and the problem becomes a free boundary problem21.
The sources give no procedure for imposing this on a grid. In the calculation on this page, after solving each time step, the value at each point is replaced by the larger of that value and the exercise value (intrinsic value)22. Another approach is the penalty method. It adds a nonlinear term that can be ignored where the option is not exercised and that makes the solution almost equal to the exercise value elsewhere, and solves with Newton's method (a way to solve a nonlinear equation by repeatedly solving linear ones)23.
The next table shows the put in the common example, 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 steps without the replacement. The time steps are 22.
| Grid spacing | Time steps | European put | American put | Difference |
|---|---|---|---|---|
| 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 being able to exercise before expiry. The American put valued on a binomial tree (2,000 steps) is 7.5127, and the finite difference price approaches this value as the grid is refined22.
Choosing between binomial models, the Monte Carlo method, and finite differences
Valuations with few risk factors and early exercise, such as American options, are handled readily by finite differences, while valuations with many underlying assets are described as more efficient with the Monte Carlo method. Both the binomial model and the finite difference method are grid calculations that find the price by working backward from expiry. The binomial model uses a binomial tree. The finite difference method, as seen in the section on stepping through time, can take a form identical to walking a trinomial tree backward when the explicit method is used. The Monte Carlo method approximates the price by the average over many paths built from random numbers. The details are covered in Monte Carlo Simulation. The differences from the finite difference method are as follows.
| Aspect | Finite difference method | Monte Carlo method |
|---|---|---|
| How the price is found | Solves the equation at grid points | Takes the average over many paths built from random numbers24 |
| As the number of risk factors (dimensions) grows | The number of grid points grows, and the cost of solving the system of equations becomes much larger than in one dimension25 | The statistical error shrinks as in the number of samples , regardless of dimension26 |
| American options | Adds the condition that the value does not fall below the exercise value (in the calculation on this page, compared at each time step) | Early exercise points are hard to determine from a single path, so a modified method is needed27 |
| Greeks | Delta and gamma are computed from differences of the grid values28 | Values are evaluated twice with a small shift, using the same random numbers to reduce variance29 |
The difference in dimension shows in the number of points. Consider a fictional example of putting 100 points on each axis. One, two, and three axes give 100, 10,000, and 1,000,000 points, and axes give points. The curse of dimensionality also affects deterministic methods that use grids30.
Assumptions and limits
The finite difference method is a way to solve 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 whole period31. If this assumption fails, the solved price does not necessarily match the market price.
The numerical error depends on the choice of grid and time step. A payoff that is not smooth is another source of error. The payoff of a call has a kink at the strike, so delta and gamma computed by central differences of the grid values have larger errors than the price itself. The largest gamma error appears at the strike point28. The Crank-Nicolson method is unconditionally stable only in the norm, and when the payoff is not smooth, delta and gamma converge poorly in terms of the maximum error28.
One remedy is Rannacher time-marching, which replaces the first few time steps with half steps of the implicit method. Replacing the first two Crank-Nicolson steps with four half steps of the implicit method has been shown to make the maximum error (the largest error over all grid points, the maximum norm) of the price, delta, and gamma shrink at second order for puts, calls, and digitals32. The calculations in the text use the Crank-Nicolson method without this replacement.
When there are two or more risk factors and the equation contains mixed derivatives (cross derivatives) between different factors, keeping second-order accuracy requires the Craig-Sneyd treatment in how the cross derivative terms are differenced25.
Notes
-
Page 543, "Finite-Difference Methods", of Yuh-Dauh Lyuu's lecture notes (National Taiwan University, May 17, 2006). The notes approximate the function at grid points and solve the equation numerically by substituting differences for derivatives. ↩
-
Section 2 (page 2) of M. B. Giles, "Crank-Nicolson time-marching" (Oxford-Man Institute of Quantitative Finance). The source writes the equation with the time to expiry and the form after changing to . It has no dividend term, and the text includes none either. ↩
-
The source uses . This page uses , which shifts the variable by and leaves the form of the derivatives unchanged. ↩
-
The forward difference in time and the central differences in space are in Lyuu's notes, pages 547–548 ("Explicit Methods", equations (59)–(61)), and in Sections 1 and 2 of Giles (pages 1–2). Section 2 of Giles uses the central difference for the first derivative. ↩
-
Section 1 of Giles (pages 1–2). The source defines the scheme, with as the explicit method, as the implicit method, and as the Crank-Nicolson method. The coefficients of the operator on this page are the discretization operator of Section 2 (page 2), divided by the time step. ↩ ↩2
-
Page 551, "Stability", of Lyuu's notes. 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 . For in the common example, the condition is . The calculation with 40 steps () diverged, and those with 100 steps or more did not. ↩
-
Pages 553–556, "Implicit Methods", of Lyuu's notes. A tridiagonal system of equations can be solved in time and memory. ↩
-
Page 554, "Implicit Methods (continued)", of the same notes. The source calls the implicit formula "unconditionally stable". ↩
-
Section 1 of Giles (page 2). The source shows unconditional stability in the norm for and the error orders ( for the Crank-Nicolson method, for other ). It says that can be chosen in proportion to . is on this page. ↩
-
Page 552, "Explicit Method and Trinomial Tree", of Lyuu's notes. Under the stability condition the three coefficients lie between 0 and 1 and sum to 1, so the explicit formula is the same as a backward calculation on a trinomial tree. The sum with a discounting term is calculated from the formula on this page. ↩
-
Rutgers University lecture notes "Numerical Solution of PDEs" (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. ↩
-
Section 1.5 (page 8) of Holst's lecture notes "Computational Finance" (UC San Diego, 2015). The source sets the call's lower end and the put's upper end to 0 and calls the limits at both ends Dirichlet boundary conditions. ↩ ↩2
-
Section 2 of Giles (page 2). The source sets the initial value of the European call at expiry as . The text sets the put's on the same reasoning. ↩
-
A calculation for the conditions in the text (, 200 time 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. ↩
-
The value 8.433319 from the Black-Scholes formula (, ), rounded at the fifth decimal place. ↩
-
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 the Black-Scholes price 8.4333. The explicit price with 40 steps was . ↩
-
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, "Numerically Solving the Black-Scholes PDE", of Lyuu's notes. The source gives the American put with the value at expiry and, before expiry, the condition . is the strike price on this page, and the source has 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 Holst's lecture notes. 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). For the American put, 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) with a price of 7.5127, and the Black-Scholes put is 7.4383. ↩ ↩2 ↩3
-
Section 4 of Giles (page 4). 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. The solution method is Newton iteration. ↩
-
Pages 562–564 ("Monte Carlo Simulation", "The Big Idea") of Lyuu's notes. The notes explain the Monte Carlo method as estimating an expected value by a sample average. ↩
-
Section 4 of Giles (page 4). In higher dimensions solving the system of equations directly costs much more, and approximate factorization by ADI and iterative solvers such as BiCGStab with ILU preconditioning are used. The source states that the cross derivative terms need the Craig-Sneyd treatment to keep second-order accuracy. ↩ ↩2
-
Pages 566–567 ("Accuracy and Number of Replications") of Lyuu's notes. 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 several assets. ↩
-
Page 570, "Pricing American Options", of Lyuu's notes. The standard Monte Carlo method is not suited to American options with early exercise because the exercise point is hard to determine from a single path. A modification by Longstaff and Schwartz (2001) can value them with small bias. ↩
-
Section 2 of Giles (pages 2–3). 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 Lyuu's notes. 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" (arXiv:2208.05531). Deterministic algorithms are affected by the curse of dimensionality. ↩
-
Section 1.3 of Holst's lecture notes (page 5). The source lists, 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 of Giles (pages 3–4). The source describes Rannacher's method (replacing the first time step with two half steps of the implicit method) and the method shown by Giles and Carter of replacing the first two Crank-Nicolson steps with four half steps. The latter gives second-order accuracy in the maximum norm for the price, delta, and gamma of puts, calls, and digitals. ↩