yieldMaturity¶
Evaluates the annual yield of a security that pays interest at maturity.
Synopsis¶
yieldMaturity (settlement, maturity, issue, rate, price, 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 dates see the Usage Notes section of this chapter.
- date
issue
(Input) - The date on which interest starts accruing. For a more detailed discussion on dates see the Usage Notes section of this chapter.
- float
rate
(Input) - Interest rate at date of issue of the security.
- float
price
(Input) - Price 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 discussion onbasis
see the Usage Notes section of this chapter.
Return Value¶
The annual yield of a security that pays interest at maturity. If no result can be computed, NaN is returned.
Description¶
Function yieldMaturity
computes the annual yield of a security that pays
interest at maturity.
It is computed using the following:
In the equation above, DIM represents the number of days in the period starting with the issue date and ending with the maturity date. DSM represents the number of days in the period starting with the settlement date and ending with the maturity date. A represents the number of days in the period starting with the issue date and ending with the settlement date. B represents the number of days in a year based on the annual basis.
Example¶
In this example, yieldMaturity
computes the annual yield of a security
that pays interest at maturity which is selling at $95.40663 with the
settlement date of August 1, 2000, the issue date of July 1, 2000, the
maturity date of July 1, 2010, and the interest rate of 6% at the issue
using the US (NASD) 30/360 day count method.
from __future__ import print_function
from numpy import *
from datetime import date
from pyimsl.math.yieldMaturity import yieldMaturity, DAY_CNT_BASIS_NASD
rate = .06
price = 95.40663
basis = DAY_CNT_BASIS_NASD
settlement = date(2000, 8, 1)
maturity = date(2010, 7, 1)
issue = date(2000, 7, 1)
yieldmat = yieldMaturity(settlement, maturity, issue,
rate, price, basis)
print("The yield on a bond which pays at maturity is %.2f%%."
% (yieldmat * 100))
Output¶
The yield on a bond which pays at maturity is 6.74%.