advanced term structure practice week6a implementing multifactor hjm copyright 2004 david heath
TRANSCRIPT
Advanced Term Structure Practice
Week6aWeek6a
Implementing Multifactor HJMImplementing Multifactor HJM
Copyright 2004 David HeathCopyright 2004 David Heath
Multifactor HJM
ddttf(t,T)=f(t,T)=11(t,T)dW(t,T)dW11(t)+(t)+22(t,T)dW(t,T)dW22(t)+drift(t)+drift
We’ll choose drift to make discounted pdb We’ll choose drift to make discounted pdb prices martingalesprices martingales
To approximate evolution, need to To approximate evolution, need to approximate dWapproximate dWii(t)(t)
We’d like to use “tricky trees” if possibleWe’d like to use “tricky trees” if possible But …But …
Approximating Brownian Motion in two (or more) dimensions We’ll use a random walkWe’ll use a random walk Let Z=(ZLet Z=(Z(1) (1) ,Z,Z(2) (2) ) be a two-dimensional ) be a two-dimensional
random variablerandom variable Suppose E(ZSuppose E(Z(1) (1) )=E(Z)=E(Z(2) (2) )=0)=0 Suppose E(ZSuppose E(Z(i)(i)))22= 1 for i=1,2= 1 for i=1,2 Suppose E(ZSuppose E(Z(1) (1) ZZ(2) (2) ) = 0.) = 0. Shorthand: E(Shorthand: E(ZZ) = ) = 00, ,
VCV(VCV(ZZ)=Identity matrix)=Identity matrix
The multidimensional Central Limit Theorem SetSet
The The ZZ’s are assumed i.i.d.’s are assumed i.i.d. Fact: The distribution of SFact: The distribution of Sn n tends to the two-tends to the two-
dimensional standard normal distribution (as n dimensional standard normal distribution (as n tends to infinity) tends to infinity)
As in the one-dimensional case, the scaled As in the one-dimensional case, the scaled “running sums” of the “running sums” of the ZZ’s converge weakly to ’s converge weakly to two-dimensional Brownian motiontwo-dimensional Brownian motion
n
iin Z
nS
1
1
The first example:
Suppose Suppose ZZ takes on the values (1,1), (1,-1), (-1,1), takes on the values (1,1), (1,-1), (-1,1), and (-1,-1) with equal probability.and (-1,-1) with equal probability.
E(ZE(Z(1)(1) ) = (1/4)*(1+1+(-1)+(-1)) = 0 ) = (1/4)*(1+1+(-1)+(-1)) = 0 E(ZE(Z(2)(2) ) = (1/4)*(1+(-1)+1+(-1)) = 0 ) = (1/4)*(1+(-1)+1+(-1)) = 0 E((ZE((Z(1)(1) ) )22)=(1/4)*(1+1+1+1)=1=E((Z)=(1/4)*(1+1+1+1)=1=E((Z(2)(2) ) )22)) E(Z(1) Z(2) ) = (1/4)*(1+(-1)+(-1)+1)=0E(Z(1) Z(2) ) = (1/4)*(1+(-1)+(-1)+1)=0 This This ZZ works! But: HJM code based on this works! But: HJM code based on this ZZ
would have 4 descendants for each node.would have 4 descendants for each node. We can do better …We can do better …
The second example:
Choose three points “evenly spaced” on the Choose three points “evenly spaced” on the circle of radius circle of radius
Points can be written Points can be written times times (cos((cos(),sin(),sin()), (cos()), (cos(+120+120oo),sin(),sin(+120+120oo)), )), (cos((cos(+240+240oo),sin(),sin(+240+240oo))))
Let Let ZZ take on each of these values with take on each of these values with probability 1/3.probability 1/3.
Fact: Fact: ZZ has correct mean, VCV has correct mean, VCV
This is almost what we want!
Each node will have 3 descendantsEach node will have 3 descendants This provides a good approximation to Brownian This provides a good approximation to Brownian
motionmotion Could be useful for investigating on option on a Could be useful for investigating on option on a
basket of securities in Black-Scholes world, etc.basket of securities in Black-Scholes world, etc. May be inefficient for term structure valuation May be inefficient for term structure valuation
because second factor is usually less important, because second factor is usually less important, and we spend equal “energy” on each with this Z.and we spend equal “energy” on each with this Z.
I don’t see how to do tricky trees …I don’t see how to do tricky trees …
The third example
Consider a random variable Consider a random variable ZZ taking on values: taking on values: (+1, 0) with probability ½ (+1, 0) with probability ½
(-1, (-1, ) with probability ¼ ) with probability ¼ and and (-1, -(-1, -) with probability ¼) with probability ¼
or we could let Z take on values or we could let Z take on values (-1, 0) with probability ½ (-1, 0) with probability ½
(+1, (+1, ) with probability ¼ ) with probability ¼ and and (+1, -(+1, -) with probability ¼; ) with probability ¼; I’ll call this the “flipped Z”.I’ll call this the “flipped Z”.
Means and Variances It’s clear that E(ZIt’s clear that E(Z(1)(1) ) = E(Z ) = E(Z(2)(2) ) = 0. ) = 0. E((ZE((Z(1)(1)))22) = ½ *(1)) = ½ *(1)22 + ¼ * (-1) + ¼ * (-1)22 + ¼ * (-1) + ¼ * (-1)22=1=1 E((ZE((Z(2)(2)))22) = ½ *0) = ½ *022 + ¼ * ( + ¼ * ())22 + ¼ * (- + ¼ * (- ))22=1=1 And E(ZAnd E(Z(1)(1)ZZ(2)(2))= ½ * 1 * 0 + ¼ * (-1) * )= ½ * 1 * 0 + ¼ * (-1) *
Hence: ThisHence: This Z Z works. works.
Some observations
Each node has 3 descendantsEach node has 3 descendants We might use We might use ZZ at odd depths and “flipped” at odd depths and “flipped” ZZ at at
even depthseven depths We could still scale these Z’s as we did with We could still scale these Z’s as we did with
“tricky trees”“tricky trees” The motion of Z(1) is the same for a one-factor The motion of Z(1) is the same for a one-factor
and a two-factor model, so we gain the advantages and a two-factor model, so we gain the advantages of tricky trees for it.of tricky trees for it.
The weak convergence result shows that we still The weak convergence result shows that we still get weak convergence to Brownian motionget weak convergence to Brownian motion
Adding this to the HJM code
To do a two-factor model you’ll need to To do a two-factor model you’ll need to have two sigma functions. You could either have two sigma functions. You could either introduce an argument to the sigma function introduce an argument to the sigma function you have (and its integral) telling which one you have (and its integral) telling which one you want to use, or you could write you want to use, or you could write additional functions for sigma2.additional functions for sigma2.
You have to be able to “branch” using You have to be able to “branch” using either of these sigma functionseither of these sigma functions
Implementation
At each depth, you must find the value of At each depth, you must find the value of jumpsize to use (= “scaled jumpsin”).jumpsize to use (= “scaled jumpsin”).
Use this value to call your branching routines to Use this value to call your branching routines to branch, using the first factor, with this jumpsize.branch, using the first factor, with this jumpsize.
Then, select one of the resulting two term Then, select one of the resulting two term structuresstructures The same one every time, or alternate by depth, The same one every time, or alternate by depth,
or …or … Branch, using the second factor, with size Branch, using the second factor, with size
*jumpsize, getting two new term structures *jumpsize, getting two new term structures
Implementation continued
This gives three term structures (the This gives three term structures (the unselected one from the first step and the unselected one from the first step and the two generated by the second branching)two generated by the second branching)
Recursively call your valuation routine once Recursively call your valuation routine once for each of these. Average the resulting for each of these. Average the resulting values with probabilities ½, ¼ and ¼, and values with probabilities ½, ¼ and ¼, and discount the value (which you then return).discount the value (which you then return).
3 or more factors
This idea easily extends to three factors: This idea easily extends to three factors: Let Z be a 3-dimensional random variable taking Let Z be a 3-dimensional random variable taking
on valueson values (1, (1, ,0) with probability ¼,0) with probability ¼ (1,- (1,- ,0) with probability ¼,0) with probability ¼ (-1,0, (-1,0, ) with probability ¼) with probability ¼ (-1,0,- (-1,0,- ) with probability ¼.) with probability ¼.
It’s a simple calculation to see that Z works.It’s a simple calculation to see that Z works.
What about accuracy? One factor tree with depth 16 is same order of work as a One factor tree with depth 16 is same order of work as a
three factor tree of depth 8.three factor tree of depth 8. The error vs work computation fails.The error vs work computation fails.
Suppose we put in Suppose we put in 22 and and 33 equal to 0. equal to 0.- We’ll get exactly the same answers using one factor as We’ll get exactly the same answers using one factor as
we get using all three.we get using all three.- Work is like 4Work is like 4(depth of tree)(depth of tree), the square of what we had before, the square of what we had before- Hence, at best error decreases as 1/square of work)Hence, at best error decreases as 1/square of work)- Also, tricky tree proof doesn’t work for 2Also, tricky tree proof doesn’t work for 2ndnd and 3 and 3rdrd
factors!factors!
Hence:
For 3-factor model, simulation looks For 3-factor model, simulation looks attractive.attractive.
But – for American or Bermudan options, But – for American or Bermudan options, simulation doesn’t work easily!simulation doesn’t work easily!
Thus: for American (or Bermudan)-style Thus: for American (or Bermudan)-style options may want to use trees.options may want to use trees.
Advanced Term Structure Practice
Bermudan and American OptionsBermudan and American Options
Week6bWeek6b
Copyright 2004 David HeathCopyright 2004 David Heath
Tricky trees and American or Bermudan Options Tricky trees aren’t very deepTricky trees aren’t very deep Process is reasonably well described at only Process is reasonably well described at only
a few timesa few times Bermudan/American options difficultBermudan/American options difficult Methods are approximate; are justified only Methods are approximate; are justified only
because of their convergencebecause of their convergence Need to review convergence of random Need to review convergence of random
walk to Brownian motionwalk to Brownian motion
Convergence of Random Walks to Brownian Motion See section 13.4 of Professor Shreve’s notesSee section 13.4 of Professor Shreve’s notes Basic idea: Basic idea:
Let XLet Xjj = +/-1, probability ½ each, independent = +/-1, probability ½ each, independent Set MSet Mkk to be the sum of the first k X to be the sum of the first k Xii’s’s Set BSet B(n)(n)(t) = M(t) = Mkk / /n if t=k/n n if t=k/n
This defines BThis defines B(n)(n)(t) for t=0, 1/n, 2/n, 3/n, …(t) for t=0, 1/n, 2/n, 3/n, … Linearly interpolate to define BLinearly interpolate to define B(n)(n)(t) for all t>0(t) for all t>0
BB(n)(n) converges to Brownian motion as n tends to converges to Brownian motion as n tends to infinity.infinity.
A picture
-5
-4
-3
-2
-1
0
1
2
3
4
0 2 4 6 8 10
Some properties of this process
If we use this process at times of of the form k/n If we use this process at times of of the form k/n increments are independentincrements are independent
Each coin toss is known at the beginning of each Each coin toss is known at the beginning of each interpolation (before it fully takes effect!)interpolation (before it fully takes effect!)
If we used this to model stock prices in continuous If we used this to model stock prices in continuous time (i.e., stuck it in for W(t) in the Black-Scholes time (i.e., stuck it in for W(t) in the Black-Scholes stock price model) and used the “observable” stock price model) and used the “observable” sigma fields, there would be arbitrage!sigma fields, there would be arbitrage!
To avoid arbitrage:
Could simply allow at most one observation Could simply allow at most one observation of the state along each “piece”of the state along each “piece”
Or – could change the interpolation:Or – could change the interpolation: Fix n. For any t, let iFix n. For any t, let i(n)(n)(t) = (t) =
floor(n*t+0.5) = value of n*t rounded to floor(n*t+0.5) = value of n*t rounded to the nearest integerthe nearest integer
Set DSet D(n)(n)(t) = M(t) = Mkk / /n where k = in where k = i(n)(n)(t).(t). Results in a “lattice” of a different shape:Results in a “lattice” of a different shape:
A no-arbitrage evolution
t=0/n =1/n =2/n
root: (these might recombine)
Along the flat lines there is no “random” component to the evolution, but there should be no arbitrage (so prices should grow at the interest rate …)
More explicitly
Set S(t)=S(0)exp(Set S(t)=S(0)exp(*D*D(n)(n)(t) + r * t + a term (t) + r * t + a term to get to get rid of arbitrage from the jumps)rid of arbitrage from the jumps)
The The * D * D(n)(n)(t) is what makes the jumps(t) is what makes the jumps The “term to get rid of arbitrage from the jumps” The “term to get rid of arbitrage from the jumps”
is the usual “correction” used in the lattice for is the usual “correction” used in the lattice for jumpsjumps
The r*t term is to prevent arbitrage while there are The r*t term is to prevent arbitrage while there are no jumps (prices must grow at the interest rate). no jumps (prices must grow at the interest rate).
For interest rate models Holding the term structure constant doesn’t cause Holding the term structure constant doesn’t cause
arbitrage.arbitrage. We want to use “tricky trees”We want to use “tricky trees” Here’s how: Here’s how:
For the jumpsin table you can compute, for each For the jumpsin table you can compute, for each depth, the variance of the approximation to depth, the variance of the approximation to Brownian motion at that depthBrownian motion at that depth
The correct “time” (when the variance is right) for The correct “time” (when the variance is right) for that depth is equal to this variance.that depth is equal to this variance.
Make the evolution “piecewise constant” with jumps Make the evolution “piecewise constant” with jumps occurring halfway between “variance OK” timesoccurring halfway between “variance OK” times
(piecewise constant means that the forward curve (piecewise constant means that the forward curve doesn’t change during the time interval)doesn’t change during the time interval)
Using this approach …
You know the state of the system at every You know the state of the system at every (real-valued) time.(real-valued) time.
You could “check exercise” of an American You could “check exercise” of an American option as often as you want.option as often as you want.
You can check the exercise of a Bermudan You can check the exercise of a Bermudan option whenever you need to.option whenever you need to.
How to figure out what to do and when Make a list of times and what’s to be done at these Make a list of times and what’s to be done at these
timestimes Example: Define codes:Example: Define codes:
Code 1 means discount the value to today’s Code 1 means discount the value to today’s datedate
Code 2 means discount and check exerciseCode 2 means discount and check exercise Code 3 means discount and branch (or split) Code 3 means discount and branch (or split) Etc…Etc…
An example:
c[0]=1 means “discount”c[0]=1 means “discount” c[1]=3 means “discount and return (undo branch)”c[1]=3 means “discount and return (undo branch)” c[2]=2 means “discount and check exercise”c[2]=2 means “discount and check exercise”
All actions take place as you move backward (toward the All actions take place as you move backward (toward the root of the tree)root of the tree)
You have to modify the recursive code to take care of You have to modify the recursive code to take care of these other actions when they should occurthese other actions when they should occur
2233223311c(i)c(i)
1.3331.3331.01.0.666.666.333.33300t(i)t(i)
For Bermudan options with few exercise dates The previous method doesn’t model the distribution well at The previous method doesn’t model the distribution well at
predetermined timespredetermined times You can model well at a few predetermined times (say tYou can model well at a few predetermined times (say t11, t, t22, ,
tt33, …) by:, …) by: Choose a tree of small depth (say depth 3) to model the Choose a tree of small depth (say depth 3) to model the
evolution from t=0 to t=tevolution from t=0 to t=t11
Choose a tree of small depth to model the evolution from Choose a tree of small depth to model the evolution from t=tt=t11 to t=t to t=t22
etc.etc. This results in getting a decent joint distribution of the This results in getting a decent joint distribution of the
process at times tprocess at times t11, t, t22, t, t33, …, …
Advanced Term Structure Practice
Week6cWeek6c
CalibrationCalibration
Copyright 2004, David HeathCopyright 2004, David Heath
Final Exam Regularly scheduled exam:Regularly scheduled exam:
5:30-8:30 p.m. Friday, October 22.5:30-8:30 p.m. Friday, October 22.Pittsburgh students in MellonPittsburgh students in MellonNYC students at 55 BroadNYC students at 55 Broad
Make-up exam:Make-up exam: 5:30-8:30 p.m. Wednesday October 205:30-8:30 p.m. Wednesday October 20 Pittsburgh students in 153 TepperPittsburgh students in 153 Tepper NYC students at 55 BroadNYC students at 55 Broad
Bring Hull’s book with you – in caseBring Hull’s book with you – in case Basic idea: I’ll ask you to do something new with Basic idea: I’ll ask you to do something new with
your code.your code.
What to calibrate to? Bonds or swapsBonds or swaps OptionsOptions
SwaptionsSwaptions CapsCaps
For today, we’ll use swaps and swaptionsFor today, we’ll use swaps and swaptions Swap rates:Swap rates:
All-in Swap Rates
Swaption Volatilities
Swap Length ->Option- Expiry
Must get forward rates and swaption prices. Forward rates:Forward rates:
Piecewise flat 0-3, 3-5, 5-10, …)Piecewise flat 0-3, 3-5, 5-10, …) Spline (not much data!)Spline (not much data!) Smooth curve which explains pricesSmooth curve which explains prices
Choose a forward rate for each 6-month Choose a forward rate for each 6-month periodperiod
360 degrees of freedom!360 degrees of freedom!Minimize objective function:Minimize objective function:
2
12 )(*price)ith in error ( jj ffK
Forward Curve … results of smooth fit
Forward rate
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0 50 100 150 200 250 300 350 400
Forward rate
Getting swaption prices from swaption vols See Hull’s book (in 3See Hull’s book (in 3rdrd Ed., p. 404) Ed., p. 404)
L = notionalL = notional A = PV of $1 at each interest dateA = PV of $1 at each interest date m = number of periods/year (=2)m = number of periods/year (=2) RRXX = rate of underlying swap = rate of underlying swap F = fair forward swap rateF = fair forward swap rate ddii “as usual” (see Hull) “as usual” (see Hull)
)()( 12 dFdRm
LAX
Swaption (market) prices
With HJM prices using historical volatility functions
Market
HJM hist
Changing the volatility
0
0.05
0.1
0.15
0.2
0.25
0 5 10 15
Historical
Implied
Resulting HJM prices
A more ambitious fit
dtdWTtfMTtTtfd tt drift)()),(,min(),(),(
Choose (t,T) (at lots of t’s and T’s) to match prices
Interpolate (bilinear interpolation?) to define everywhere
Reports: have trouble with wild behavior