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 or QUARTERLY. For a more detailed discussion on frequency 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 on basis 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:

\[\left\{ \frac {\left(\frac{\mathit{redemption}}{100} * \frac{\mathit{couponRate}}{\mathit{freq}}\right) - \left[ \frac{\mathit{price}}{100} + \left(\frac{A}{E} * \frac{\mathit{couponRate}}{\mathit{freq}}\right) \right]} {\frac{\mathit{price}}{100} + \left(\frac{A}{E} * \frac{\mathit{couponRate}}{\mathit{freq}}\right)} \right\} \left(\frac{\mathit{freq} * E}{\mathit{DSR}}\right)\]

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:

\[\mathit{price} - \left( \left( \frac {\mathit{redemption}} {\left(1 + \frac {\mathit{yield}} {\mathit{freq}} \right)^{\left(N - 1 + \frac{\mathit{DSC}}{E}\right)} } \right) + \left[ \sum_{k=1}^{N}\frac {100 * \frac{\mathit{rate}}{\mathit{freq}}} {\left(1 + \frac{\mathit{yield}}{\mathit{freq}}\right)^ {\left(k - 1 + \frac{\mathit{DSC}}{E}\right)}} \right] - \left(100 * \frac{\mathit{rate}}{\mathit{freq}} * \frac{A}{E}\right) \right) = 0\]

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%.