ゼロクーポン債とクーポン債のデュレーション
デュレーションは、クーポンの有無にかかわらず、あらゆる債券に適用できる金利リスクの尺度です。
この演習では、満期10年、額面USD 100、最終利回り3%のゼロクーポン債のデュレーションを計算し、同条件で年3%のクーポンを支払う債券と比較します。numpy_financial はすでに npf としてインポート済みです。
デュレーションの公式は次のとおりです。
\(Duration = \frac{P(down) \ -\ P(up)}{2\ \times\ P\ \times\ \Delta y}\)
この演習はコースの一部です
Pythonで学ぶ債券の評価と分析
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# Find the price of the zero coupon bond at current yield levels
price = ____
# Find the price of the zero coupon bond at 1% higher yield levels
price_up = ____
# Find the price of the zero coupon bond at 1% lower yield levels
price_down = ____
# Calculate duration using the formula and print result
duration = (____ - ____) / (____ * ____ * ____)
print("Zero Coupon Bond Duration: ", ____)