使用 Python 進行債券評價與分析
Joshua Mayhew
Options Trader
考慮一檔 3 年期、年票息 3%、票面 USD 100、殖利率 4% 的債券:

警告:票息是固定的,不會改變!
把此債券拆成多張零息債,並分別定價:
3 年期、年票息 3%、票面 USD 100、殖利率 4%
使用先前的複利公式:
$ \text{1yr ZCB Price: } \frac{3}{(1 + 0.04)^1} = 2.88$
$ \text{2yr ZCB Price: } \ \frac{3}{(1 + 0.04)^2} = 2.77$
$ \text{3yr ZCB Price: } \ \frac{103}{(1 + 0.04)^3} = 91.57$
$\text{Coupon Bond Price: } 2.88 + 2.77 + 91.57 = 97.22$
一般而言,付息債價格公式為:
$ Price = PV = \frac{C}{(1 + r)^1} + \frac{C}{(1 + r)^2} + ... +\frac{C}{(1 + r)^n} + \frac{P}{(1 + r)^n}$
$ = (\sum_{i=1}^n \frac{C}{(1 + r)^i}) + \frac{P}{(1 + r)^n}$
沿用同一檔 3 年期、年票息 3%、到期殖利率 4% 的債券:
import numpy_financial as npf
-npf.pv(rate=0.04, nper=3, pmt=3, fv=100)
97.22
把 pmt 設為正值。
而且在函式前加負號。
把 fv 設為 100 而非 103。
使用 Python 進行債券評價與分析