Skip to article frontmatterSkip to article content

Black–Scholes equation

Suppose that at time t=0t=0 you buy a stock whose share price is S(t)S(t). At a later time, if S(t)>S(0)S(t)>S(0), you can sell the stock and make money. But if S(t)<S(0)S(t)<S(0), you stand to lose money—potentially, your entire investment. You may prefer to mitigate this risk.

One way to do so is to buy a call option instead of the stock. This is a contract with a fixed strike time TT and strike price KK that gives you the right to buy the stock from the contract issuer at cost KK at time TT.[1]

Suppose S(T)>KS(T)>K. Then you could buy the stock at price KK and instantly resell it at price S(T)S(T), so you make profit S(T)KS(T)-K. On the other hand, if S(T)KS(T)\le K, there is no advantage to exercising the option because the stock is less valuable than the guaranteed purchase price. However, you have lost only what you paid for the option. These observations are summarized by the payoff function

H(S)=max{SK,0}=(SK)+. H(S) = \max\{ S-K, 0 \} = (S-K)_+.

What is the fair market value of the option contract? This question is answered to close approximation by the famous Black–Scholes equation,

vt+12σ2S22vS2+rSvSrv=0, \frac{\partial v}{\partial t} + \frac{1}{2} \sigma^2 S^2 \frac{\partial^2 v}{\partial S^2} + rS \frac{\partial v}{\partial S} - r v = 0,

where rr is the risk-free interest rate (i.e., what you could earn with a very safe investment), and σ is the volatility of the stock (essentially, the standard deviation in the rate of return for the stock). In the Black–Scholes model, both rr and σ are assumed to be known and constant.

The value v(S,t)v(S,t) of the option depends on the time tt and on the stock price SS, which may be varied independently. At the strike time, the payoff condition v(S,T)=H(S)v(S,T)=H(S) is imposed, and the goal is to solve the equation backward in time to find v(S,0)v(S,0). Equation (11.1.2) is a time-dependent partial differential equation, or evolutionary PDE.

11.1.1Initial and boundary conditions

Equation (11.1.2) has independent variables tt and SS. Because of the first-order derivative in time, we require an initial value for the dependent variable.

In order to follow the usual convention of having time flow forward instead of backward, we define a new variable η=Tt\eta=T-t, in which case (11.1.2) becomes

vη+12σ2S2vSS+rSvSrv=0, - v_\eta + \frac{1}{2} \sigma^2 S^2 v_{SS} + rS v_S - r v = 0,

now defined for 0ηT0\le \eta \le T. Here we have adopted the common notation of using subscripts for partial derivatives. In the new time variable we have the initial condition

v(S,0)=H(S), v(S,0) = H(S),

and the goal is to find v(S,η)v(S,\eta) for η>0\eta>0. Henceforth we will simply rename the η variable as tt again, with the understanding that it runs in the opposite direction to actual time in this application.

We have not yet specified the domain of the independent variable SS. Stock prices cannot be negative, so S=0S= 0 is the left end. In principle, SS is not bounded from above. There are different ways to handle that fact computationally, but here we choose to truncate the domain at some positive value SmaxS_\text{max}.

Because (11.1.2) has two derivatives in SS, we also require a condition at each end of its domain. At S=0S=0, both the stock and the option are worthless, so we impose v=0v=0 there. In light of the payoff function HH, initially the value vv has slope equal to 1 at S=SmaxS=S_\text{max}, and we choose to enforce that condition for all time. We summarize the boundary conditions as

v(0,t)=0,vS(Smax,t)=1.\begin{split} v(0,t) &= 0, \\ \frac{\partial v}{\partial S}(S_\text{max},t) &= 1. \end{split}

At the left we have a homogeneous Dirichlet condition, and at the right we have a nonhomogeneous Neumann condition.

The complete problem consists of (11.1.3), (11.1.4), and (11.1.5). An evolutionary PDE has both initial and boundary conditions and is sometimes called an initial-boundary-value problem or IBVP as a result. Solving it numerically requires aspects of methods for both IVPs and BVPs.

11.1.2The heat equation

The Black–Scholes equation can be transformed by a change of variables into a simpler canonical PDE.[2]

The heat equation is the archetype differential equation for the class known as parabolic PDEs. A diffusive process is one in which velocity is proportional to the gradient of the solution. Thus, rapid changes in the solution flatten out quickly.

In certain cases there are explicit formulas describing the solution of (11.1.6) and hence (11.1.2). These provide a lot of insight and can lead to practical solutions. But the exact solutions are fragile in the sense that minor changes to the model can make them impractical or invalid. By contrast, numerical methods are often more robust to such changes.

11.1.3A naive numerical solution

Let’s return to the Black–Scholes equation (11.1.3), rewritten here as

vt=12σ2S2vSS+rSvSrv, v_t = \frac{1}{2} \sigma^2 S^2 v_{SS} + rS v_S - r v,

subject to the initial condition (11.1.4) and the boundary conditions (11.1.5). We now try to solve it numerically, without any transformation tricks or other insight. Define

xi=ih,h=Smaxm,i=0,,m,tj=jτ,τ=Tn,j=0,,n.\begin{split} x_i &= ih, \quad h=\frac{S_\text{max}}{m}, \qquad i = 0,\ldots,m, \\ t_j &= j \tau, \quad \tau = \frac{T}{n}, \qquad j = 0,\ldots,n. \end{split}

Observe that we have used the more conventional xx and tt in place of SS and η. The result is a grid function V\mathbf{V} whose entries are Vijv(xi,tj)V_{ij} \approx v(x_i,t_j). By the initial condition (11.1.4), we set Vi,0=H(xi)V_{i,0} = H(x_i) for all ii.

For the moment, let us pretend that ii is unbounded in both directions. Replacing the derivatives in (11.1.9) with some simple finite-difference formulas, we get

Vi,j+1Vi,jτ=+σ2xi22Vi+1,j2Vi,j+Vi1,jh2+rxiVi+1,jVi1,j2hrVi,j. \frac{V_{i,j+1} - V_{i,j}}{\tau} = + \frac{\sigma^2 x_i^2}{2} \frac{V_{i+1,j}-2V_{i,j}+V_{i-1,j}}{h^2} + r x_i \frac{V_{i+1,j}- V_{i-1,j}}{2h} - rV_{i,j}.

We can rearrange (11.1.11) into

Vi,j+1=Vi,j+λσ2xi22(Vi+1,j2Vi,j+Vi1,j)+rxiμ2(Vi+1,jVi1,j)rτVi,j, V_{i,j+1} = V_{i,j} + \frac{\lambda \sigma^2 x_i^2}{2} (V_{i+1,j}-2V_{i,j}+V_{i-1,j}) + \frac{r x_i \mu}{2} (V_{i+1,j}- V_{i-1,j}) - r \tau V_{i,j},

where

λ=τh2,μ=τh.\lambda = \frac{\tau}{h^2}, \qquad \mu = \frac{\tau}{h}.

If we put j=0j=0 into (11.1.12), then everything on the right-hand side is known for each value of ii, and thus we can get values for Vi,1V_{i,1}. We can then use j=1j=1 and get all of Vi,2V_{i,2}, and so on.

Now we take the boundaries on xx into account. The value V0,j+1V_{0,j+1} is zero, so we don’t even need to compute the solution using (11.1.12) at i=0i=0. At i=mi=m, or xi=Smaxx_i=S_\text{max}, things are trickier. We don’t know Vm,j+1V_{m,j+1} explicitly and would like to solve for it, yet formula (11.1.12) refers to the fictitious value Vm+1,jV_{m+1,j} when i=mi=m. This is where the Neumann condition must be applied. If the value Vm+1,jV_{m+1,j} did exist, then we could discretize that condition as

Vm+1,jVm1,j2h=1. \frac{V_{m+1,j}-V_{m-1,j}}{2h} = 1.

We can therefore solve (11.1.14) for the fictitious Vm+1,jV_{m+1,j} and use it where called for in the right-hand side of (11.1.12).

Everything in Demo 11.1.2 seems to go smoothly. However, trouble lurks just around the corner.

The explosive growth of error in Demo 11.1.3 suggests that there is instability at work. Understanding the source of that instability comes later in this chapter. First, though, we consider a general and robust strategy for solving evolutionary PDEs.

11.1.4Exercises

  1. ✍ Show that u(x,t)=e4π2tcos(2πx)u(x,t) = e^{-4 \pi^2 t} \cos (2 \pi x) is a solution to the IBVP

    PDE:ut=2ux2,0<x<1,  t>0,BC:ux(0,t)=ux(1,t)=0,t>0,IC:u(x,0)=cos(2πx),0x1.\begin{align*} \text{PDE:} \quad & \frac{\partial u}{\partial t} = \frac{\partial^2 u}{\partial x^2},\quad 0<x<1,\; t > 0, \\ \text{BC:} \quad & \frac{\partial u}{\partial x}(0,t) = \frac{\partial u}{\partial x}(1,t) = 0,\quad t > 0, \\ \text{IC:} \quad & u(x,0) = \cos (2 \pi x),\quad 0 \le x \le 1. \end{align*}
  2. ✍ Show that u(x,t)=t1/2exp(x2/4t)u(x,t) = t^{-1/2} \exp(-x^2/4t) solves the heat equation (11.1.6) at any value of t>0t>0.

  3. ✍ Equation (11.1.11) results from applying finite differences to the derivatives in (11.1.9), including a forward difference for the term vtv_t.

    (a) Write out the method that results if a backward difference is used for vtv_t instead.

    (b) Explain why modifying the code from Demo 11.1.2 to implement this formula requires the use of matrix algebra.

  4. ⌨ In this problem you are asked to revisit Demo 11.1.2 in order to examine the instability phenomenon more closely.

    (a) Leaving other parameters alone, let m=100m=100. To the nearest ten, find the minimum value of nn that leads to a stable (i.e., not exponentially growing) solution.

    (b) Repeat (a) for m=120,140,,200m=120,140,\ldots,200. Make a table of the minimum stable nn for each mm. Is the relationship n=O(m)n=O(m), or something else?

Footnotes
  1. We discuss only so-called European options; American options are more difficult computationally.

  2. The tt variable in the heat equation is not the same as either backward or forward time in (11.1.2).