yieldPeriodic¶
Evaluates the yield of a security that pays periodic interest.
Synopsis¶
yieldPeriodic (settlement, maturity, couponRate, price, redemption, frequency, 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.
- float
couponRate
(Input) - Annual coupon rate.
- float
price
(Input) - Price per $100 face value of the security.
- float
redemption
(Input) - Redemption value per $100 face value of the security.
- int
frequency
(Input) - Frequency of the interest payments. It should be one of
ANNUAL
,SEMIANNUAL
orQUARTERLY
. For a more detailed discussion onfrequency
see the Usage Notes section of this chapter. - 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
,or DAY_CNT_BASIS_30E360
. For a more detailed discussion onbasis
see the Usage Notes section of this chapter.
Return Value¶
The yield of a security that pays interest periodically. If no result can be computed, NaN is returned.
Optional Arguments¶
xguess,
float (Input)- Initial guess at the internal rate of return.
highest,
float (Input)Maximum value of the yield.
Default: 1.0 (100%)
Description¶
Function yieldPeriodic
computes the yield of a security that pays
periodic interest. If there is one coupon period use the following:
In the equation above, DSR represents the number of days in the period starting with the settlement date and ending with the redemption date. E represents the number of days within the coupon period. A represents the number of days in the period starting with the beginning of coupon period and ending with the settlement date.
If there is more than one coupon period use the following:
In the equation above, DSC represents the number of days in the period from the settlement to the next coupon date. E represents the number of days within the coupon period. N represents the number of coupons payable in the period starting with the settlement date and ending with the redemption date. A represents the number of days in the period starting with the beginning of the coupon period and ending with the settlement date.
Example¶
In this example, yieldPeriodic
computes yield of a security which is
selling at $95.40663 with the settlement date of July 1, 1985, the maturity
date of July 1, 1995, and the coupon 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.yieldPeriodic import yieldPeriodic, DAY_CNT_BASIS_NASD, SEMIANNUAL
coupon_rate = .06
price = 95.40663
redemption = 105.
frequency = SEMIANNUAL
basis = DAY_CNT_BASIS_NASD
settlement = date(2000, 7, 1)
maturity = date(2010, 7, 1)
yieldper = yieldPeriodic(settlement, maturity, coupon_rate,
price, redemption, frequency, basis)
print("The yield of the bond is %.2f%%." % (yieldper * 100))
Output¶
The yield of the bond is 7.00%.