MathSource Reviews

The Black-Scholes Equation for European Call Options

Edited by Matthew M. Thomas

This review completes the fifth year of MathSource Reviews in this journal. It is most timely that Year Five would meet its end so near Mathematica's tenth anniversary celebration, held in Chicago during June 1998. During that celebratory conference, attendees were told that The Mathematica Journal would soon resume publication, this time under the aegis of Wolfram Research. In 1990, when the Journal debuted under Addison-Wesley auspices, its premiere issue featured at least two papers of particular interest to your reviewer. One of those papers was co-written by your reviewer (thus the interest), and dealt with illustrating conductive heat transfer. The second of those papers - and the more important one, for our immediate purposes - deals with pricing options. At first blush, it is hard to fathom any two topics that could be more dissimilar: After all, the first is rooted in the physical sciences, while the second is rooted in finance. But the two do have a point of commonality, in the partial differential equation on which both are based. For more on that PDE, continue reading. 
Why the interest by your reviewer in the latter of the two Journal papers? Because it is an interest shared by many, as indicated by the newest feature on the MathSource web site (www.mathsource.com). Our previous review cited the updated search features available through said site, which differentiate between old (2.2 and before) and new (3.0) MathSource material. Since June 1998 and at least through this early-July 1998 writing, said site now features a page of links to the twenty most popular MathSource items from the previous month, with popularity presumably based on number of “hits”. The custodians of the MathSource web site deserve praise for adding this useful “Top 20 List” feature to the site. Ninth on the May 1998 list and fifteenth on the June 1998 list was the Black-Scholes Option Pricing Model, by Ross Miller. This MathSource item is the electronic complement of Miller's “Computer-Aided Financial Analysis: An Implementation of the Black-Scholes Model” [Miller 1990] - the aforementioned finance-rooted paper on pricing options from the premiere issue of The Mathematica Journal. Herein, we review this item.

Black-Scholes Background

Before we attempt a discussion of Ross Miller's MathSource item and related paper, we should first review the model upon which that item is based. The model, developed by Myron S. Scholes and Fischer Black with considerable input from Robert C. Merton, was built for option valuation. Options are contracts which give their buyers/holders the right, but not the obligation, to buy or sell shares of the underlying unit at the “strike price” or “exercise price”. Options to buy are “call” options; options to sell are “put” options. “American” options can be exercised on or before the option expiration date; “European” options can be exercised only on the expiration date. Option contracts are available on stocks, indexes, U.S. Treasury rates, non-U.S. currencies, and other units of commerce and finance. American options are traded on exchanges such as the New York Stock Exchange, the American Stock Exchange, and the Chicago Board Options Exchange. 
Options let the investor manage the risk from movement in the underlying unit's value. For example: Let's say that a stock is currently $50/share, and you like its prospects over the next three months. To benefit, you can either buy, say, 100 shares today at $50/share, or buy a call option on 100 stock shares at $50/share for a premium such as $3/share (or $300, given our 100-share basis). If, in three months, the stock price leaps by $10/share to $60/share, you would have a profit of $1000 (minus transaction fees) if you buy the stock outright. You would have a profit of $1000 - $300 = $700 (minus transaction fees) if you buy the option and exercise it upon expiration. But if, in three months, the stock price falls by $10/share to $40/share, you would have a loss of $1000 (plus transaction fees) if you buy the stock outright. You would have a loss of only $300 (plus transaction fees) if you buy the option and let it expire. Call options limit your loss upon unexpected downturns while letting you benefit from expected upturns. Put options let you benefit from unexpected upturns, while limiting your loss upon expected downturns. 
Standardized, exchange-listed, and government-regulated options have been available in the U.S. for the past quarter-century. It is not a coincidence that the pioneering Black-Scholes option valuation model was published a quarter-century ago [Black-Scholes 1973]. The Black-Scholes model uses w[x,t] to represent the value of an European stock option call, as a function of underlying stock price x and time t. Under ideal conditions (no transaction costs, known and constant short-term interest rate r, no dividends or other distributions from the stock, etc.), the stock price and option value are related by

D[w[x,t],t] = r w[x,t] - r x D[w[x,t],x] -
  0.5 v^2 x^2 D[w[x,t],{x,2}]                 (1)

where (v^2) is the variance of the annual rate of return on the stock (v is also called the “volatility”), and the other variables are as defined above. Letting ts be the expiration date of the option, and letting c be the strike price, one gets the final condition

w[x,ts] = x - c for x >= c,
w[x,ts] = 0 for x < c                         (2)

which notes that the option value is worthless if the stock price does not exceed the strike price upon expiration.

Solving the Black-Sholes PDE

How do we solve (1) subject to (2)? By substituting variables. In their 1973 paper, Black and Scholes recommend the following non-obvious but nonetheless applicable substitution:

w[x,t] = Exp[r (t-ts)] y[u[x,t], s[t]]        (3)

where

u[x,t] = (2/v^2) (r - 0.5 v^2) (Log[x/c] -
  (r - 0.5 v^2) (t - ts))                     (4)

s[t] = -(2/v^2) (r - 0.5 v^2)^2 (t - ts)      (5)

If a stint in chain-rule boot camp is your cup of tea, plug (4) and (5) into (3), then plug (3) into (1), and simplify (1). If you keep your bookkeeping correct (Mathematica can help), you should emerge from the battle with

D[y[u,s],s] = D[y[u,s],{u,2}]                 (6)

This PDE, readers, is the equation for one-dimensional conductive heat transfer, with y starring as temperature, and with u and s in the supporting roles of spatial dimension and time, respectively. The premiere issue of The Mathematica Journal had in fact not one but two papers devoted to this PDE: Mine explicitly discussed the 2-D analogue to the PDE and illustrated a solution to that analogue; Ross Miller's ignored the PDE but provided code for a particular solution of it. To get that particular solution, we extend the variable substitutions (3-5) to the final condition (2). Specifically, we let t -> ts in (4) and (5), which yields s[ts] = 0 from (5), and

u[x,ts] = (2/v^2) (r - 0.5 v^2) Log[x/c]      (7)

from (4). Solving (7) for x, and substituting that result and s[ts] = 0 into (2) yields the final condition

y[u,0] = 0 for u <= 0, y[u,0] =
   c (Exp[(u v^2)/(2 (r-0.5 v^2))]-1)
     for  u > 0                               (8)

The task is now to solve (6) subject to (8). [Churchill 1963, pp. 152-154] and [Carslaw and Jaeger 1959, pp. 58-62] address this situation. These works describe 1-D conductive heat transfer in a semi-infinite solid, with the initial temperature a function of only the one spatial dimension, and with the one face of the solid maintained at zero temperature. In our situation, that translates to u >= 0, y[u,0] = f[u], and y[0,s] = 0. We've already seen how, in the u,s domain, y[u,0] represents not an initial condition but a final condition (y[u,s] upon option expiration, in particular). Note from (4), however, that u -> 0 only when 1) r = 0.5 v^2, or 2) x = c and t = ts. In either case, (5) shows that s -> 0 as well: Thus, y[0,s] = y[0,0] = 0, which is consistent with (8). The second case makes eminent sense: If stock price x only equals strike price c on expiration date ts, then option value Exp[r (ts - ts)] y[0,0] = w[x,ts] should be zero. The first case shows why the conditions for u are what they are in (8). Were they u < 0 and u >= 0 (as [Black-Scholes 1973, p. 644, eqn. 11] suggests but as [Churchill 1963, p. 152, eqn. 3] does not), r = 0.5 v^2 would lead to an indeterminate Exp[0/0] expression for y[u,0] in (8). Note how, in the u,s domain, the boundary condition y[0,s] = 0 cannot be met without also meeting the final condition y[u,0] = 0 - such is the nature of (6) in an option valuation context. 
The machinations in the preceding paragraph let us solve the option valuation problem using a conductive heat transfer template. [Carslaw and Jaeger 1959, p. 58] suppose their semi-infinite solid continued in each direction of the one spatial dimension, to maintain the one solid face at zero temperature. Were we to adopt this supposition, we would have to write y[u',0] = - f[u'] for -u' (u' > 0). From (8), though, we treat y[u',0] = 0 for -u' as defined. This treatment allows us to zero the integration from -Infinity to zero in [Carslaw and Jaeger 1959, p. 59, eqn. 1], or in [Churchill 1963, p. 153, eqn. 10]. We are left with

y[u,s] = (2 Sqrt[Pi s])^1 *
  Integrate[f[u'] Exp[- (u - u')^2/(4 s)],
     {u', 0, +Infinity}]                      (9)

With f[u'] = y[u',0] from (8), and with either 1) the u' = u + 2 q Sqrt[s] substitution from the heat transfer references, or 2) the u' = u + q Sqrt[2 s] substitution from [Black and Scholes 1973], we can rewrite (9) in terms of q. Using u' = u + q Sqrt[2 s], du' = Sqrt[2 s] dq, (u - u')^2 = 2 s q^2, u' = 0 -> q = -u/Sqrt[2 s], u' = +Infinity -> q = +Infinity, and (4) and (5), we get

f[u + q Sqrt[2s]] =
 x Exp[(r - 0.5 v^2) (ts - t)] Exp[q v
    Sqrt[ts - t]] - c                        (10)

we can rewrite (9) as

y[x,t] = (1/Sqrt[2 Pi]) *
  Integrate[x Exp[(r - 0.5 v^2) (ts -
    t)] Exp[q v Sqrt[ts - t]] Exp[-q^2/2] -
      c Exp[-q^2/2],
 {q, -u[x,t]/Sqrt[2 s[t]], +Infinity}]       (11)

Solving (11) in the x,t domain (Mathematica can help), simplifying, and plugging the simplification into (3) finally yields the option valuation expression we've been seeking:

w[x,t] = x/2 +
  (x/2) Erf[(Log[x/c] + (r +
    0.5 v^2) (ts - t))/
      (v Sqrt[2] Sqrt[ts - t])] -
  (c/2) Exp[r (t - ts)] -
  ((c/2) Exp[r (t - ts)] *
  Erf[(Log[x/c] + (r - 0.5 v^2) (ts -
    t))/(v Sqrt[2] Sqrt[ts - t])])           (12)

[Black and Scholes 1973, p. 644, eqn. 13] present a less intimidating version of (12) that uses the cumulative normal density function N[d] = 0.5 + (0.5 * Erf[d/ Sqrt[2]]).

Solution Significance

Why go through the trouble of illustrating this derivation? There are a number of reasons. For one: Your reviewer is admittedly smitten by the elegant parallel between 1-D heat conduction and European stock call option valuation. For another: The derivation as presented by [Black and Scholes 1973] is a bit spotty, and its vague reference to [Churchill 1963, p. 155] is a bit bemusing: Eqn. 6 of p. 155 of [Churchill 1963] would suffice as the template integral, except for a -Infinity lower limit of integration that does not correspond to the required finite lower limit. Using Churchill's eqn. 6 ... -Infinity lower limit and all ... appears to yield w[x,t] = x - c Exp[r (t - ts)], which satisfies (2) but erroneously implies that volatility plays no role in option valuation. The main reason, however, is that (12) is of enormous importance. Primarily for their work to derive (12), Myron S. Scholes and Robert C. Merton received the Bank of Sweden Prize in Economic Sciences in Memory of Alfred Nobel, 1997, from the Royal Swedish Academy of Sciences. 
If you read the announcement regarding 1997 Nobel laureates Scholes and Merton (at www.nobel.se/ announcement-97/economy97.html, for one), you will also find accolades for Fischer Black. There is no question that Black contributed as much to (12) as Scholes and Merton did. In fact, [Black 1989] wrote an informal essay on the 1973 paper he and Scholes co-authored, describing how (12) came to be. In the essay, he notes that, despite his Ph. D. in applied mathematics, he lacked familiarity with standard PDE solutions. He also notes that, despite his A.B. in physics, he didn't recognize the likes of (6) (even though [Bird et al 1960, p. 353] call (6) “one of the most worked-over equations of theoretical physics”). He notes that, had laureate Merton not overslept and missed his and Scholes' presentation at a summer 1970 conference, their three-way collaboration would have reached fruition much more rapidly. He credits the Univ. of Chicago's Merton Miller and Eugene Fama with helping to get the seminal 1973 paper published. And, in his essay's sub-title, he notes that “like many great inventions, [the option valuation formula] started with tinkering and ended with delayed recognition”. How poignant these words would prove. In 1995, six years after he published his essay, and two years before the ultimate recognition of his great invention, Fischer Black died. He was in his mid-fifties.

MathSource Item BlackScholes.m

MathSource item www.mathsource.com/MathSource/Applications/EconomicsFinance/0209-270/BlackScholes.m (5 kB) by Ross M. Miller is the Mathematica package corresponding to Miller's 1990 paper in The Mathematica Journal. Specifically, BlackScholes.m is the code on p. 77 of [Miller 1990]. Both this MathSource item and Miller's 1990 paper complement his book Computer-Aided Financial Analysis (1990, Addison-Wesley). Schooled in mathematics and economics, Miller was plying his trade in the General Electric Corporate Research and Development Center at the time of his 1990 publications. As his paper reveals, Miller is a champion of symbolic approaches to financial analysis, so it comes as no surprise that Mathematica is a potent weapon in his arsenal. 
Miller's paper predicts heavy use of spreadsheet front-ends with Mathematica kernels among financial users. As has been noted, the paper avoids (1) and (2), but begins with the Black-Scholes version of (12) and proceeds from there. It provides a symbolic treatment of the stock option valuation formula. It includes a thorough assessment of w[x,t] sensitivity to its parameters (x, r, v, ts) - these partial derivatives, in fact, are the core of BlackScholes.m. The paper also alludes to extensions of the Black-Scholes model, as described in the financial works referenced by the paper. In retrospect, it is a credit to the Addison-Wesley handlers of The Mathematica Journal that they chose such a significant topic for their premiere issue. Any periodical can deem a subject worthwhile after that subject lands Nobel Prizes for those involved. It takes foresight to arrange subject coverage several years before the Prizes are awarded. 
Other works, both within and outside MathSource, deal with both the Black-Scholes formula and the efforts of Ross M. Miller. Miller's discussion of option pricing appears in Hal R. Varian's Microeconomic Analysis, 3rd ed. (1992, W. W. Norton and Company): See the notebooks within the www.mathsource.com/cgi-bin/MathSource/ Publications/BookSupplements/Varian-1992/0202-419/ directory. Miller also contributed the optvalue.m package to the Varian-edited Economic and Financial Modeling with Mathematica (1993, TELOS/Springer-Verlag), which covers Black-Scholes and other option pricing models: See the compressed files in the www.mathsource.com/cgi-bin/MathSource/Publications/BookSupplements/Varian-1993/0205-399/ directory. A recent arrival, William Shaw's Modelling Financial Derivatives Using Mathematica (1998, Cambridge University Press), expands upon Miller's spreadsheets-Mathematica discussion (spreadsheets vex Shaw). Shaw's work also presents the Black-Scholes option valuation formula, and - in Chapter 1 - promises a Mathematica-assisted solution of (1) and (2): See http://www.mathsource.com/MathSource/Publications/BookSupplements/Shaw-1998/0209-023/Chapter1.nb. 
On the World-Wide Web, there are a vast number of pages devoted to the Black-Scholes effort, as one would expect. Your reviewer's favorite was a page dated 21 March 1997. Labeled “Ashwin's Applet Factory”, this work was brought forth by one Ashwin Kapur, then an undergraduate at Illinois Wesleyan University pursuing a double-major in mathematics and economics. As of this writing, the URL for Kapur's page was www.iwu.edu/~akapur/java/toc.html. The page offers a number of option pricers and the like, but it is the Black Scholes European Stock Options Pricer that we shall inspect. The page www.iwu.edu/~akapur/java/bssapplet.html offers computations involving Black Scholes European Call (or Put) Options. The Call option offers the user two columns of parameters. Column one contains seven parameters (x, c, t  s - t, v, r, return, and w [x, t]): The user can input any six and calculate the seventh. Column two contains values for delta, gamma, vega, theta, and rho. These values are computed based on the values in the first column. The Greek letters represent the aforementioned sensitivities of w[x,t]: delta = D[w[x,t],x], gamma = D[w[x,t],{x,2}], vega (also called kappa or lambda) = D[w[x,t],v], theta = -D[w[x,t],t], and rho = D[w[x,t],r]. The applet can also plot w[x,t], delta, gamma, vega, theta, or rho against time. 
Since BlackScholes.m also computes these partial derivatives, it would be useful to submit a test case to this MathSource item. As the test case, we use stock price x = $98.5, strike price c = $100, interest rate r = 8% = .08, volatility v = 23% = .23, current time t = 0.0, and expiration date ts = 0.3 years ... values suggested in [Miller 1990 p. 78]. We first use the BlackScholes.m functions (which, incidentally, are well-documented through usage statements in the package):

<<BlackScholes.m

OptionValue[98.5, 100, 0.23, 0.08, 0.3]

OptionValue[98.5, 100, 0.23, 0.08, 0.3]

OptionDelta[98.5, 100, .23, .08, .3]

OptionDelta[98.5, 100, .23, .08, .3]

OptionTheta[98.5, 100, .23, .08, .3]

OptionTheta[98.5, 100, .23, .08, .3]

OptionRho[98.5, 100, .23, .08, .3]

OptionRho[98.5, 100, .23, .08, .3]

OptionKappa[98.5, 100, .23, .08, .3]

OptionKappa[98.5, 100, .23, .08, .3]

OptionGamma[98.5, 100., 0.23, 0.08, 0.3]

OptionGamma[98.5, 100., 0.23, 0.08, 0.3]

For the Miller case, then, w[98.5, 0] = $5.33, delta = $0.550249, theta = -$11.9462/year, rho = $13.58, and gamma = $0.031895/year/year. But what of kappa? Well, the OptionKappa usage statement notes that kappa is also called vega or lambda. But it is probably a good idea to use only one of those three Greek letters when discussing the partial derivative of w[x,t] with respect to v. BlackScholes.m fails to do so: It includes an undefined OptionLambda[] function in its definition of OptionKappa[], and that is what causes the message in output %6. (That undefined function also appears in print [Miller 1990, p. 77]; it has yet to be corrected in MathSource). If we make the correction, replacing OptionLambda[] with OptionKappa[] in the erroneous line of code, we find that OptionKappa[98.5, 100., 0.23, 0.08, 0.3] = $21.3522. 
Are these values correct? In his equation for the Black-Scholes stock option call valuation formula, Miller uses (1+r)^(t-ts) instead of the Exp[r (t-ts)] term in [Black-Scholes 1973]. Since Black and Scholes assumed a random walk of the stock price in continuous time, the Exp[r (t-ts)] term is the appropriate term, and continuous compounding of interest was the basis for Black and Scholes' formulation of (1). Shaw's 1998 work likewise uses the Exp[r (t-ts)] term, as, it appears, does Ashwin Kapur's applet. Granted, Limit[(1+r/k)^(k (t-ts)), k -> +Infinity] is Exp[r (t-ts)], but BlackScholes.m does not take annual compounding frequency k into account. As such, r in BlackScholes.m and in [Miller 1990] differs from that in [Black-Scholes 1973], in Shaw's 1998 work, in the Kapur applet, and elsewhere. Miller's r (rM) is related to Black and Scholes' r (rBS) by rBS = Log[1 + rM]. When we use Log[1.08] -> 7.6961% in Kapur's applet with the other Miller test case values, we get the same values that are produced by rM = .08 in output lines %2 through %7 above (including the $21.3522 value for vega or kappa). The only exception is the r-based rho value: rM-based D[w[x,t],r] is $13.5753; rBS-based D[w[x,t],r] is $14.6613.

Summary

Despite his failure to mind his kappas and lambdas, and despite his unexplained use of simple (in lieu of continuously compounding) interest, Miller has written a MathSource package that both holds its own in a financial analyst's toolbox, and reminds one of the promise Mathematica held back when publications about it were just getting under way. Once corrected, BlackScholes.m compares well to the Kapur applet: One needs but a cursory knowledge of Mathematica plotting functions to generate graphs superior to those from the applet. A deeper knowledge of such functions can bring forth all sorts of instructive 2-D plots, 3-D plots, and animations to explain (or at least illustrate) European stock option call pricing phenomena. And, of course, Mathematica better lends itself to the examination of option pricing-related concepts such as implied volatility and elasticity - a point that Miller himself [Miller 1990] takes care to make. To make these observations is not, mind you, to disparage Ashwin Kapur's applet: This product of Illinois Wesleyan has put forth a fine effort for all the world to use. But Java just does not offer the platform for symbolic financial analysis that Mathematica offers. 
Once in a while, it is good to reflect upon what has occurred over the five years since the start of these Reviews ... the several years since the introduction of The Mathematica Journal ... the decade since the debut of Mathematica. Things change: Ross M. Miller's paper describes spreadsheets such as Lotus 1-2-3, Microsoft Excel, and Wingz (Wingz!) as computationally inferior to Mathematica; today, it is not a spreadsheet but a Java-based applet that one thinks to run alongside Mathematica. Since we can predict the future to but a very limited extent, we would do well to pay heed to lessons learned along the way. When those lessons unveil hidden delights - commonality between two very different phenomena, a paper presaging significant recognition for a great accomplishment, a tool and its attendant publications enduring and even thriving - we are reminded, as per Don Quixote, that the road is indeed better than the inn.

References

Bird, R. Byron, Stewart, Warren E, and Edwin N. Lightfoot. Transport Phenomena. John Wiley and Sons, New York (1960). 
Black, Fischer. “How we came up with the option formula”, Journal of Portfolio Management, 15(2), 4-8 (1989). 
Black,Ffischer and Scholes, Myron. “The Pricing of Options and Corporate Liabilities”, Journal of Political Economy, 81(3), 637-654 (1973). 
Carslaw, H. S. and Jaeger, J. C. Conduction of Heat in Solids, 2nd ed. Oxford University Press, London (1959). 
Churchill, Ruel V. Fourier Series and Boundary Value Problems. McGraw-Hill, New York (1963). 
Miller, Ross M. “Computer-Aided Financial Analysis: An Implementation of the Black-Scholes Model”, The Mathematica Journal, 1(1), 75-79 (1990).

About the Author

Matthew M. Thomas completed his doctorate in chemical engineering at Washington University in St. Louis, in December 1995. The batch chemical process quality control aspects of that work are meticulously explained in the October 1997 issue of the AIChE Journal, with a related news item in the Chemical Engineering Progress issue from the same month. 
thomas@wuche2.wustl.edu