Project: Option Pricing

In a time discrete financial market models we describe the evolution of a stock price in the time interval  [0,T] via the stochastic difference equation

({{(Subscript[({{S}}), k])-(Subscript[S, k-1]) = r·(Subscript[S, k-1])·Δt+σ·(Subscript[S, k-1])·(Subscript[Y, k])·(Sqrt[Δt])               (k=1,2,....,n),            (Subscript[S, 0])=(Subscript[s, 0]).}})

Here, n is the number of periods, Δt=T/n the time step, (Subscript[s, 0]) the initial stock price, and (Subscript[S, k]) the stock price at time k·Δt. The real valued random variables (Subscript[Y, 1]),(Subscript[Y, 2]),...,(Subscript[Y, n])  are iid with

({{({{E[(Subscript[Y, k])]=0          und          Var[(Subscript[Y, k])]=1.}})}})

The "drift" r and the "volatility" σ are positive constants.

One can interprete the equation above as a time discretization of the SDE underlying the Black-Scholes model. For the random variables (Subscript[Y, k]) one can choose different distributions corresponding to different time-discretizations of the SDE

Binomial model

In the simplest case, (Subscript[Y, k]) takes values +1 und -1 with probability 1/2. Then the stock price changes in each step with probability 1/2 by a factor 
({{({{u = 1+r·Δt+σ·(Sqrt[Δt])}})            resp.}})
({{({{d = 1+r·Δt-σ·(Sqrt[Δt])}})                       .}})

Discrete Black-Scholes model

A better discretization of the SDE is obtained, if (Subscript[Y, k]) are standard normal random variables, i.e.

({{({{P[a≤(Subscript[Y, k])≤b] = (∫_a^b)(1/(Sqrt[2π]))(e^(-(x^2)/2))dx}})         for all  a,b∈ℝ with a≤b.}})

Standard normal  samples can be obtained in Mathematica via RandomReal[NormalDistribution[0, 1]].

Options

An (European) option gives the owner the right to buy or sell the underlying stock at a given time for a fixed price. Its payoff is the value V at time and depends on the evolution of the stock price, i.e.

({{({{V = V((Subscript[S, 0]),(Subscript[S, 1]),...,(Subscript[S, n]))}})}})

European call option

This option gives the right to buy the stock at time n at the price K. The payoff is (Subscript[S, n])-K, if (Subscript[S, n])>K, and 0 otherwise, i.e.

({{({{V = max ((Subscript[S, n])-K,0) }}).}})

European up-and-out-barrier option

This otption has the additional restriction that it pays zero if the stock price has exceeded level B. Its payoff is thus

({{({{V = max ((Subscript[S, n])-K,0)·(Subscript[I, {(Subscript[S, l])≤B for all l=0,1,...,n}]) .}})}})

Fair option price

We have seen that the required that the model should and the price of the option should not create arbitrage opportunities allows to calculate the option price  (Subscript[v, 0]) at time 0 as follows:

({{({{(Subscript[v, 0]) = (((1+r Δt))^(-n))·E[V]}})}})

Here E[V] is the expectation under the equivalent martingale measure.

Binomial model

Here the fair price can be calculated exactly. We have

({{({{(Subscript[S, k]) = (Subscript[s, 0])·(u^(Subscript[N, k]))·(d^(k-(Subscript[N, k])))}})        (k=0,1,...,n),}})

where (Subscript[N, k])=|{1≤l≤k: (Subscript[Y, l])=1}| is the number of upward jumps during the first  ksteps. For i=0,1,2,..,k set

({{({{(Subscript[v, k,i]) = (((1+r Δt))^(-(n-k)))·E[V|(Subscript[N, k])=i].}})}})

Thus (Subscript[v, k,i]) is the fair option price at time k, if the stock price at this time equals (Subscript[S, k])=(Subscript[S, 0])·(u^i)·(d^(k-i)). In particular, (Subscript[v, 0,0])=(Subscript[v, 0]) is the fair price at time 0 we are looking for and

({{({{(Subscript[v, n,i]) = }}) max ((Subscript[s, 0])·(u^i)·(d^(n-i))-K,0)                 (i=0,1,...,n).}})

We have the recursion

({{(Subscript[({{v}}), k-1,i]) = (1/2)((Subscript[v, k,i])+(Subscript[v, k,i+1]))/(1+r Δt)               (k=n,n-1,...,1).}})

Equations (2) and (3) give the following algorithm to calculate (Subscript[v, 0]):

BinomialEuropeanCall[s0_,K_,r_,sigma_,T_,n_]:=Module[{dt,u,d,q,BinomTree,value},
dt=T/n;
u=1+r*dt+sigma*Sqrt[dt];
d=1+r*dt-sigma*Sqrt[dt];
q=1/2;
BinomTree=Table[Max[s0*u^i*d^(n-i)-K,0],{i,0,n}];
Do[
BinomTree=Table[(1/(1+r*dt))*{q,1-q}.{BinomTree[[i+2]],BinomTree[[i+1]]},
{i,0,k}],
{k,n-1,0,-1}];
value=BinomTree[[1]];
Clear[BinomTree];
value]

Similarly, one can calculate the fair price of an up-and-out-barrier option

Discrete Black-Scholes model

Here an exact computation is no longer possible but ther are several numerical methods to approximate the expaction value. One possibility are Monte Carlo methodes: One simulates N samples ((Subscript[s, 0]^((j))),(Subscript[s, 1]^((j))),...,(Subscript[s, n]^((j)))), j=1,...,N, of the stock price evolution, and estimates the expaction  ϑ=E[V] via the arithmetic mean

({{(Subscript[({{(OverHat[ϑ])}}), N]) = (1/N)(∑_(j=1)^N)((v )^((j)))}})

of the corresponding payoffs (v^((j))). In simple cases (e.g. european call options) Monte Carlo methods are not the most efficient, but they easily generalize to more exotic options where other methods fail.

Excercises

Option pricing in the binomial model

Use the algorithm above to plot the evolution of the fair price of a European call option for K=100, r=0.05, σ=0.3, T=7/365 and n=40 and starting values (Subscript[s, 0]) between 90 and 120. Why is this evolution not so suprising?

To analyze the effect of the number of time steps on the price, plot the evolution of the fair price with the above parameters for n between 20 and 140 and between 20 and 1200. How could you get a mor accurate result with less time steps?

To calculate the price of an up-and-out-barrier option, consider for k=n,n-1,...,0 the values
({{({{(Subscript[v, k,i]) = (((1+r Δt))^(-(n-k)))·E[(Subscript[V, k])|(Subscript[N, k])=i]                     (i=0,1,...,k),}})}})
with({{({{(Subscript[V, k]) := max ((Subscript[S, n])-K,0)·(Subscript[I, {(Subscript[S, l])≤B for l=k,k+1,...,n}]) .}})                                        }})
Show the recursion
({{(Subscript[({{v}}), k-1,i]) =(Piecewise[{{(1/2)((Subscript[v, k,i])+(Subscript[v, k,i+1]))/(1+r Δt) , if  (Subscript[s, 0])·(u^i)·(d^(k-i))≤B }, {0, if  (Subscript[s, 0])·(u^i)·(d^(k-i))>B}}])                }})
with initial condition
({{({{(Subscript[v, n,i]) =(Piecewise[{{max ((Subscript[s, 0])·(u^i)·(d^(n-i))-K,0),        if  K<(Subscript[s , 0])·(u^i)·(d^(n-i)) <B}, {0,        else.}}])}})}})
Modify the algorithm above to get a Mathematica funktion BinomialEuropeanUO[s0_, K_,B_, r_, sigma_, T_, n_], that calculates the price of the european up-and-out-barrier option.

Plot the evolution of the price for K=100, B=120, r=0.05, σ=0.3, T=7/365 and n=40 resp. n=200  with (Subscript[s, 0]) between  90 and 120. Why does the price increase up to a certain value and then starts to fall?

In practice, it is important to calculate the “greeks”, i.e. the derivative of the option price w.r.t. the parameters(Subscript[s, 0]), r, σ... accurately in order to hedge the option. Why is the binomial model not very suitable to calculate the “Delta”, i.e. the derivative wrt. (Subscript[s, 0]) for the up-and-out call?

Option pricing in the discrete Black-Scholes model

Simulate N=50 stock price evolutions with the parameters from1.4 with (Subscript[s, 0])=100 and (Subscript[s, 0])=115. and plot them.

Write Mathematica funktiones EuropeanCallMC[s0_, K_, r_, sigma_, T_, n_, N_] and EuropeanUOMC[s0_, K_, B_,r_, sigma_, T_, n_, N_], generating a list  {(v^((1))),...., (v^((N)))} of payoffs for european call and up-and-out barrier options for N simulated stock price evolutions. (Mind the memory efficency, you do have to store the full evolution of the stock price!)

Calculate Monte-Carlo estimators (Subscript[(OverHat[ϑ]), N]) for the expectation ϑ=E[V] and (Subscript[(OverHat[σ]), N]) for the variance σ(V). As Monte-Carlo estimator for the variance you can take
({{(Subscript[({{(OverHat[σ])}}), N]) =(Sqrt[ (1/(N-1))(∑_(j=1)^N)(((((v )^((j)))-(Subscript[(OverHat[ϑ]), N])))^2)])}})
Calculate the estimated fair option price (Subscript[v, 0]) for the parameters above and N=10000. Compare to the results for the binomial model.

For the same parameters, calculate Monte-Carlo estimators for 
({{({{Delta  := (((1+r Δt))^(-n))·((∂E[V])/(∂(Subscript[s, 0])))}})}})
For this, simulate  price evolutions (v^((j))) and  (w^((j))) with start (Subscript[s, 0]) and (Subscript[s, 0])+h (e.g. h=0.1) using the same random numbers, and use the estimator
({{ (1/N)(∑_(j=1)^N)((((w )^((j)))-(v^((j))))/h)}})
for the difference quotient.