advanced term structure practice chapter 5 copyright 2004, david heath

38
Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Upload: marilynn-robbins

Post on 12-Jan-2016

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Advanced Term Structure PracticeChapter 5

Copyright 2004, David Heath

Page 2: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Questions

• What about the “unevenness” of the tree steps?– They get more even as they get deeper: The

steps for the 5-deep tree are (1/50.5=.4472) {0.437}, { 0.272 0.272}, {0.553 0.550 0.550 0.553},

{0.410 0.339 0.398 0.293 0.293 0.398 0.340 0.410},

{0.590 0.574 0.456 0.545 0.578 0.516 0.538 0.559 0.559 0.538 0.516 0.578 0.545 0.456 0.574 0.590}

• Other questions?

Page 3: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Handling Term Structures

• We’ll need to– Create term structures– Modify term structures– Use term structures to value cash flow streams

• We need lots of term structures (in a tree)• Lots of dates are important:

– Date term structure is observed (t) (one per t.s.)– Dates of forward rates (T) (lots of these per t.s.)

Page 4: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

One term structure

• Observed at date t

• Term structure is a function f(t,)

• We’ll think of this as an “object” so– data structure will be private– can access data only through methods– we’ll have to provide methods

Page 5: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Model rates as “locally constant”

• (You don’t have to do it this way, but …) It turns out to be simplest to store integrals of rates:

• For each of many T’s, store the integral of f(t,u)du from u=t0 to u=T for some fixed

t0 (it doesn’t matter which!)

• f will be assumed to be piecewise constant• Store the “knot times” and corresponding values

of the integral

Page 6: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

What we need

• We can then get the integral up to any value of T by using linear interpolation of the values at the “knots”

• We’ll keep our representation private• We’ll provide methods to

– Generate and store a term structure

– return integrals of the forward rates• (easy: it’s just the difference of two values of the integral of f,

which we get by interpolation)

Page 7: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

The class TermStructure

class TermStructure {

int npoints;

double *times, *integrated_rates;

public:

TermStructure(int n, double *t, double *r);

TermStructure(char* filename, long julian_analysis);

~TermStructure();

Page 8: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

TermStructure (continued)

void add_breakpoints(int extran, double* extratimes);

double f_integral(double tstart, double tend);

void print();

double crude_Tbond_price(double timenow, double tmat, double coupon);

};

• Let’s take these one at a time:

Page 9: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Members of TermStructure

• Data Membersint npoints;

double *times, *integrated_rates;

– npoints: Number of points at which times are given and integrated rates are stored

– times: Pointer to the times array– integrated_rates: Pointer to the array in which

the integrated rates are stored

Page 10: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

TermStructure Members

• Member Functions:TermStructure(int n, double *t, double *r);

A constructor. The calling routine must supply the arrays of times and integrated rates; n is the number of entries in each array

TermStructure(char* filename, long julian_analysis);A constructor which reads pdb prices (in points and 32nds) from a file and constructs a term structure

~TermStructure(); The destructor. Deletes the arrays containing times and integrated rates.

Page 11: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Some details

• The file format for the second constructor is– first line contains number of pdb prices given– Subsequent lines contain

• month year points 32nds (where month and year specify maturity date of bond, and rest is price).

• julian_analysis gives the julian date at which these prices were observed

Page 12: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

More details

• Julian dates: “day-numbers” counted from some origin. I’ll provide a routine to compute Julian dates from year, month, day

• Times in TermStructures are measured in years. Usually to keep times small, t=0 is taken to be the analysis date (fixed for a given run of the code)

• # of days/year = ? (I usually use 365.25.)

Page 13: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Member Functions

• add_breakpoints(int extran, double* extratimes)– Sometimes we’ll want to further subdivide the

time axis used to specify a TermStructure. This routine does that. (We’ll need to arrange things so the “times array” elements are strictly increasing.)

– We must interpolate to get the corresponding value of integrated_rates. (I’ll provide a simple linear interpolator.)

Page 14: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Member Functions (cont’d)

• f_integral(double tstart, double tend);– Returns the integral of the forward rates over

the interval [tstart, tend]. – Uses the interpolation routine at each endpoint

• print();– Prints the forward rates to “cout”.– Might want to make it “nice” so that you can

read rates into EXCEL for graphing, etc.

Page 15: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Member Functions (cont’d)

• crude_Tbond_price(double timenow, double tmat, double coupon);– Returns a “crudely calculated” price for a

Treasury-style note or bond– timenow tells date in years (with t=0

corresponding to the “analysis date” as above)– tmat tells date of maturity (units as above)– coupon tells the annual coupon (on an assumed

principal of 100)

Page 16: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

The Crude T-Bond calculation

• Prices returned should be “clean prices” (see Hull); this means price = discounted present value of coupons and principal MINUS accrued interest

• We’ll assume that coupons occur at spacing of exactly 0.5 years (and are each equal to half of the annual coupon). (Work back from maturity.)

Page 17: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Assignment for next week

1. Build an implementation for the class TermStructure.

2. Write a simple “main” program to – Use analysis date September 20, 2004

– Construct a TermStructure using the input file “bonds.in” which I’ll provide (in bondstuf.zip)

– Print this term structure

– “Subdivide” the term structure so by inserting breakpoints every 0.25 years

Page 18: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Assignment (cont’d)– Print the subdivided term structure– Graph the subdivided term structure– Price the following bonds (clean):

• 11.625 Nov 04 (Matures November 15,2004)

• 1.875 Dec 05n (Matures December 31, 2005)

• 6.625 May 07n (Matures May 15, 2007)

• 4.000 Jun 09n (Matures June 15, 2009)

– Turn in your code for this homework – (Prices of these in Sept. 21 newspaper were:

• 101:15 Bid, 101:16 Ask; 99:22 Bid, 99:23 Ask;

110:05 Bid, 110:06 Ask; 103:13 Bid, 103:14 Ask)

Page 19: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Where the provided stuff is

• The julian date conversion routine and the interpolation routine are in the files: – Julian.cpp, julian.hpp– Interp.cpp, interp.hpp

• The input file of pdb prices:– bonds.in

• These are available at www.math.cmu/~heath in bondstuf.zip

Page 20: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

How to use “interpolate”

• interpolate(double x, int n, double* xs, double* ys);– Returns linearly interpreted value of a function– x: value of x for which f(x) is to be returned– n: number of values of x for which f(x) is

provided (in the array xs)– xs: array with n points at which function values

are given– ys: array containing the given function values

Page 21: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Advanced Term Structure Practice

Swaps, Swaptions and AAA Subsidiaries

Chapter 6Copyright 2004 David Heath

Page 22: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

What is a swap?

• Simplest definition: a swap is an agreement between two counterparties to exchange a sequence of cash flows.

• Simplest “plain vanilla” interest rate swap:• A agrees to pay B a fixed coupon every 3 months

for 5 years• B agrees to pay A the 3-month LIBOR rate on a

fixed notional amount for 5 years (paid as it would be for a LIBOR loan).

Page 23: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

What isn’t a swap?

• I’m not sure!• Fact: A loan can be “documented as a swap.”• Swaps can contain a “built-in optionality”: A pays

B at 3 month LIBOR rate, B pays A at minimum of (5%) and (the yield on a 10 year CMT) or:

• A pays only when LIBOR is between 5% and 6%

Page 24: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

How do swaps arise?

• Simple example: A corporation wants to borrow

• Can issue corporate bonds; usually issued at a fixed coupon

• Would prefer to pay floating rate

• Arranges with a bank for a swap in which the firm pays floating and receives fixed

Page 25: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

What are the risks?

• Largest risk (usually): interest rate risk

• Another common risk: currency rates (for cross-currency swaps)

• Risk of counterparty default (these are not exchange traded; nobody guarantees performance of counterparty, but there are “insurance” contracts.)

Page 26: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Default Risk

• Swap “value” at start of deal is essentially 0• As interest rates (or currencies, etc.) move, swap

value drifts away from 0.• When counterparty defaults, our position value

could be negative (we anticipate paynig more than we’ll get) or positive

• If negative, we have to pay up (in full) or continue the swap

• If positive, we try to collect (10 cents/$?)

Page 27: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Default risk vs Currency risk

• Very similar!• Suppose that, for example, the government of

Switzerland enters into a swap in which they pay a fixed interest rate in Swiss Francs; it doesn’t matter what they collect in. (Counterparty is a US bank)

• They won’t default! (They can print francs!)– There’s currency risk, but not default risk

• If the swap called for $ payments– There’s default risk (for US bank, but no currency risk!

Page 28: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

An aside about default risk

• In fact, HJM models can be used to model credit risk (and credit spreads)– First step: consider two countries, with a

random exchange rate process and random term structure evolution in each.

– Second step: re-write contract so that firm pays in “claims on the firm” instead of $

– Imagine these claims as a “currency”.

• (Example: Disney bonds.)

Page 29: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Netting

• Suppose a bank has several swaps with same counterparty

• Some may have positive value and some negative• If counterparty defaults, we’ll have to pay full

amount we owe on each, but only collect a fraction of what’s owed to us

• Netting says: all deal’s values are added; this amount is what’s owed on default.

Page 30: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Is netting legal?

• It puts some “creditors” ahead of others in case of default (i.e., bank gets a better deal than other creditors if firm defaults).

• Netting only works if government has passed netting legislation.

• Netting laws might or might not hold up when tested

Page 31: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Banks might default

• Firms have to worry about whether bank will fail

• Some counterparties (foreign governments, for example) may only deal with AAA bank

• Many banks aren’t AAA

• Solution: Bank sets up AAA subsidiary

• (I’m on board of directors of 2 of these)

Page 32: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

How a AAA sub works

• Bank “passes deals through” AAA sub• May do hedging “through” the sub as well• Subsidiary does only swaps business• Subsidiary has “lots” of capital• Obtains “understandings” with rating

agencies (Moody’s, S&P, etc.) on what sort of management, capital, etc. is needed to keep AAA rating.

Page 33: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Why the sub is a better swap counterparty than parent

• If sub fails but parent survives, parent covers losses (if not contractually, then just to protect “reputation”)

• Sub’s “understandings” with rating agencies may include:– Restrictions on allowed counterparties– Requirements for risk analysis– Capital and liquidity requirements– Restrictions on overall portfolio of sub– Detailed auditing to prevent “Leeson effect”– Independent directors on board

Page 34: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Continuation vs Termination

• Some subs are designed to survive failure of their parent; i.e., to service their swap portfolio until deals die

• Others are designed to terminate all deals if their parent fails

• Continuation vehicles have higher capital requirements, hence higher costs

• Firms prefer continuation vehicles, bud don’t like higher costs

• Lehman has two AAA subs, one of each.

Page 35: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Swaptions

• A swaption is an option to enter into a swap• Banks often enter into Bermudan swaptions

with firms• Banks trade European swaptions• Odd fact: Many swaptions look “cheap”

(compared to, say, caps)– (only visible when one tries to use the same

model to value both caps and swaptions!)

Page 36: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Why are swaptions cheap?(Morton’s conjecture)

• Of course, nobody knows• Morton: supply and demand!• Banks as a whole are long swaptions

– When firm issues coupon bonds, they’re often callable.

– Usually this call feature is passed on to banks when firm swaps into floating

– Firms end up with lots of swaptions• So they don’t pay much for getting them!

Page 37: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Collateral

• Swaps now may require posting of collateral

• Collateral amount is approximately equal to current “mark” of position

• Requirement is usually symmetric (each side may need to post collateral)

• This makes swaps which look more like futures contracts

Page 38: Advanced Term Structure Practice Chapter 5 Copyright 2004, David Heath

Swaps with collateral

• If they become “futures-like” should they be valued differently?

• In general, the “futures price” is not equal to the value of the “corresponding” forward contract

• With futures contracts, interest works differently (who gets it?)

• With AAA subs, cost of capital is usually higher than interest earned on collateral.