View
218
Download
1
Category
Preview:
Citation preview
1
Bonds and Related Issues
kicheon.chang@yahoo.co.kr
2
Contents
Topics Contents
Numerical Method 보간법행렬연산SimulationSolver/Optimization
Bond Price/Duration/ConvexityImmunizationFinding YTM
Term structure Term structure 이론BootstrappingFitting the yield curve
Bond Futures 채권선도 (FRA)국고채선물 이론가 계산
3
Preface• “TheoryExcelVBA” Type
– Memorize it in your hand rather than in your head!!
• Engineering Approach– 수학적 엄밀성보다는 직관적 이해– (ex)
• A bird in the hand is worth two in the bush– Do not hesitate to raise your hand whenever questionable– Use the break time, e-mail etc..
• Two way vs One way
4
Numerical Methods
5
Numerical Method & Finance
6
Numerical Method/Simultaneous equations
• Why simultaneous equations?
– (ex) (Polynomial, Spline) Interpolation, Finite Difference Method, Bootstrapping…
• How to do?
7
Numerical Method/Cholesky Decomposition
• Why?– We know– What is
• How?
• Where(application)?– Generating correlated random variables
1.414213562
?43
21
8
Numerical Method/Linear Interpolation
Linear interpolation Log interpolation
Exponential interpolation
9
note
10
Numerical Method/Polynomial interpolation
Polynomial interpolation
00 , yx
11, yx
nn yx ,
N+1 equationsN+1 unknowns
11
Numerical Method/Polynomial Interpolation
Example
12
Numerical Method/Polynomial interpolation
n10 BFBFBF xf
Lagrange polynomial interpolation
00 , yx
11, yx
nn yx ,
Base function(0)
00 , yx
11, yx
nn yx ,
00 , yx
11, yx
nn yx ,
Base function(1)
xLxf iiiBF
13
Numerical Method/Polynomial interpolation
Lagrange polynomial interpolation
14
Numerical Method/Polynomial interpolation
the problem
15
Numerical Method/Spline interpolation
16
Numerical Method/spline interpolation2 차 스플라인 보간법 3 차 스플라인 보간법
17
Numerical Method/2D interpolation
18
Numerical Method/Optimization: Solver
19
Numerical Method/Bisection method
20
Numerical Method/Newton method
1 2 3 4 5 6 7 8 9
10 11 12 13 14
A B C D E F G =E4 =B4^3+2*B4+1 =3*B4^2+2
=B4-C4/D4i x(i) f(x) f'(x) x(i+1) epsilon
0 10 1021 302 6.61920531 6.6192053 304.25147 133.44164 4.3391713 716.74853 =ABS(C5-C4)2 4.33917129 91.378028 58.485222 2.776759 212.873443 2.77675904 27.963415 25.131172 1.6640606 63.4146124 1.66406064 8.9360679 10.307293 0.7970951 19.0273475 0.79709512 3.1006331 3.9060819 0.0032989 5.83543486 0.00329889 1.0065978 2.0000326 -0.499992 2.09403537 -0.4999918 -0.124977 2.7499754 -0.454545 1.13157538 -0.45454505 -0.003004 2.6198336 -0.453398 0.12197339 -0.45339834 -1.79E-06 2.6167102 -0.453398 0.0030024
10 -0.453398 -6.38E-13 2.6167083 -0.453398 1.792E-06
Algorithm
21
Caution!
• There is no panacea!
– Try possible Initial values– 함수의 전반적 형태파악
• 단조증가 / 감소함소
22
Numerical Method/Simulation/Uniform Random Variable
RAND
0 1
1 1
10 xp a
dxxp0
RND
23
Numerical Method/Simulation/Uniform RV
Examples
Calculating PI
24
Numerical Method/Simulation/Transforming RV
• 12 난수법– Definition:
– Why 12 RVs?
– Central Limit Theorem:
– Does CLT really work?
12
1
~~i
ixz
?~ zE ?~ zV
21,0~ Nz CLT
FREQUENCY(samples, 구간 )
25
Numerical Method/Simulation/Transforming RV
• Transform method– Idea
– Functions: NormSDist(x), NormSInv(p)
– test
z0
1
pxN
pNx 1
0
10
20
30
40
50
60
70
0
20
40
60
80
100
120
140
Transform
26
Multi-variable case
• From uncorrelated RVs to correlated RVs
0, 21 xx
2
1transform
2
1
y
y
x
x 9.0, 21 yy
2
1
2
121
01
y
y
x
x
1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19 20
A B C D E F G H I J K L rho= 0.99
=rho*A4+SQRT(1-rho^2)*B4x1 x2 y2
0.562829417 0.759027 0.6642750.745888995 0.587151 0.8212580.616898146 0.768017 0.7190710.90212717 0.002266 0.893425
0.461556773 0.160399 0.4795680.492802736 0.026995 0.4916830.331733922 0.170176 0.3524230.505072821 0.5315 0.5749990.073725059 0.265133 0.1103890.084891145 0.927261 0.2148480.841372506 0.330709 0.8796110.100927256 0.417909 0.1588710.495363841 0.17961 0.5157470.159663535 0.266904 0.1957180.471160815 0.481691 0.53440.897593149 0.473643 0.9554330.860525513 0.432385 0.912916
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0 0.2 0.4 0.6 0.8 1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0 0.2 0.4 0.6 0.8 1
27
Bonds
28
Bonds/Market
채권시장
발행시장
유통시장 장내시장
장외시장
국채전문유통시장
일반채권거래시장
대고객상대매매시장
Inter Dealer Broker
사모발행
공모발행 직접발행
간접발행
매출발행
공모입찰발행
위탁모집
인수모집 잔액인수
총액인수
Conventional
Dutch
29
Bonds/Market
자료 :www.ksdabond.or.kr
30
Bonds/Market
자료 :www.ksdabond.or.kr
31
Bond/price
32
Bond/Price
Example2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
A B C D E F G H I issue 97-12-27 1.calcuate "A"mat 00-12-27 date i cf df pvfreq 4 98-03-27 0 300 1 300cpn 12% 98-06-27 1 300 0.953516 286.0548yield 19.50% 98-09-27 2 300 0.909193 272.7579notional 10,000 98-12-27 3 300 0.86693 260.079trade 98-01-20 99-03-27 4 300 0.826632 247.9895daycount 30/360 99-06-27 5 300 0.788207 236.462
99-09-27 6 300 0.751568 225.4703price(함수) 8351.597 99-12-27 7 300 0.716632 214.9896
00-03-27 8 300 0.68332 204.99600-06-27 9 300 0.651557 195.46700-09-27 10 300 0.62127 186.380900-12-27 11 10300 0.592391 6101.625
8732.272let's try 98-03-01 2.caculate "B"
98-01-20 A set B setDSC 66 67 dirty priceE 90 90 8432.723 A setdf 0.965696 0.965186 8428.264 B set
3.calcuate Accrual Interest clean priceAccrual 80 76.66667 8348.264 A set
8351.597 B set
33
Bonds/Excel functions정리 그밖에 채권 관련된 함수
함수명 : 설명
YIELD : 정기적으로 이자를 지급하는 유가증권의 수익률
YIELDDISC : 할인된 유가증권의 연수익률
YIELDMAT : 만기 시 이자를 지급하는 유가증권의 연 수익률
COUPDAYSNC : 결산일부터 다음 이자 지급일까지의 날짜 수
COUPDAYBS : 이자 지급기간의 시작일부터 결산일까지의 날짜 수
COUPDAYS : 결산일이 들어 있는 이자 지급 기간의 날짜 수
COUPNCD : 결산일 다음 첫 번째 이자 지급일
COUPPCD : 결산일 바로 전 이자 지급일
COUPNUM: 결산일과 만기일 사이의 이자지급횟수 ( 정수로 반올림 )
참고 이자기간함수간의 관계COUPDAYS = COUPDAYSNC+COUPDAYBS = COUPNCD-COUPPCD
34
Bonds/Terminology
• Conventional price
• Theoretical price
• Dirty price– Cash price– Invoice price
• Clean price– Quoted price
35
Bonds/note
• Conventional VS Theretical
• Convert between c-price and t-price using Excel Function “PRICE”
정리 관행적 계산법 vs 이론적 계산법(1) 관행적 계산법 : 2 단계 할인할 때 단리 할인법 적용(2) 이론적 계산법 : 2 단계 할인할 때 복리 할인법 적용
accrual
41
100
41
4100
41
11
11
N
N
kk
E
daysyldyld
rate
yldp
1pA
발행일 거래일 이자지급일 1 이자지급일 2 이자지급일 3 …… 만기일
1 단계 할인2 단계 할인
36
Bonds/Day count conventionCountDay RateInterest Amount PrincipalAmountInterest
37
Bonds/User Defined Function
Test Numbers
38
Bonds/Duration
• History of bond sensitivity– Maturity– CF Weighted Average Term to Maturity– PV Weighted Average Term to Maturity
• Meaning of Macauley Duration– Investment Horizon → Immunization– Sensitivity → Modified Duration
P
dctwtD ii
n
iii
n
iiMAC
11
DurationMacauley
39
Bonds/Modified Duration
• What we want to know is…– What if the yield moves up 1%p?
• Mac. Duration does not give the answer
• Modified Duration
y
y
P
P
y
y
P
P
A
BDmac
)1(
)1(
Py
Py
P
P
y
DD mac 1
1
40
Bonds/Convexity
• If we hedged the bond’s duration, then what happens to the value of our portfolio when yield moves?
• Convexity
– 듀레이션 헤지된 포트폴리오의 손익변화 측정에 사용– See the Taylor Expansion
P
dy
Pd
C
2
2
)(
41
Bonds/Numerical Convexity
21111 2111
Y
PPP
PY
PP
Y
PP
YP
dY
dP
dY
d
PdY
Pd
PC
112
2
Difference approximation
42
note
(Excel2007 에서는 위 설정없이 “ Application.price” 로 사용가능 )
43
Bonds/Taylor Expansion
• We want to decompose(analyse) any function to “polynomial functions”
• How to find the coefficients– Above equation should hold when x=0
– Differentiating and inputting x=0 still hold equality
– and so on
...2210 xaxaaxf
00 fa
01 fa
...000 2!2
1 xfxffxf
44
Bonds/Taylor expansion
• Taylor series expansion of bond price
• The relationship
– 수익률의 1 차 변화분에 의한 채권가격의 변화율은 듀레이션에 의해서 설명되며 ,
– 수익률의 2 차 변화분에 의한 채권의 가격변화율은 컨벡시티에 의해 설명된다 .
...)()(2
1 2
2
2
01 ydy
Pdy
dy
dPPPP
2
2
1yCyD
P
P
45
Bonds/Summary
46
Bonds/Summary
1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
A B C D E F G H I J K L
/ /채권가격 듀레이션 컨벡시티 =1/(1+$B$4)^D4
n 3 Price Duration Convexityyield 4.51% i df cf pv w(i) w*i i*(i+1) c/(1+y)^(i+2)coupon 5% 1 0.9568462 0.05 0.0478423 0.0472066 0.0472066 2 0.043802254 0.0876045
2 0.9155547 0.05 0.0457777 0.0451694 0.0903388 6 0.041912022 0.2514721
거래일 07-02-22 3 0.8760451 1.05 0.9198473 0.907624 2.722872 12 0.842170569 10.106047
만기일 10-02-22 sum 1.0134674 2.8604175 10.445123convexity= 10.306324
price 101.346739 =price(B7,B8,B5,B4,100,1,0)duration 2.86041745convexity 10.3063244 =DURATION(B7,B8,B5,B4,1,0)
Convexity 손으로 계산하기 =Convexity(B7,B8,B5,B4,1,0)p0 101.374482p1 101.346739p2 101.319005dYld 0.0001d^2P/dy^2 1044.51237 =(B17-2*B16+B15)/(B18)^2Convexity 10.3063244 =B19/B10Convexity 검증dy 0.001P0 101.346739P1 101.069877 =B23-B11*B23/(1+B4)*B22+0.5*B19*B22^2
101.069876 =price(B7,B8,B5,B4+B22,100,1,0)
47
Bonds/Immunization
Alternatives
Request
48
Bond/ImmunizationExample
Check “Macauley duration”
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
A B C D E F G H I J
투자채권 명세목표투자기간 5.5만기 15 현재 05-11-01표면금리 6.00% 거래일 11-05-01이자횟수 2 만기일 20-11-01Price 100투자원금 100 =price($E$12,$E$13,$B$12,A20,100,2,3)*$B$15/$B$14
=$B$15*$B$12*$B$10*$B$15/$B$14시나리오 =-FV(A20/2,$B$10*2,$B$15*$B$12/$B$13,0,0)*$B$15/$B$14
=IF(ISERROR(H20),100,H20) =D20+C20Yield.chged 원래이자 복리 채권가격 만기회수액 유효수익률 =RATE($B$10*$B$13,,-$B$15,E20,0)*2
8.50% 33 40.98731 83.92578 124.91309 4.09% 83.925788.00% 33 40.45905 86.86606 127.32511 4.44% 86.866067.50% 33 39.93865 89.93702 129.87566 4.81% 89.937027.00% 33 39.42598 93.14508 132.57106 5.19% 93.145086.50% 33 38.92093 96.49703 135.41796 5.59% 96.497036.00% 33 38.42339 100 138.42339 6.00% 1005.50% 33 37.93325 103.6615 141.59475 6.42% 103.66155.00% 33 37.4504 107.4894 144.93984 6.86% 107.48944.50% 33 36.97473 111.4922 148.46691 7.32% 111.49224.00% 33 36.50615 115.6785 152.18461 7.78% 115.67853.50% 33 36.04453 120.0576 156.1021 8.26% 120.0576
Scenario Analysis
49
Bond/Finding YTM(1)
• Why numerical method?
• Bisection MethodMARKETPPE
Pfy 1 yfP ???
y
LL Ey ,
HH Ey ,
mm Ey ,
50
Bond/Finding YTMVBA code
51
Bond/Finding YTM(2)
2 3 4 5 6 7 8 9
10 11 12 13 14 15
A B C D E F G H I J K L find YTM using Newton method =PRICE($B$4,$B$5,$B$6,E7,$B$8,$B$9,$B$10)bond spec Newton method =$B$11-F7settlement 08-07-01 target f= f(y)=p-p(y) =F8/(1+E8)
maturity 11-07-01 =I8*H8rate 5% y p(y) f p/(1+y) duration f' y(i+1)yield 6% unknown 0.0000% 115 -17.673 115 2.869565 330 5.3555% =E8-G8/J8redemption 100 5.3555% 99.03841 -1.71142 94.00406 2.858678 268.7274 5.9923%frequency 1 5.9923% 97.34714 -0.02015 91.84358 2.857363 262.4305 6.0000%basis 0 6.0000% 97.32699 -2.9E-06 91.81792 2.857347 262.3557 6.0000%price 97.32699 knownduration 2.857347 =DURATION($B$4,$B$6,$B$7,E8,$B$10,$B$11)P/(1+y) 91.81791dP/dy 262.3557
yield
yPPyf market
iy 1iy
52
Term structure of Interest rates
53
TS/Terminology
• Zero rate– Definition:
• Par yield– Definition: such that
• Forward rate(Implied forward rate, Forward rate agreement)– see FRA for pricing– Relationship between spot rate and forward rate
• Discount factor– _
*y
TyP
*
MARKET
1
1
TyeP
*MARKET
nn
ii
i
yy
c*
1* 1
100
1100
54
Term structure of interest rates
55
Term structure of interest rates
• Which one?(in terms of modeling yield curve)– Yield of zero coupon bond
– Zero price• Cubic functions
– Forward rate• Nelson-Seigel function
tsdd ts
0f
0r is not enough
56
Term Structure of Interest rates
57
TS/Why yields differ?
58
TS/Issues
• Finding the current term structure of interest rates– Fitting Yield Curve
– To price illiquid bonds
• Estimating the future term structure of interest rates– Economics/Econometrics
– To trade bonds
• Modeling the future term structure of interest rates– Finance
– To price Fixed Income Derivatives
59
Finding Yield Curve
• Bootstrapping and Interpolation– 다양한 만기의 이자율 상품의 가격이 고시되는
경우– Interest Rate Swap Market
• Functional Approach– Function types
• Cubic function
• Piece-wise cubic function
• Nelson-Seigel function
60
TS/Bootstrapping
61
TS/Bootstrapping
Example
행렬을 이용하는 방법
62
TS/BootstrappingMore considerations
Available prices Bootstrapping formula
25.0d 5.0d 75.0d 0.1d
63
TS/Bootstrapping/more consideration
Example
64
TS/Bootstrapping/more consideration
Example
65
TS/Bootstrapping/summary
66
TS/Fitting the yield curve
67
TS/Functional Forms
68
Polynomial Model/Cubic Function
• Yield curve function– Model:
– No Arbitrage condition
• Bond price
• Find coefficients
nni tdctdctdcP 1211
33
2210 ttttd
m
MARKETii PP
1i
Min
0
t
d
032 s.t. 2321 tt
10 d
69
Polynomial Model/Cubic Function/Data
자료 : Bloomberg
70
Polynomial Model/Cubic Function
Example2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19
A B C D E F G H I J K L M N fitting Yield Curve.xls coefficients
b0 1b1 -0.08896b2 0.04839b3 -0.01544
0.5 0.965686=PRICE($B$10,D14,E14,C14,100,2,0)/100 =cubicF(K13,$J$3,$J$4,$J$5,$J$6)
today 08-09-07 =SUMPRODUCT($I$12:$N$12,I14:N14)
Market Data market model t 0.980542 0.965686 0.953983 0.943987 0.923322 0.89211t yield maturity coupon price price cf 0.25 0.5 0.75 1 1.5 2
0.25 5.32 0.0532 08-12-07 0.0532 0.999825 1.006625 1.02660.5 5.37 0.0537 09-03-08 0.0537 0.999998 0.991615 0 1.02685
0.75 5.41 0.0541 09-06-07 0.0541 0.99991 1.006312 0.02705 0 1.027051 5.45 0.0545 09-09-07 0.0545 1 0.996025 0.02725 1.02725
1.5 5.53 0.0553 10-03-08 0.0553 0.999998 1.001654 0.02765 0.02765 1.027652 5.77 0.0577 10-09-07 0.0577 1 0.99958 0.02885 0.02885 0.02885 1.02885
Function cubicF(t, b0, b1, b2, b3)cubicF = b0 + b1 * t + b2 * t ^ 2 + b3 * t ^ 3End Function
21 22 23 24 25 26 27 28 29 30 31
E F G H I J K L M N t_function
4.62E-05 =(F14-G14)^27.03E-05
4.1E-051.58E-052.74E-061.77E-07
sum 0.000176 =SUM(F22:F27)
71
Spline: Piece-wise polynomial
• More freedomMore accurate one
• Bond price
• Continuity Condition+1st & 2nd differential condition• Find coefficients
31,3
21,21,11,01 ttttd
32,3
22,22,12,02 ttttd
3,3
2,2,1,0 ttttd iiiii
m
MARKETii PP
1i
Min
T
Zero price
n
jjij
m
jjj
l
jjji tdctdctdcP
112
11
72
Polynomial Model/Nelson-Siegel
Instantaneous forward rate discount factor
73
note
74
Polynomial Model/Nelson-Seigel
Example
2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19
A B C D E F G H I J K L M N fitting Yield Curve NelsonSeigel.xls coefficients
a 0.047973b -0.02019c 0.010625alpha 0.526315
0 1
today 08-09-07
Market Data market model t 0.983716 0.968754 0.954867 0.941859 0.91786 0.895799t yield maturity coupon price price cf 0.25 0.5 0.75 1 1.5 2
0.25 5.32 0.0532 08-12-07 0.0532 0.999825 1.009883 1.02660.5 5.37 0.0537 09-03-08 0.0537 0.999998 0.994765 0 1.02685
0.75 5.41 0.0541 09-06-07 0.0541 0.99991 1.007306 0.02705 0 1.027051 5.45 0.0545 09-09-07 0.0545 1 0.993923 0.02725 1.02725
1.5 5.53 0.0553 10-03-08 0.0553 0.999998 0.996067 0.02765 0.02765 1.027652 5.77 0.0577 10-09-07 0.0577 1 1.003245 0.02885 0.02885 0.02885 1.02885
75
Polynomial Model/Nelson-Seigel
ExampleFunction df_NelsonSeigel(a_, b_, c_, alpha, t)Dim A As Double, B As Double, C As DoubleA = AA(b_, c_, alpha)B = BB(a_)C = CC(c_, alpha)df_NelsonSeigel = Exp(-A - B * t - (A + C * t) * Exp(-alpha * t))End Function
Function AA(b_, c_, alpha)AA = b_ / alpha + c_ / (alpha * alpha)End Function
Function BB(a_)BB = a_End Function
Function CC(c_, alpha)CC = c_ / alphaEnd Function
21 22 23 24 25 26 27 28 29 30
E F G H I J K L M t_function0.000101 =(F14-G14)^22.74E-055.47E-053.69E-051.55E-051.05E-05
sum 0.000246 =SUM(F22:F27)
76
Graphs: polynomial vs Nelson-Seigel
2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19 20 21 22
A B C D E F G H I J K coefficients coefficientsa 0.047973 b0 1b -0.02019 b1 -0.08896c 0.010625 b2 0.04839alpha 0.526315 b3 -0.01544=df_NelsonSeigel($B$3,$B$4,$B$5,$B$6,A11)
=-1/A11*LN(B11) =cubicF(A11,$D$3,$D$4,$D$5,$D$6)NS Polynomial
term df zero rate df zero rate0.25 0.983716 6.57% 0.980542 7.86%
0.5 0.968754 6.35% 0.965686 6.98%0.75 0.954867 6.16% 0.953983 6.28%
1 0.941859 5.99% 0.943987 5.76%1.25 0.929567 5.84% 0.934249 5.44%
1.5 0.91786 5.71% 0.923322 5.32%1.75 0.906633 5.60% 0.909758 5.40%
2 0.895799 5.50% 0.89211 5.71%2.25 0.885291 5.42% 0.868931 6.24%
2.5 0.875051 5.34% 0.838773 7.03%2.75 0.865036 5.27% 0.800187 8.11%
3 0.85521 5.21% 0.751728 9.51%
0.00%
1.00%
2.00%
3.00%
4.00%
5.00%
6.00%
7.00%
8.00%
9.00%
10.00%
0.25 0.5 0.75 1 1.25 1.5 1.75 2 2.25 2.5 2.75 3
NS
Polynomial
77
Bond Futures/Forward
78
Bond Futures/ 주식선도
79
Bond Futures/ 이자율 선도 (FRA)
80
Bond Futures/FRAExample
투자자는 몇 % 로 ( 선도 ) 예금계약을 체결해야할까 ? ( 단 , 투자자는 동일한 금리로 대출 / 투자가 가능하다 .)
81
Bond Futures/ 채권 선도이표가 없는 경우
이표가 1 회 있는 경우
82
Bond Futures/UDF
83
KTB Futures/Market
84
KTB Futures
Check
Check
85
KTB Futures/Market
86
KTB Futures/Market
3 년 국채선물의 최종결제 기준채권
자료 : www.krx.co.kr/상품안내/선물옵션상품/채권금리상품 /3 년국채선물
87
KTB Futures/ 이론가 계산
88
KTB Futures/functions
89
KTB Futures/functions
90
KTB Futures
Example
91
Note: Excel functionsDSC=coupdaysnc 기준일부터 다음 이자지급일까지의 날수 A=coupdaybs
E=coupdays N=coupnum
92
bonus
• Convexity adjustment
93
References
• 엑셀 VBA 를 이용한 금융공학실습 ( 서울경제경영 )
94
Thank you!
Recommended