LINEBURG


<< . .

 5
( 20)



. . >>




30
one state, we also ¬nd the probability of the other as (1 ’ q). Equation 5.1 demonstrates this calculation for
the underlying security.
S0 = e’r (qSu + (1 ’ q)Sd ) (5.1)
Now, any derivative security based on this underlying security can be priced using the same “probability” q.
The contribution of binomial option pricing is in actually calculating the number q. To do valuation, start
by introducing constants u and d implicitly de¬ned by Su = uS0 and Sd = dS0 , and you get a process as
illustrated in ¬gure 5.1.


¨ uS0
B
¨
¨
¨¨
S0 rr
r
rr dS0
j



Figure 5.1: Binomial Tree

and calculate the arti¬cal “probability” q as
er ’ d
q=
u’d
The price of a one-period call option in a binomial framework is shown in formula 5.1 and implemented in
code 5.1.

Cu = max(0, Su ’ K)

Cd = max(0, Sd ’ K)

C0 = e’r (qCu + (1 ’ q)Cd )

er ’ d
q=
u’d
Su = uS0 and Sd = dS0 are the possible values for the underlying security next period, u and d are constants, r is the (continously
compounded) risk free interest rate and K is the call option exercise price.

Formula 5.1: The single period binomal call option price

The “state price probability” q is found by an assumption of no arbitrage opportunities. If one has the
possibility of trading in the underlying security and a risk free bond, it is possible to create a portfolio of
these two assets that exactly duplicates the future payo¬s of the derivative security. Since this portfolio has
the same future payo¬ as the derivative, the price of the derivative has to equal the cost of the duplicating
portfolio. Working out the algebra of this, one can ¬nd the expression for q as the function of the up and
down movements u and d.
Exercise 1.
The price of the underlying security follows the binomial process


¨ Su
B
¨
¨
¨
S0 ¨
rr
rr
r Sd
j



31
#include <cmath> // standard mathematical library
#include <algorithm> // de¬ning the max() operator
using namespace std;

double option price call european binomial( const double& S, // spot price
const double& X, // exercice price
const double& r, // interest rate (per period)
const double& u, // up movement
const double& d){ // down movement
double p up = (exp(r)’d)/(u’d);
double p down = 1.0’p up;
double c u = max(0.0,(u*S’X));
double c d = max(0.0,(d*S’X));
double call price = exp(’r)*(p up*c u+p down*c d);
return call price;
};


Code 5.1: Binomial European, one period


A one period call option has payo¬s


¨ Cu = max(0, Su ’ K)
B
¨
¨
¨
C0 ¨
rr
rr
r Cd = max(0, Sd ’ K)
j



1. Show how one can combine a position in the underlying security with a position in risk free bonds to create
a portfolio which exactly duplicates the payo¬s from the call.
2. Use this result to show the one period pricing formula for a call option shown in formula 5.1.


5.1 Multiperiod binomial pricing

Of course, an assumption of only two possible future states next period is somewhat unrealistic, but if we
iterate this assumption, and assume that every date, there are only two possible outcomes next date, but
then, for each of these two outcomes, there is two new outcomes, as illustrated in the next ¬gure:

u(uSt ) = uuSt
B
¨
¨¨
¨¨
¨¨
¨ uS
¨
¨ rr t
B
¨¨ rr
¨ r
¨¨ rr
r
j
¨St d(uSt ) = u(dSt ) = udSt
rr ¨
B
¨
¨
r
¨¨
rr
¨
r
r ¨¨
r dSt
j
rr
r
rr
rr
d(dSt ) = ddSt
r
j



32
Iterating this idea a few times more, the number of di¬erent terminal states increases markedly, and we get
closer to a realistic distribution of future prices of the underlying at the terminal date. Note that a crucial
assumption to get a picture like this is that the factors u and d are the same on each date.




¨
¨
¨
¨¨rr r
¨
¨ rr ¨¨
¨ r
¨
¨¨ rr ¨ rr
r r
r
¨
¨
rr ¨¨ r ¨
¨ ¨
¨ r¨
¨
r
rr ¨ r ¨¨rr
¨ rr r
rr ¨¨ r ¨¨ ¨
¨

rr ¨¨rr
¨ r
rr ¨
¨

rr
r




Pricing in a setting like this is done by working backwards, starting at the terminal date. Here we know all
the possible values of the underlying security. For each of these, we calculate the payo¬s from the derivative,
and ¬nd what the set of possible derivative prices is one period before. Given these, we can ¬nd the option
one period before this again, and so on. Working ones way down to the root of the tree, the option price is
found as the derivative price in the ¬rst node.
For example, suppose we have two periods, and price a two period call option with exercise price K.

uuS0
B
¨
¨¨
¨¨
¨
¨¨0
¨ ruS
B
¨¨ rr
¨ r
¨ r
¨¨ rr
r
j
¨S0 udS0
rr B
¨
¨
¨
rr ¨
¨
r
rr ¨¨
r ¨dS0
j
rr
r
rr
r
r ddS0
r
j

First step: Find terminal payo¬s of derivative security:




33
Cuu = max(0, Suu ’ X)
¨
B
¨¨
¨¨
¨¨
¨
¨ rr
¨
B
¨ r
¨ rr
¨¨ rr
¨¨ Cdu = max(0, duS ’ X)
j
r
r B
¨
¨
rr ¨
¨¨
r
rr ¨
r ¨¨
j
r
rr
rr
r
rr
Cdd ’ max(0, ddS ’ X)
r
j

Next step: Find the two possible call prices at time 1:

Cu = e’r (qCuu + (1 ’ q)Cud )

Cd = e’r (qCud + (1 ’ q)Cdd )


¨ Cu
B
¨
¨
¨¨
C0 r
rr
rj Cd
r


Final step: Using the two possible payo¬s at time 1, Cu and Cd , ¬nd option value at time 0:

C0 = e’r (qCu + (1 ’ q)Cd )

Thus, binomial pricing really concerns “rolling backward” in a binomial tree, and programming therefore
concerns an e¬cient way of traversing such a tree. The obvious data structure for describing such a tree is
shown in code 5.2, where the value in each node is calculated from ¬nding out the number of up and down
steps are used to get to the particular node.
Exercise 2.
In terms of computational e¬ciency the approcach of code 5.2 will not be optimal, since it requires a lot of calls
to the pow() functional call. More e¬cient would be to carry out the tree building by doing the multiplication
from the previous node, for example the j™th vector is the j ’ 1™th vector times u, and then one need to add one
more node by multiplying the lowest element by d.

1. Implement such an alternative tree building procedure.

Basing the recursive calculation of a derivative price on a triangular array structure as shown in code 5.2 is
the most natural approach, but with some cleverness based on understanding the structure of the binomial
tree, we can get away with the more e¬cienent algorithm that is shown in code 5.3. Note that here we only
use one vector<double>, not a triangular array as built above.
Exercise 3.
Implement pricing of single and multi period binomial put options.

Further reading The derivation of the single period binomial is e.g. shown in Bossaerts and ˜degaard
[2001]. Hull [2003] and McDonald [2002] are standard references.


34
#include <vector>
#include <cmath>
using namespace std;

vector< vector<double> > binomial tree(const double& S0,
const double& u,
const double& d,
const int& no steps){
vector< vector<double> > tree;
for (int i=1;i<=no steps;++i){
vector<double> S(i);
for (int j=0;j<i;++j){
S[j] = S0*pow(u,j)*pow(d,i’j’1);
};
tree.push back(S);
};
return tree;
};


Code 5.2: Building a binomial tree




#include <cmath> // standard mathematical library
#include <algorithm> // de¬ning the max() operator
#include <vector> // STL vector templates
using namespace std;

double option price call european binomial(const double& S, // spot price
const double& K, // exercice price
const double& r, // interest rate (per period)
const double& u, // up movement
const double& d, // down movement
const int& no periods){ // no steps in binomial tree
double Rinv = exp(’r); // inverse of interest rate
double uu = u*u;
double p up = (exp(r)’d)/(u’d);
double p down = 1.0’p up;
vector<double> prices(no periods+1); // price of underlying
prices[0] = S*pow(d, no periods); // ¬ll in the endnodes.
for (int i=1; i<=no periods; ++i) prices[i] = uu*prices[i’1];
vector<double> call values(no periods+1); // value of corresponding call
for (int i=0; i<=no periods; ++i) call values[i] = max(0.0, (prices[i]’K)); // call payo¬s at maturity
for (int step=no periods’1; step>=0; ’’step) {
for (int i=0; i<=step; ++i) {
call values[i] = (p up*call values[i+1]+p down*call values[i])*Rinv;
};
};
return call values[0];
};


Code 5.3: Binomial multiperiod pricing of European call option




35
Let S = 100.0, K = 100.0, r = 0.025, u = 1.05 and d = 1/u.
1. Price one and two period European Call options.

The program

void test bin eur call ud (){
double S = 100.0; double K = 100.0; double r = 0.025;
double u = 1.05; double d = 1/u;
cout << " one period european call = "
<< option price call european binomial(S,K,r,u,d) << endl;
int no periods = 2;
cout << " two period european call = "
<< option price call european binomial(S,K,r,u,d,no periods) << endl;

<< . .

 5
( 20)



. . >>

Copyright Design by: Sunlight webdesign