discountYield¶
Evaluates the annual yield of a discounted security.
Synopsis¶
discountYield (settlement, maturity, price, redemption, basis)
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 Notes section 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 see the Usage Notes section of this chapter.
- float
price
(Input) - Price per $100 face value of the security.
- float
redemption
(Input) - Redemption value per $100 face value of the security.
- int
basis
(Input) - The method for computing the number of days between two dates. It should
be one of
DAY_CNT_BASIS_ACTUALACTUAL, DAY_CNT_BASIS_NASD
,DAY_CNT_BASIS_ACTUAL360
,DAY_CNT_BASIS_ACTUAL365
, orDAY_CNT_BASIS_30E360
. For a more detailed see the Usage Notes section of this chapter.
Return Value¶
The annual yield for a discounted security. If no result can be computed, NaN is returned.
Description¶
Function discountYield
computes the annual yield for a discounted
security.
It is computed using the following:
\[\left(\frac{\mathit{redemption} - \mathit{price}}{\mathit{price}}\right)
\left(\frac{B}{\mathit{DSM}}\right)\]
In the equation above, B represents the number of days in a year based on the annual basis, and DSM represents the number of days starting with the settlement date and ending with the maturity date.
Example¶
In this example, discountYield
computes the annual yield for a
discounted security which is selling at $95.40663 with the settlement date
of July 1, 1995, and maturity date of July 1, 2005, using the US (NASD)
30/360 day count method.
from __future__ import print_function
from numpy import *
from datetime import date
from pyimsl.math.discountYield import discountYield, DAY_CNT_BASIS_NASD
price = 95.40663
redemption = 105.0
basis = DAY_CNT_BASIS_NASD
settlement = date(1995, 7, 1)
maturity = date(2005, 7, 1)
yielddisc = discountYield(settlement, maturity, price,
redemption, basis)
print("The yield on the discounted bond is %.2f%%." % (yielddisc * 100))
Output¶
The yield on the discounted bond is 1.01%.