볼록성

Python으로 배우는 채권 가치평가와 분석

Joshua Mayhew

Options Trader

예측가와 실제 가격 그리기

import numpy as np
import numpy_financial as npf
import pandas as pd
import matplotlib.pyplot as plt
price = -npf.pv(rate=0.05, nper=20, pmt=5, fv=100)
price_up = -npf.pv(rate=0.06, nper=20, pmt=5, fv=100)
price_down = -npf.pv(rate=0.04, nper=20, pmt=5, fv=100)
duration = (price_down - price_up) / (2 * price * 0.01)
dollar_duration = duration * price * 0.01
print("Bond Price (USD): ", price)
print("Dollar Duration (USD): ", dollar_duration)
Bond Price (USD): 100.00
Dollar Duration (USD): 12.53
Python으로 배우는 채권 가치평가와 분석

예측가와 실제 가격 그리기

bond_yields = np.arange(0, 10, 0.1)
bond = pd.DataFrame(bond_yields, columns=['bond_yield'])
bond['price'] = -npf.pv(rate=bond['bond_yield'] / 100, nper=20, pmt=5, fv=100)
    bond_yield       price
0          0.0  200.000000
1          0.1  196.978503
..         ...         ...
98         9.8   58.570780
99         9.9   57.997210

[100 rows x 2 columns]
Python으로 배우는 채권 가치평가와 분석

예측가와 실제 가격 그리기

bond['yield_change'] = bond['bond_yield'] - 5
    bond_yield       price  yield_change
0          0.0  200.000000        -5.0
1          0.1  196.978503        -4.9
2          0.2  194.013231        -4.8
..         ...         ...           ...
97         9.7   59.153044         4.7
98         9.8   58.570780         4.8
99         9.9   57.997210         4.9

[100 rows x 3 columns]
Python으로 배우는 채권 가치평가와 분석

예측가와 실제 가격 그리기

$ \text{Price Change} = -100 \times \text{Dollar Duration} \times \Delta y$

bond['price_change'] = -100 * dollar_duration * bond['yield_change'] / 100
    bond_yield       price  yield_change  price_change
0          0.0  200.000000          -5.0     62.650619
1          0.1  196.978503          -4.9     61.397607
..         ...         ...           ...           ...
98         9.8   58.570780           4.8    -60.144594
99         9.9   57.997210           4.9    -61.397607

[100 rows x 4 columns]
Python으로 배우는 채권 가치평가와 분석

예측가와 실제 가격 그리기

bond['predicted_price'] = price + bond['price_change']
   bond_yield       price  yield_change  price_change  predicted_price
0          0.0  200.000000          -5.0     62.650619       162.650619
1          0.1  196.978503          -4.9     61.397607       161.397607
2          0.2  194.013231          -4.8     60.144594       160.144594
..         ...         ...           ...           ...              ...
97         9.7   59.153044           4.7    -58.891582        41.108418
98         9.8   58.570780           4.8    -60.144594        39.855406
99         9.9   57.997210           4.9    -61.397607        38.602393

[100 rows x 5 columns]
Python으로 배우는 채권 가치평가와 분석

예측가와 실제 가격 그리기

plt.plot(bond['bond_yield'], bond['price'])
plt.plot(bond['bond_yield'], bond['predicted_price'])
plt.xlabel('Yield (%)')
plt.ylabel('Price (USD)')
plt.title("Actual Bond Prices vs. 
    Predicted Prices Using Duration")
plt.legend(["Actual Price", "Predicted Price"])
plt.show()

Python으로 배우는 채권 가치평가와 분석

듀레이션의 한계

  • 듀레이션은 선형 지표입니다
  • 채권 가격은 볼록합니다
  • 듀레이션은 작은 수익률 변화에만 정확합니다

Python으로 배우는 채권 가치평가와 분석

볼록성이란?

  • 채권 가격의 곡률을 측정합니다
  • 가격 예측과 리스크 측정을 보완합니다
  • 볼록성이 높을수록 가격/수익률 곡선의 굴곡이 큽니다

Python으로 배우는 채권 가치평가와 분석

볼록성 공식

다음은 단순화한 볼록성 공식입니다:

 

${\large Convexity = \frac{P_{down}\ +\ P_{up} \ - \ 2\times P}{P\ \times\ (\Delta y)^2}}$

 

  • $P_{down}$ = 수익률 1% 하락 시 가격
  • $P_{up}$ = 수익률 1% 상승 시 가격
  • $2 \times P$ = 현재 수익률의 채권 가격 × 2
  • $(\Delta y)^2$ = 수익률 변화의 제곱(여기서는 1% ^ 2 사용)
Python으로 배우는 채권 가치평가와 분석

볼록성 예시

만기 10년, 연 5% 쿠폰, 만기수익률 4%인 채권의 볼록성은?

${ Convexity = \frac{P_{down}\ +\ P_{up} \ - \ 2\times P}{P\ \times\ (\Delta y)^2}}$

price = -npf.pv(rate=0.04, nper=10, pmt=5, fv=100)

price_up = -npf.pv(rate=0.05, nper=10, pmt=5, fv=100) price_down = -npf.pv(rate=0.03, nper=10, pmt=5, fv=100)
convexity = (price_down + price_up - 2 * price) / (price * 0.01 ** 2) print("Convexity: ", convexity)
Convexity:  77.56
Python으로 배우는 채권 가치평가와 분석

요약

  • 듀레이션은 선형 지표입니다
  • 채권 가격은 곡선 형태입니다
  • 듀레이션은 작은 수익률 변화에만 정확합니다
  • 볼록성은 이 곡률을 측정합니다

${ Convexity = \frac{P_{down}\ +\ P_{up} \ - \ 2\times P}{P\ \times\ (\Delta y)^2}}$

Python으로 배우는 채권 가치평가와 분석

연습해 봅시다!

Python으로 배우는 채권 가치평가와 분석

Preparing Video For Download...