LINEBURG


<< . .

 11
( 20)



. . >>

exchange rates[i] = uu*exchange rates[i’1]; // terminal tree nodes
}
for (i=0; i<=no steps; ++i) call values[i] = max(0.0, (exchange rates[i]’K));
for (int step=no steps’1; step>=0; ’’step) {
for (i=0; i<=step; ++i) {
exchange rates[i] = d*exchange rates[i+1];
call values[i] = (pDown*call values[i]+pUp*call values[i+1])*Rinv;
call values[i] = max(call values[i], exchange rates[i]’K); // check for exercise
};
};
return call values[0];
};


Code 9.9: Binomial Currency Option


The program

void test binomial approximations currency options(){
double S = 50.0; double K = 52.0;
double r = 0.08; double rf=0.05;
double sigma = 0.2; double time=0.5;

int no steps = 100;
cout << " european currency option call = "
<< currency option price call american binomial(S,K,r,rf,sigma,time,no steps) << endl;
};


provides the output
european currency option call = 2.23129

Example 9.5: Currency option price



75
9.7 References

The original source for binomial option pricing was the paper by Cox et al. [1979]. Good textbook discussions
are in Cox and Rubinstein [1985], Bossaerts and ˜degaard [2001] and Hull [2003].
Exercise 10.
Consider an European call option on non-dividend paying stock, where S = 100, K = 100, σ = 0.2, (T ’ t) = 1
and r = 0.1.

1. Calculate the price of this option using Black Scholes
2. Calculate the price using a binomial approximation, using 10, 100 and 1000 steps in the approximation.
3. Discuss what are sources of di¬erences in the estimated prices.




76
Chapter 10

Finite Di¬erences
Contents
10.1 Explicit Finite di¬erences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
10.2 European Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
10.3 American Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79



10.1 Explicit Finite di¬erences

The method of choice for any engineer given a di¬erential equation to solve is to numerically approximate it
using a ¬nite di¬erence scheme, which is to approximate the continous di¬erential equation with a discrete
di¬erence equation, and solve this di¬erence equation.


10.2 European Options.

For European options we do not need to use the ¬nite di¬erence scheme, but we show how one would ¬nd the
european price for comparison purposes. We show the case of an explicit ¬nite di¬erence scheme in code 10.1.
A problem with the explicit version is that it may not converge for certain combinations of inputs.




77
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;

double option price put european ¬nite di¬ explicit(const double& S,
const double& X,
const double& r,
const double& sigma,
const double& time,
const int& no S steps,
const int& no t steps) {
double sigma sqr = sigma*sigma;
unsigned int M; // need M = no S steps to be even:
if ((no S steps%2)==1) { M=no S steps+1; } else { M=no S steps; };
double delta S = 2.0*S/M;
vector<double> S values(M+1);
for (unsigned m=0;m<=M;m++) { S values[m] = m*delta S; };
int N=no t steps;
double delta t = time/N;

vector<double> a(M);
vector<double> b(M);
vector<double> c(M);
double r1=1.0/(1.0+r*delta t);
double r2=delta t/(1.0+r*delta t);
for (unsigned int j=1;j<M;j++){
a[j] = r2*0.5*j*(’r+sigma sqr*j);
b[j] = r1*(1.0’sigma sqr*j*j*delta t);
c[j] = r2*0.5*j*(r+sigma sqr*j);
};
vector<double> f next(M+1);
for (unsigned m=0;m<=M;++m) { f next[m]=max(0.0,X’S values[m]); };
double f[M+1];
for (int t=N’1;t>=0;’’t) {
f[0]=X;
for (unsigned m=1;m<M;++m) {
f[m]=a[m]*f next[m’1]+b[m]*f next[m]+c[m]*f next[m+1];
};
f[M] = 0;
for (unsigned m=0;m<=M;++m) { f next[m] = f[m]; };
};
return f[M/2];
};


Code 10.1: Explicit ¬nite di¬erences calculation of european put option




78
10.3 American Options.

We now compare the American versions of the same algoritms, the only di¬erence being the check for exercise
at each point. Code 10.2 shows the code for an american put option.

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

double option price put american ¬nite di¬ explicit( const double& S,
const double& X,
const double& r,
const double& sigma,
const double& time,
const int& no S steps,
const int& no t steps) {
double sigma sqr = sigma*sigma;

int M; // need M = no S steps to be even:
if ((no S steps%2)==1) { M=no S steps+1; } else { M=no S steps; };
double delta S = 2.0*S/M;
vector<double> S values(M+1);
for (int m=0;m<=M;m++) { S values[m] = m*delta S; };
int N=no t steps;
double delta t = time/N;

vector<double> a(M);
vector<double> b(M);
vector<double> c(M);
double r1=1.0/(1.0+r*delta t);
double r2=delta t/(1.0+r*delta t);
for (int j=1;j<M;j++){
a[j] = r2*0.5*j*(’r+sigma sqr*j);
b[j] = r1*(1.0’sigma sqr*j*j*delta t);
c[j] = r2*0.5*j*(r+sigma sqr*j);
};
vector<double> f next(M+1);
for (int m=0;m<=M;++m) { f next[m]=max(0.0,X’S values[m]); };
vector<double> f(M+1);
for (int t=N’1;t>=0;’’t) {
f[0]=X;
for (int m=1;m<M;++m) {
f[m]=a[m]*f next[m’1]+b[m]*f next[m]+c[m]*f next[m+1];
f[m] = max(f[m],X’S values[m]); // check for exercise
};
f[M] = 0;
for (int m=0;m<=M;++m) { f next[m] = f[m]; };
};
return f[M/2];
};


Code 10.2: Explicit ¬nite di¬erences calculation of american put option


Readings Brennan and Schwartz [1978] is one of the ¬rst ¬nance applications of ¬nite di¬erences. Section
14.7 of Hull [1993] has a short introduction to ¬nite di¬erences. Wilmott et al. [1994] is an exhaustive source
on option pricing from the perspective of solving partial di¬erential equations.




79
The program


void test explicit ¬nite di¬erences(){
double S = 50.0;
double K = 50.0;
double r = 0.1;
double sigma = 0.4;
double time=0.4167;
int no S steps=20;
int no t steps=11;
cout << " explicit finite differences, european put price = ";
cout << option price put european ¬nite di¬ explicit(S,K,r,sigma,time,no S steps,no t steps)
<< endl;
cout << " explicit finite differences, american put price = ";
cout << option price put american ¬nite di¬ explicit(S,K,r,sigma,time,no S steps,no t steps)
<< endl;
};


provides the output
explicit finite differences, european put price = 4.03667
explicit finite differences, american put price = 4.25085

Example 10.1: Explicit ¬nite di¬erences




80
Chapter 11

Option pricing by simulation
Contents
11.1 Simulating lognormally distributed random variables . . . .......... . . 81
11.2 Pricing of European Call options . . . . . . . . . . . . . . . .......... . . 82
11.3 Hedge parameters . . . . . . . . . . . . . . . . . . . . . . . . .......... . . 83
11.4 More general payo¬s. Function prototypes . . . . . . . . . .......... . . 83
11.5 Improving the e¬ciency in simulation . . . . . . . . . . . . .......... . . 85
11.5.1 Control variates. . . . . . . . . . . . . . . . . . . . . . . . . ........... . . 85
11.5.2 Antithetic variates. . . . . . . . . . . . . . . . . . . . . . . . ........... . . 86
11.5.3 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........... . . 88
11.6 More exotic options . . . . . . . . . . . . . . . . . . . . . . . .......... . . 90
11.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .......... . . 90

We now consider using Monte Carlo methods to estimate the price of an European option, and let us ¬rst
consider the case of the “usual” European Call, which is priced by the Black Scholes equation. Since there
is already a closed form solution for this case, it is not really necessary to use simulations, but we use the
case of the standard call for illustrative purposes.
At maturity, a call option is worth

cT = max(0, ST ’ X)

At an earlier date t, the option value will be the expected present value of this.

ct = E[P V (max(0, ST ’ X)]

Now, an important simplifying feature of option pricing is the “risk neutral result,” which implies that we
can treat the (suitably transformed) problem as the decision of a risk neutral decision maker, if we also
modify the expected return of the underlying asset such that this earns the risk free rate.

ct = e’r(T ’t) E — [max(0, ST ’ X)],

where E — [·] is a transformation of the original expectation. One way to estimate the value of the call is
to simulate a large number of sample values of ST according to the assumed price process, and ¬nd the
estimated call price as the average of the simulated values. By appealing to a law of large numbers, this
average will converge to the actual call value, where the rate of convergence will depend on how many
simulations we perform.


11.1 Simulating lognormally distributed random variables

Lognormal variables are simulated as follows. Let x be normally distributed with mean zero and variance
˜
one. If St follows a lognormal distribution, then the one-period-later price St+1 is simulated as
12
St+1 = St e(r’ 2 σ )+σx ,
˜


or more generally, if the current time is t and terminal date is T , with a time between t and T of (T ’ t),

12
ST = St e(r’ 2 σ )(T ’t)+σ T ’t˜
x


Simulation of lognormal random variables is illustrated by code 11.1.

81
#include <cmath>
using namespace std;
#include "normdist.h"

double simulate lognormal random variable(const double& S, // current value of variable
const double& r, // interest rate
const double& sigma, // volatitily
const double& time) { // time to ¬nal date
double R = (r ’ 0.5 * pow(sigma,2) )*time;
double SD = sigma * sqrt(time);
return S * exp(R + SD * random normal());
};


Code 11.1: Simulating a lognormally distributed random variable


11.2 Pricing of European Call options

For the purposes of doing the Monte Carlo estimation of the price if an European call

ct = e’r(T ’t) E[max(0, ST ’ X)],

note that here one merely need to simulate the terminal price of the underlying, ST , the price of the
underlying at any time between t and T is not relevant for pricing. We proceed by simulating lognormally
distributed random variables, which gives us a set of observations of the terminal price ST . If we let
ST,1 , ST,2 , ST,3 , . . . ST,n denote the n simulated values, we will estimate E — [max(0, ST ’ X)] as the average
of option payo¬s at maturity, discounted at the risk free rate.
n
’r(T ’t)
max (0, ST,i ’ X)
ct = e
ˆ
i=1

Code 11.2 shows the implementation of a Monte Carlo estimation of an European call option.

#include <cmath> // standard mathematical functions
#include <algorithm> // de¬ne the max() function
using namespace std;
#include "normdist.h" // de¬nition of random number generator

double
option price call european simulated( const double& S, // price of underlying
const double& X, // exercise price
const double& r, // risk free interest rate
const double& sigma, // volatility of underlying
const double& time, // time to maturity (in years)
const int& no sims){ // number of simulations
double R = (r ’ 0.5 * pow(sigma,2))*time;
double SD = sigma * sqrt(time);
double sum payo¬s = 0.0;
for (int n=1; n<=no sims; n++) {
double S T = S* exp(R + SD * random normal());
sum payo¬s += max(0.0, S T’X);
};
return exp(’r*time) * (sum payo¬s/double(no sims));
};


Code 11.2: European Call option priced by simulation




82
11.3 Hedge parameters

It is of course, just as in the standard case, desirable to estimate hedge parameters as well as option prices.
We will show how one can ¬nd an estimate of the option delta, the ¬rst derivative of the call price with
respect to the underlying security: ∆ = ‚ct . To understand how one goes about estimating this, let us recall
‚S
that the ¬rst derivative of a function f is de¬ned as the limit

f (x + h) ’ f (x)
f (x) = lim
h
h’0

Thinking of f (S) as the option price formula ct = f (S; X, r, σ, (T ’ t)), we see that we can evaluate the
option price at two di¬erent values of the underlying, S and S + q, where q is a small quantity, and estimate
the option delta as

f (S + q) ’ f (S)
∆=
q

In the case of Monte Carlo estimation, it is very important that this is done by using the same sequence of
random variables to estimate the two option prices with prices of the underlying S and S + q. Code 11.3
implements this estimation of the option delta. One can estimate other hedge parameters in a simular way.

#include <cmath> // standard mathematical functions
#include <algorithm> // de¬ne the max() function
using namespace std;
#include "normdist.h" // de¬nition of random number generator

double option price delta call european simulated(const double& S,
const double& X,
const double& r,
const double& sigma,
const double& time,
const int& no sims){
double R = (r ’ 0.5 * pow(sigma,2))*time;
double SD = sigma * sqrt(time);
double sum payo¬s = 0.0;
double sum payo¬s q = 0.0;
double q = S*0.01;
for (int n=1; n<=no sims; n++) {
double Z = random normal();
double S T = S* exp(R + SD * Z);
sum payo¬s += max(0.0, S T’X);
double S T q = (S+q)* exp(R + SD * Z);
sum payo¬s q += max(0.0, S T q’X);

<< . .

 11
( 20)



. . >>

Copyright Design by: Sunlight webdesign