




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





by Simon Benninga and Zvi Wiener
he two major types of securities are stocks and bonds. A share of stock represents partial owner- ship of a company with an uncertain payoff which depends on the success of the specific business. Bonds, on the other hand, are loans which must be repaid except in cases of default; they can be issued either by govern- ments or by business. Modern financial markets offer many other instruments besides stocks and bonds. Some of these instruments are called derivatives, since their price is derived from the values of other assets. The most popular example of a derivative is an option, which represents a contract allow- ing to one side to buy (in the case of a call option) or to sell (the case of a put option) a security on or before some specified maturity date in the future for a price which is set today. This prespecified price is called the exercise price or the strike price of the option. The two major classes of options are called European and American. A European option can be exercised only at maturity while an American option can be exercised at any time prior to maturity. Option pricing is topic of the current and the following article in this series. The price of an option is typically a non-linear function of the underlying asset (and some other variables, like interest rates, strike, etc.) The basis of any option pricing model is a description of the stochastic process followed by the underlying asset on which the option is written. In the Black-Scholes model, which will be discussed in the next article, the assumption is that the stock price is lognormally distributed (that the price follows a Wiener process with constant drift and variance). In this article we consider the case where the stock price follows a simple, stationary binomial process. At each moment in time, the price can go either up or down by a given percentage. When the stock price follows such a process and when there exists a risk-free asset, options written on the stock are easy to price. Furthermore, given appropriate limiting conditions, the binomial process con- verges to a lognormal price process and the binomial pric- ing formula converges to the Black-Scholes formula.
AN EXAMPLE Consider a stock whose price today is $50. Suppose that over the next year, the stock price can go either up by
10% or down by -3%, so that the stock price at the end of the year is either $55 or $48.50. If there also exists a call on the stock with exercise price K ± 50, then these three assets will have the following payoff patterns:
bond price 1
stock price 50
55
call option ???
5 0
In this case the option payoffs can be replicated by a linear combination of the stock and the bond. This com- bination defines its price uniquely. To see this, denote by A the number of shares and by B the number of bonds which exactly replicate the option’s payoffs. This gives the following system of linear equations to solve:
55 A ∫ 1_._ 06 B ± 5 48_._ 5 A ∫ 1_._ 06 B ± 0
Using Mathematica to solve these equations, we get: In[1]:= Solve[{55A + 1.06B == 5, 48.5A + 1.06B == 0}, {A, B}]** Out[1]= {{ A é 0.769231, B é ª 35.1959 }}
This system of equations solves to give A = 0.769231, B ± ª 35_._ 1959. Thus purchasing 0.77 of a share of the stock and borrowing $35.20 at 6% for one period will give payoffs of $5 if the stock price goes up and $0 if the stock price goes down—the payoffs of the call option. It follows that the price of the option must be equal to the cost of replicating its payoffs, i.e., call option price ± 0_._ 7692 ` $50 ª $35_._ 1959 ± $3_._ 2656. This logic is called “pricing by arbitrage”: If two assets or sets of assets (in our case—the call option and the portfolio of 0.77 of the stock and -$35.20 of the bonds) have the same payoffs, they must have the same market price.
We can extend this example to multiple periods. Here, for example, is a two-date example; the price of a call option
Vol. 6 No. 3 1997 Mathematica in Education and Research 1
with exercise price 50 solves (as indicated) to 5.749.
50 55
1
Stock price Bond price
Call option price
The solution of this problem with Mathematica is left as an exercise.
STATE PRICES AND THE BINOMIAL OPTION PRICING MODEL We now reconsider the first example of the previous sec- tion. Suppose that the states of the world called “up” and “down” represent all of the uncertainty in the next period. We can derive market prices for these states by solving the following set of simultaneous equations:
p $55 ∫ _q_ $47_._ 50 ± $50_._ 00 p ∫ q ± (^11). 06
The market prices p and q are the price today of an “up” and a “down” state respectively. The price p represents the price today of one dollar in an “up” state tomorrow and the price q the price today of one dollar in a “down” state tomorrow. The economic logic behind the first equation is that the price paid today for the stock, $50.00, repre- sents a price paid today for $55 of stock value in an “up” state tomorrow plus the price paid today for $47.50 in a “down” state tomorrow. The second equation is derived from much the same logic for the riskless bond: Given a price today of $100, the bond will return $1001_._ 06 ± $ tomorrow in both the “up” and the “down” states, so that the relevant pricing equation should be 106( p ∫ q ) ± 100. Hence the second equation. This system of equations can, of course, be solved us- ing Mathematica :
In[2]:= Solve[{55p + 47.5q == 50, p + q == 1/1.06}, {p, q}]** Out[2]= {{ p é 0.691824,q é 0.251572 }}
Given an “up” and “down” movement, we can easily derive the general expressions for p and q. As an amuse- ment we will use Mathematica to solve the equations, us- ing an upper-case R to denote one-plus-the-interest rate: R ± 1 ∫ r.
In[3]:= a = Simplify[Solve[{pup + qdown == 1, p + q == 1/R}, {p, q}]]**
Out[3]=
p é down ª R down R ª R up , q é R ª up down R ª R up
A little algebra will show that this solution can be sim- plified further:
p ± R ª down R ( up ª down )
‚ q ±
ª p
We can make this example more complicated. Suppose we divide the interval between 0 and 1 into n subintervals. Suppose that in each of these subintervals the price of the stock can go up by u or down by d and suppose that the riskless interest rate over a subinterval is r. Now let p be the state price over one such interval for an up state and q be the one-interval state price; i.e., { p,q } solves p _u_ ∫ _q_ d ± 1 p ∫ q ± (^11) ∫ r Then the price of the stock at time 1 will be su j^ d n ª j^ , where s is the initial stock price and j is the number of up movements in the stock price over the period. A European call option with exercise price X and exercise date n will have payoff in state { n ‚ j } given by payoff in state ( n ‚ j ) ± Max [ su j^ d n ª j^ ª X ‚ 0 ] Given the state prices { p ‚ q }, the option price can be cal- culated as:
C ( X ) ±
∑^ n
j ± 0
p j^ q j^ ª n
n j
Max [ su j^ d n ª j^ ª X ‚ 0 ]
Similarly, the price of a European put is given by:
∑^ n
j ± 0
p j^ q j^ ª n
n j
Max [ X ª su j^ d n ª j^ ‚ 0 ]
Where the binomial coefficient ( n j
n! j !( n ª j )! denotes the number of occurrences of j up states in n subintervals. Implementing this in Mathematica is simple: In[4]:= Clear[statePrices] statePrices[up_, down_, R_] := Solve[{pup + qdown == 1, p + q == 1/R}, {p, q}][[1]] Clear[binomialCall] binomialCall[s_, x_, n_] := Sum[pˆjqˆ(n - j)Binomial[n, j]* Max[supˆjdownˆ(n - j) - x, 0], {j, 0, n}] /. statePrices[up, down, R] up = 1.1; down = 0.97; R = 1.06; binomialCall[50, 50, 2]** Out[4]= 5. What is still lacking is the connection between the bi- nomial price process discussed in this section and the log- normal price process which underlies the Black-Scholes formula. We discuss this connection in the next section.
DETERMINING THE BINOMIAL PARAMETERS Suppose that a stock’s return is lognormally distributed with mean K and standard deviation R. Denoting the stock price today by s and the stock price at date t in the future by s (^) t , this means that
log
s (^) t s
t N (K t ‚ R
t )
2 Mathematica in Education and Research Vol. 6 No. 3 1997
0.6 0.8 1.2 1.4 1.6 1.
Graphing the previous graph (when O ± 12 ) with this graph:
In[9]:= Show[aa,bb];
2 4 6 8
When we have n ± 100, these two graphs are indeed very close
2 4 6 8
The state prices
p ± R ª down R ( up ª down )
‚ q ±
ª p
probabilities, since p ∫ q ± 1 / R. Multiplying the state prices by R ± 1 ∫ r allows us to regard them as “pseudo probabilities”. The technical name for this is “equivalent martingale measure.” Since we are about to price options (and other derivative securities) by using state prices, we
could also regard the pricing in an equivalent fashion: Instead of pricing by p and q , we can price by Rp and Rq. This allows us to say: “In a perfect market, there exists an equivalent prob- ability measure such that the price of any security is its discounted expected value with respect to this measure.” In more complicated situations, the equivalent proba- bility measure is given by the Radon-Nikodym derivative. For the simple binomial case discussed here, we can easily see the application of this approach. Take the stock price, for example: After one period, the stock price is either su or sd. Taking the expected value using the equivalent probability weights { pR ‚ qR } gives
pR _ su ∫ qR _ sd ± Rs
so that the discounted value of the expected value is in- deed the stock price: 1 R
_ [ pR _ su ∫ qR _ sd ] ± s
Of course, given our definition of “up” and “down” move- ments and given the interest rate r , this is tautological, since our definition of p and q is derived in such a way as to make this true. Nevertheless, we can prove the state- ment for any market in which pricing does not allow arbitrage opportunities. Furthermore, we can—in a non-trivial way—use the “risk-neutral” pricing principle (i.e., pricing returns by discounting their expected return at a properly defined equivalent probability measure) to value options. Thus, for example, if in a binomial world a security pays off X in an “up” state and Y in a “down” state, then its market value today will be given by:
value ±
_ [ pR _ X ∫ qR _ Y ]
In this section we develop the binomial pricing model for options. We start with a simple European call option. Suppose a single period is divided into T intervals, so that the price of the stock at the end of the last interval can be written s (^) T. Then the call option price at maturity coincides with its payoff function,
Max [ s (^) T ª X ‚ 0 ]
A day prior to maturity at each state we can calculate the call price as a weighted average (with risk-neutral probabilities as weights) of its price at maturity. Obviously this procedure can be continued to the root of the stock tree, giving price of the option today. The above procedure will work for both European and American options. However, in the case of European op- tions we can use a simpler procedure based on obser- vation that only the distribution of payoffs at maturity
4 Mathematica in Education and Research Vol. 6 No. 3 1997
matters. We can calculate state prices of each state at ma- turity and take a weighted average of payoffs with these weights. Example 1. Assume that interest rates equal 6% (each pe- riod). In a 4 periods model we expect “up” jumps to be 1.1 and “down” jumps to be 0.95 each period. If the ini- tial stock price is $50, then the development of the stock price is described below:
In[10]:= up = 1.1; down = 0.95; r = 0.06; stock = Table[50upˆ(j - 1)downˆ(i - j), {i, 1, 5}, {j, 1, i}]; MatrixForm[stock]** Out[10]=
{ 50 } { 47.5,55. } { 45.125,52.25,60.5 } { 42.8687,49.6375,57.475,66.55 } { 40.7253,47.1556,54.6013,63.2225,73.205 }
Note that the indices go from 1 to n ∫1 and from 1 to i , which means that the date 0 corresponds to the node with indices (1,1) and the last date all ups node corresponds to indices ( n ∫ 1 ‚ n ∫ 1 ). The Mathematica convention is not to use zero as an index of an array; for example, we could have written the stock prices in period 4 by using the list junk produced by junk = Table[50upˆ(j- 1)downˆ4-j), {j,0,4}]. This would have produced the same output as above:
{ 40.7253,47.1556,54.6012,63.2225,73.205 }
However (and this is the important part!), Mathematica will not recognize junk[[0]] as the first item in this list; for Mathematica the list junk is indexed from 1 to 5, not from 0 to 4. Thus the first index here is the actual day + 1 and the second index is the number of “up” jumps + 1. We show a way to avoid this inconvenience later. To find one period state prices we use the method described above.
In[11]:= solution = Solve[{p(1 + r) + q(1 + r) == 1, upp + downq == 1}, {p, q}]**
Out[11]= {{ p é 0.691824,q é 0.251572 }}
(Note that r is the interest rate for each period, not the annual interest rate.) The whole tree of state prices, for the case n=4 , is:
In[12]:= n = 4; p = solution[[1,1,2]]; q = solution[[1,2,2]]; statePrices = Table[pˆ(j - 1)qˆ(i - j), {i, 1, n + 1}, {j, 1, i}]; MatrixForm[statePrices]*
Out[12]=
{ 1 } { 0.251572,0.691824 } { 0.0632886,0.174044,0.47862 } { 0.0159217,0.0437846,0.120408,0.331121 } { 0.00400545,0.011015,0.0302912,0.0833009,0.229077 }
Define the payoff function for the European call and put options with exercise price X as: In[13]:= Clear[payoffCall, payoffPut]; payoffCall[s_] := Max[s - X, 0]; payoffPut[s_] := Max[X - s, 0];
To find the price today of the option we sum all possi- ble final payoffs at maturity ( n ∫ 1) with weights given by the corresponding state prices. Recall that the state price today of each final node of the tree is exactly the price one should pay for $1 received if and only if this state is realized. In[14]:= X = 45; statePrices[[n + 1]]. payoffCall /@ stock[[n + 1]] Out[14]= 8. Note that the operator Map allows us to apply the func- tion payoffCall to the whole list of stock prices at the final day. This gives the list of final payoffs which we mul- tiply (dot is a Mathematica operator for scalar product of vectors) it by the vector (list) of the corresponding state prices. The result is the price today of a EuropeanCall option on the tree. This method is very useful when the price today is the only variable of interest and nothing important happens in the intermediate dates (like dividends, splits, changes in volatility or interest rates, early exercise, etc.). Another way to calculate the price of a European op- tion is to build a tree with all intermediate prices. This gives much more flexibility since one can introduce dif- ferent events in any intermediate date. We consider ex- amples of this approach later. The approach described above is very transparent but not very efficient. We now show a more efficient way which uses the same algorithm. Here we do not have to guess the sizes of each period up and down jumps. Instead we use the annual historical volatility and interest rates. In[15]:= Clear[up, down, R, P, Q, EuropeanOption, EuropeanCall, EuropeanPut, mean]; up[n_, sigma_, T_] := N[Exp[Sqrt[T/n]sigma]]; down[n_, sigma_, T_] := 1/up[n, sigma, T]; R[n_, Rf_, T_] := N[Exp[RfT/n]]; P[up_, down_, r_] := N[(r - down)/(up - down)/r]; Q[up_, down_, r_] := N[1/r - P[up, down, r]]; mean[m_List] := Plus @@ m/Length[m];**
Vol. 6 No. 3 1997 Mathematica in Education and Research 5
Structural Approach Here is a more sophisticated example that is essentially based on the same algorithm but uses a very powerful tool—recursion.
In[24]:= AmericanOption[s_, n_, sigma_, T_, Rf_, exercise_Function] := Module[{u = up[n, sigma, T], d = down[n, sigma, T], r = R[n, Rf, T], p, q, OpRecurse}, p = P[u, d, r]; q = Q[u, d, r]; OpRecurse[node_, level_] := OpRecurse[node, level] = If[level == n, exercise[sdˆnodeuˆ(level - node)], Max[{p, q}. {OpRecurse[node, level + 1], OpRecurse[node + 1, level + 1]}, exercise[sdˆnodeuˆ(level - node)]]]; OpRecurse[0, 0]];**
Here we first define AmericanOption as a function of the same variables as before. The difference begins with OpRecurse —recursive definition of the option price. Here we define recursively the price. At level n we use the exercise price as definition, at all other levels one should choose the maximum between option alive (weighted sum of the next period prices that are already calculated) and its intrinsic value which is equal to the final payoff calculated at the current stock value. After the general definition of the AmericanOption we can define the two widely used types of derivative securities— AmericanCall and AmericanPut options.
In[25]:= AmericanCall[X_, s_, n_, sigma_, T_, Rf_] := AmericanOption[s, n, sigma, T, Rf, Max[#1 - X, 0] & ]; AmericanPut[X_, s_, n_, sigma_, T_, Rf_] := AmericanOption[s, n, sigma, mmT, Rf, Max[X - #1, 0] & ];
This definition is similar to the one for European op- tions. To calculate prices of options try:
In[26]:= AmericanCall[50, 50, 30, 0.4, 0.5, 0.1] AmericanPut[50, 50, 30, 0.4, 0.5, 0.1]
Out[26]= 6.
4. Our next article will continue the discussion of bino- mial option pricing models. We will show how to price options when the underlying security pays dividends, how to determine the optimal exercise boundary, and how to price exotic (path dependent) options.
For the past several years we have been teaching a course in “Financial Engineering” at the Hebrew University in Israel. The course covers advanced financial program- ming and uses Mathematica as its primary computing and
teaching vehicle. Students in the course include both un- dergraduates and MBAs; our prerequisites are that all stu- dents have some prior finance courses (an introductory options course is the minimum requirement) and some “mathematical sophistication”—meaning that they do not startle when confronted by a matrix or an integral sign. The course has been very successful. Students enjoy learn- ing how to implement computationally intricate finance models. As might be suspected, computation turns out to be not merely a goal, but leads to a greater understanding of the finance models themselves. This is the first of a series of articles based on our course. The articles cover a variety of topics in option and bond pricing; their order and level corresponds roughly to the first 10 weeks of a semester. While we will explain the advanced finance topics covered in the articles, we will assume some ac- quaintance with basics. The subjects we will cover will include:
í Binomial option pricing models í Black-Scholes option pricing í Simulating stock prices and dynamic hedging strategies í Risk management í Portfolio insurance strategies í Term structure models
In planning and implementing the course, we have benefited from a series of grants from the Krueger Center for Finance and Banking of the Hebrew University.
REFERENCES
Option Pricing Models”, Mathematica Journal 3:4, pp. 66–73, 1993.
Option Pricing,” Journal of Finance 51:5, pp. 1573–1610, 1996.
plified Approach,” Journal of Financial Economics 7, pp. 229-263.
Hall, 1997.
Compound-Option Models,” Journal of Finance , 1987, v42(2), 463-469.
ABOUT THE AUTHORS Simon Benninga is a professor of finance at Tel-Aviv University (Is- rael) and the Wharton School of the University of Pennsylvania. He has published academic papers in many areas of finance. His newest book, Financial Modeling , will be published by MIT Press in October
Vol. 6 No. 3 1997 Mathematica in Education and Research 7
Zvi Wiener is an assistant professor in the Finance Department of the Business School at the Hebrew University in Jerusalem, Israel. He is currently visiting professor of finance at the Olin School of Business at Washington University, St. Louis. After receiving his Ph.D. in math- ematics from the Weizmann Institute, he was a postdoctoral fellow at the Wharton School of the University of Pennsylvania and subsequently worked in the financial derivatives research group at Lehman Brothers. His finance research concentrates on the pricing of derivative securities, value at risk, computational finance, and stochastic dominance.
Zvi Wiener Finance Department, Business School Hebrew University, Jerusalem, Israel [email protected] http://pluto.mscc.huji.ac.il/mswiener/zvi.html
ELECTRONIC SUBSCRIPTIONS Included in the distribution for each electronic subscription is the file BinomialOption.nb containing Mathematica code for the material described in this article.
8 Mathematica in Education and Research Vol. 6 No. 3 1997