債券の本当の長さとは
満期は最後の支払いがいつ来るかを示しますが、大きなクーポンを払う債券は資金のかなりの部分を早く返します。マコーレー・デュレーションはキャッシュフローを受け取るまでの平均時間で、各支払い時点を価格に占める割合で重み付けしたもの、sum(t * PV(t)) / 価格 です。ゼロクーポン債のデュレーションは満期に等しく、クーポンがそれを短くします。利回り6%、クーポン5%の10年債のデュレーションは7.9年です。デュレーションは債券の時間的な実質の長さです。
import numpy as np
def bond_cashflows(face, coupon_rate, years, freq):
n = int(round(years * freq))
times = np.arange(1, n + 1) / freq
flows = np.full(n, face * coupon_rate / freq)
flows[-1] += face
return times, flows
times, flows = bond_cashflows(1000, 0.05, 10, 2)
pv = flows / (1 + 0.06 / 2) ** (2 * times) # present value of each payment
price = pv.sum()
macaulay = (times * pv).sum() / price # the average time, weighted by present value
print(round(price, 4), round(macaulay, 4)) # 925.6126 7.895 shorter than the 10-year maturityデュレーションから価格リスクへ
1 + ytm / freq で割ると修正デュレーションになり、直接的な意味があります。利回りが1単位(100ポイント)上がったときの価格の下落率で、修正デュレーション7.67は、1次近似で利回り+1%ポイントに対して約-7.67%を意味します:dP / P ≈ -D_mod * dy。リスク管理部門が債券の金利感応度として示す数字です。前のトピックで長い債券が短い債券よりずっと大きく下がった理由、つまりデュレーションが大きいことも説明します。
modified = macaulay / (1 + 0.06 / 2)
print(round(modified, 4)) # 7.6654 about -7.67% of price for +1 percentage point of yield
dy = 0.01
print(round(price * (1 - modified * dy), 2)) # 854.66 the first-order estimate after a rise to 7%
# the exact price at 7% is 857.88: duration alone underestimates itコンベクシティ:曲率
価格と利回りの関係は直線ではなく曲線で、デュレーションはその接線にすぎません。曲線が上に反っているため、接線はどちら向きの動きでも価格を過小評価します。債券は、利回りが下がるときに、同じだけ上がるときに失う額より多く得ます。コンベクシティは2次微分からその反りを測ります:sum(フロー * t * (t + 1/freq) / (1 + y/freq) ** (freq * t + 2)) / 価格。デュレーションによる推定に 0.5 * コンベクシティ * dy² の項を加えると、価格予測が大きく改善し、動きが大きいほど効きます。
convexity = (flows * times * (times + 1 / 2) / (1 + 0.06 / 2) ** (2 * times + 2)).sum() / price
print(round(convexity, 3)) # 71.785
for dy in (0.01, -0.01, 0.03):
exact = bond_price(1000, 0.05, 0.06 + dy, 10)
duration_only = price * (1 - modified * dy)
with_convexity = price * (1 - modified * dy + 0.5 * convexity * dy ** 2)
print(dy, round(exact, 2), round(duration_only, 2), round(with_convexity, 2))
# 0.01 857.88 854.66 857.99
# -0.01 1000.0 996.56 999.88
# 0.03 739.84 712.77 742.67 for a big move convexity matters most# Duration by maturity for a 5% bond at a 6% yield: it grows with maturity, but slower than one for one
for years in (1, 5, 10, 30):
t_, f_ = bond_cashflows(1000, 0.05, years, 2)
p_ = f_ / (1 + 0.06 / 2) ** (2 * t_)
print(years, round((t_ * p_).sum() / p_.sum(), 3))
# 1 0.988
# 5 4.472
# 10 7.895
# 30 14.77bond_price がするように債券を完全に再評価しましょう。- マコーレー・デュレーション =
sum(t * PV) / 価格(お金が戻るまでの平均時間)。ゼロクーポン債では満期に等しい - 修正デュレーション = マコーレー /
(1 + ytm / freq)。利回り+1あたりの価格下落率、dP / P ≈ -D_mod * dy - 価格推定 =
価格 * (1 - D_mod * dy + 0.5 * コンベクシティ * dy²)。コンベクシティ項が接線を補正し、大きな動きで特に効く
次はイールドカーブと補間です。満期が違えば金利も違うからです。
ラボ:採点される内容
macaulay_durationでお金が戻るまでの平均時間を求める25点modified_durationで価格感応度に変換する25点convexityで曲率を捉える25点price_estimateで再評価せずに新しい価格を予測する25点