37363 - Lab/Tutorial 7 Solutions

Scott Alexander

Q1

(a)

Note that
(Subscript[S, t+Δt]) = (Subscript[S, t])(e^((r-(σ^2)/2)Δt+σ (Subscript[B, Δt]))).

(* parameters and setup *)
S0=50;r=3/100;σ=4/10;TT=5;
steps=1250;n=(10^5);
dt=TT/steps;


(* creating price-path array *)
rv=RandomReal[NormalDistribution[0,(Sqrt[dt])],{n,steps}];
St=Table[S0,{n},{steps+1}];
For[i=1,i≤steps,i++,
St[[All,i+1]]=St[[All,i]]Exp[(r-(σ^2)/2)dt+σ rv[[All,i]]]
]

(* applying payoff *)
payoff=Table[0,n];
For[i=1,i≤n,i++,
min=Min[St[[i,2;;steps+1]]];
payoff[[i]]=(E^(-r TT))Max[St[[i,steps+1]]-min,0];
]

(* calculating estimated price and variance *)
z975=InverseCDF[NormalDistribution[],0.975];
Cn=Mean[payoff];
se=(Sqrt[Variance[payoff]/n]);
lb=Cn-se*z975;
ub=Cn+se*z975;
{lb,Cn,ub}

Q2

(a)

Case    s<t.

Q(t,s) = cov((Subscript[X, t]),(Subscript[X, s])) = 𝔼[(Subscript[X, t])(Subscript[X, s])]-𝔼[(Subscript[X, t])]𝔼[(Subscript[X, s])]

  = 𝔼[(e^(-t))B((e^(2t)))(e^(-s))B((e^(2s)))]-𝔼[(e^(-t))B((e^(2t)))]𝔼[(e^(-s))B((e^(2s)))]

  = (e^(-t))(e^(-s))𝔼[B((e^(2t)))B((e^(2s)))]-(e^(-t))(e^(-s))𝔼[B((e^(2t)))]𝔼[B((e^(2s)))]

  = (e^(-t))(e^(-s))𝔼[(B((e^(2t)))-Z+Z)B((e^(2s)))]-0    (you determine Z)

  = (e^(-t))(e^(-s))𝔼[(B((e^(2t)))-Z+Z)B((e^(2s)))]

Note that
𝔼[(B((e^(2t)))-Z+Z)B((e^(2s)))] = 𝔼[(B((e^(2t)))-Z)B((e^(2s)))]+𝔼[Z B((e^(2s)))]

  = 𝔼[(B((e^(2t)))-Z)(B((e^(2s)))-B(0))]+𝔼[Z B((e^(2s)))]

Take    Z=B((e^(2s)))    so that you can use independence property on first term.

That is
𝔼[(B((e^(2t)))-B((e^(2s))))(B((e^(2s)))-B(0))]+𝔼[B((e^(2s))) B((e^(2s)))]
  = 𝔼[B((e^(2t)))-B((e^(2s)))]𝔼[B((e^(2s)))-B(0)]+𝔼[B((e^(2s))) B((e^(2s)))]
  = 0*0+(e^(2s)).

So
Q(t,s) = (e^(-t))(e^(-s))(e^(2s)) = (e^(-(t-s))).


Case    t≤s.

(b)

You need to show (Subscript[X, t]):
*is Gaussian
*has constant mean
*has covariance depending on time step.

(c)

Refer Thrm 1 Ch 5.

As    (Subscript[X, t])    is Gaussian then we need to show for    s<t<u
Q(s,t)Q(t,u) = Q(s,u)Q(t,t).

(d)

var((Subscript[X, t+Δt])-(Subscript[X, t])) = var((Subscript[X, t+Δt]))+var((Subscript[X, t]))-2cov((Subscript[X, t+Δt]),(Subscript[X, t]))
  = 1+1-2(e^(-Δt))

or

var((Subscript[X, t+Δt])-(Subscript[X, t]))  = cov((Subscript[X, t+Δt])-(Subscript[X, t]),(Subscript[X, t+Δt])-(Subscript[X, t]))
  = cov((Subscript[X, t+Δt]),(Subscript[X, t+Δt]))-cov((Subscript[X, t+Δt]),(Subscript[X, t]))-cov((Subscript[X, t]),(Subscript[X, t+Δt]))+cov((Subscript[X, t]),(Subscript[X, t]))
  = 1-(e^(-Δt))-(e^(-Δt))+1

(e)

Find
cov((Subscript[X, u])-(Subscript[X, t]),(Subscript[X, t])-(Subscript[X, s])) = cov((Subscript[X, u]),(Subscript[X, t]))-cov((Subscript[X, u]),(Subscript[X, s]))-cov((Subscript[X, t]),(Subscript[X, t]))+cov((Subscript[X, t]),(Subscript[X, s]))
  = ...