bondEquivalentYield¶
Evaluates the bond-equivalent yield of a Treasury bill.
Synopsis¶
bondEquivalentYield (settlement, maturity, discountRate)
Required Arguments¶
- date
settlement
(Input) - The date on which payment is made to settle a trade. For a more detailed discussion on dates see the Usage Notess ection of this chapter.
- date
maturity
(Input) - The date on which the bond comes due, and principal and accrued interest are paid. For a more detailed discussion on dates see the Usage Notes section of this chapter.
- float
discountRate
(Input) - The interest rate implied when a security is sold for less than its value at maturity in lieu of interest payments.
Return Value¶
The bond-equivalent yield of a Treasury bill. If no result can be computed, NaN is returned.
Description¶
Function bondEquivalentYield
computes the bond-equivalent yield for a
Treasury bill.
It is computed using the following:
if \(\mathit{DSM}\leq 182\)
\[\frac{365 * \mathit{discountRate}}{360 - \mathit{discountRate} * \mathit{DSM}}\]
otherwise,
\[\frac
{- \frac{\mathit{DSM}}{365} +
\sqrt{\left(\frac{\mathrm{DSM}}{365}\right)^2 -
\left(2 * \frac{\mathit{DSM}}{365} - 1\right) *
\frac
{\mathit{discountRate} * \mathit{DSM}}
{\mathit{discountRate} * \mathit{DSM} - 360}}}
{\frac{\mathit{DSM}}{365} - 0.5}\]
In the above equation, DSM represents the number of days starting at settlement date to maturity date.
Example¶
In this example, bondEquivalentYield
computes the bond-equivalent yield
for a Treasury bill with the settlement date of July 1, 1999, the maturity
date of July 1, 2000, and discount rate of 5% at the issue date.
from __future__ import print_function
from numpy import *
from datetime import date
from pyimsl.math.bondEquivalentYield import bondEquivalentYield
discount = .05
settlement = date(1999, 7, 1)
maturity = date(2000, 7, 1)
equiv_yield = bondEquivalentYield(settlement, maturity, discount)
print("The bond-equivalent yield for the T-bill is %.2f%%."
% (equiv_yield * 100))
Output¶
The bond-equivalent yield for the T-bill is 5.29%.