程序代写 Lesson 3: Hedging with Minimum Cost, Multi-period Discounting, Bonds Econom

Lesson 3: Hedging with Minimum Cost, Multi-period Discounting, Bonds Economics of Finance
School of Economics, UNSW

Market is incomplete: 40 Good Weather

Copyright By PowCoder代写 加微信 powcoder

Bond Stock
Fair Weather Bad Weather
43 Good Weather Fair Weather
Hedging at Minimum Cost
pS = 􏰀19 35􏰁
Bond Stock
Our objective is to construct the cheapest portfolio, n, that will deliver as least as much as c in every state of nature.
Bad Weather

Linear programming
• Our problem is to select a portfolio, n, to minimize its cost, pS · n, subject to obtaining no less than the required state-contingent payment, c.
• A constrained optimization problem we have to solve is given by
min pS · n subject to Q · n ≥ c. n
• Note: we use the sign ≥ to indicate that every element of vector Q · n is no less than the corresponding element of vector c.
• We are facing a linear programming problem, or simply the problem of finding a vector that minimizes a linear function subject to linear constraints.

Hedging at Minimum Cost
Matlab functions provide us with several tools for solving linear programming problems. They solve this general problem (I use their notation):
min f′ · x subject to A · x ≤ b. x
• linprog(f, A, b) in Matlab.

Linear programming
We will ask this function to perform the simplest task:
• In our context, the role of x played by portfolio vector, n. Note f is assumed as a column vector. The role of f′ is performed by row vector pS.
• this function deals only with inequalities of the form: A · x ≤ b. Let’s multiply both sides of our constraint, Q · n ≥ c, by −1 to obtain −Q · n ≤ −c
• Hence, the role is A is played by −Q, while the role of b is played by −c.

Matlab: Hedging at Minimum Cost
Enter the data in MATLAB’s command prompt:
>> Q = [20 43; 20 28; 20 28];
>> c = [40 30 20]′;
>> ps = [19 35];
Use the linear programming function linprog >> n = linprog(ps′,-Q,-c)
The result of running these commands is:
n= 0.5667 0.6667
The price of the portfolio is:
>> p = ps*n p = 34.1000

Wrapping up
Hedging involves fully covering contingent payments/liabilities and offsetting risks
• With complete market, this involves replicating desired payments/liabilities;
• With incomplete market, perfect hedging is can not be achieved;
• The ideal hedging then involves hedging with minimum cost;
• This can be done using Matlab ”linprog” function;
• Completing the market will generally reduce deadweight loss associated with incomplete hedging.

Multi-period (Variable) Discount Factors
Definition: A nominal discount factor, df(t), is the present value of one unit of currency to be paid with certainty at time t. Notation:
• Discount factor {1×periods}:
df=􏰀df(1) df(2) df(3)􏰁
• Vector of cash flows known to be certain {periods×1}:
cf (1) cf = cf(2)

Discounted present value of the cash flows: pv = df · cf

Example: Coupon bonds with different maturities
• The Payment Matrix {periods×bonds}: B1 B2 B3
103 4 3Year1 Q =  0 104 3  Year 2 0 0 103 Year 3
• The Price Vector {1×bonds}:
p = 􏰀100 101 98􏰁

Inferring the discount function
• In matrix notation: p = df · Q
• If Q−1 exists, the discount function can be inferred as
df = p · Q−1;
• Since Q−1 exists, the discount function is
103 4 3−1 df =􏰀100 101 98􏰁0 104 3
(1×Years) 0 0 103 = 􏰀0.9708 0.9338 0.8959􏰁
• Any desired set of future certain payments over the next three years can be valued using this discount function.

• Let c = 􏰀300 200 103
n=Q−1c= 0 0
100􏰁′, then the replicating portfolio is
Replicating bond portfolio
• To find a portfolio of the three bonds that will replicate a desired set of certain cash flows we can use
Q·n=c (Years×Bonds) (Bonds×1) (Years×1)
3 −1 300  2.8107  B1
3  200=1.8951 B2 103 100 0.97087 B3

Multi-period Interest Rates
Investment grows from V (0) to V (t) in t periods, i(t) is the default-free interest rate for time t:
V(0)(1+i(t))t =V(t)
Definition: The ratio of the ending value to the beginning
value, V (t)/V (0), is termed the (t-period) value relative.
• One dollar will grow to 1/df(t) dollars with certainty by
time t, hence
(1+i(t)) =V(0)=df(t); i(t)= df(t) −1.
tV(t)1 􏰏1􏰐1t • Call i(t) multi-period interest rate, or, yield.

Yield curve
The following Matlab code plot a term structure of interest rate given discount factors:
>>df = [0.94 0.88 0.82]
df = 0.9400 0.8800 0.8200
>> vr = 1./df
vr = 1.0638 1.1364 1.2195 >> i = vr.^(1./[1:3])-1
i = 0.0638 0.0660 0.0684 >>plot([1:3],i)

Bond Yields (Yield to maturity)
Definition: Yield-to-maturity (YTM) is a constant interest rate that makes the present value of all the bond’s payments equal its price.
Example: A bond is selling for $97.84 and provides a certain vector of cash flows:
 6  Year 1 cf =  6  Year 2 106 Year 3
Yield-to-maturity, y, must satisfy
6 + 6 + 106 =97.84 1+y (1+y)2 (1+y)3

Computing Bond Yields
• Problem: We need to solve a non-linear equation!
• Solution: Use numerical techniques and tools, e.g. Octave
(Matlab) fsolve function
• fsolve function looks for a solution to equation f(y) = 0
f(y)= 6 + 6 + 106 −97.84 1+y (1+y)2 (1+y)3

Matlab code
y0=0.06; % Coupon rate is an initial guess y=
Optimization terminated: first-order optimality is
less than options.TolFun.

 6  Year 1 cf =  6  Year 2 106 Year 3
• The market discount function is:
df = 􏰀0.94 0.88 0.82􏰁 (1×Years)
• We have all types of measurements about bond’s return (yield, YTM, df, etc.) till now;
• In some applications we are interested in how sensitive is the bond value towards market interest rate;
• Consider a vector of certain cash flows associated with a

Periodical Values and Weights
The present value of each year’s cash flow:
v =􏰀df(1)·cf(1) df(2)·cf(2) df(3)·cf(3)􏰁
= 􏰀5.64 5.28 86.92􏰁
w(t) is the fraction of the bond’s present value paid in year t:
w = 􏰂 df (1)·cf (1) (1×Years) df ·cf
df (2)·cf (2) df (3)·cf (3) 􏰃
= 􏰀5.64/97.84
= 􏰀0.0576 0.0540 0.8884􏰁
df ·cf 86.92/97.84􏰁
5.28/97.84

The bond’s duration is the average waiting time for (coupon) payments:
D = 􏰄 t · w(t) = 1 · w(1) + 2 · w(2) + 3 · w(3) t=1
= 1 · 0.0576 + 2 · 0.0540 + 3 · 0.8884 = 2.8308

Duration using Bond yield
Duration of a Bond is often calculated using yield-to-maturity.
3 3 cf(t)/(1+y)t
D = 􏰄 t · w􏰅(t) = 􏰄 t · 􏰗3 cf (t)/ (1 + y)t
t=1 t=1 t=1 􏰄3 cf (t)/ (1 + y)t
= t· Pbond t=1
In our example: y = 0.0682, Pbond = 97.84 therefore 􏰏6 6 106􏰐
D = 1 · 1.0682 + 2 · (1.0682)2 + 3 · (1.0682)3 /97.84 = 2.8315

Modified Duration
Let v(t) = cf(t)/(1 + y)t and note
dv(t) =−t·cf(t)·(1+y)−t−1 ⇒
dv(t)=−t·v(t)· dy ⇒
(1+y) N N dy
􏰄 dv(t) = − 􏰄 t · v(t) · (1 + y) ⇒ t=1 t=1
N dv(t) 􏰔N v(t)􏰕 dy 􏰄=−􏰄t··⇒ t=1 v t=1 v (1+y)
dv =−md·dy v

Modified Duration
• Modified Duration, md: md = D ; (1+y)
• It measures the (negative) relative change in the value of the bond per marginal change in its own yield-to-maturity.
• Or, in short, the interest rate risk of the bond.

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com