yield_periodic
Evaluates the yield of a security that pays periodic interest.
Synopsis
#include <imsl.h>
float imsl_f_yield_periodic (struct tm settlement, struct tm maturity, float coupon_rate, float price, float redemption, int frequency, int basis, …, 0)
The type double function is imsl_d_yield_periodic.
Required Arguments
struct tm 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.
struct tm 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 coupon_rate (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 IMSL_ANNUAL, IMSL_SEMIANNUAL or IMSL_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 IMSL_DAY_CNT_BASIS_ACTUALACTUAL, IMSL_DAY_CNT_BASIS_NASD, IMSL_DAY_CNT_BASIS_ACTUAL360, IMSL_DAY_CNT_BASIS_ACTUAL365, or IMSL_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.
Synopsis with Optional Arguments
#include <imsl.h>
float imsl_f_yield_periodic (struct tm settlement, struct tm maturity, float coupon_rate, float price, float redemption, int frequency, int basis,
IMSL_XGUESS, float guess,
IMSL_HIGHEST, float max,
0)
Optional Arguments
IMSL_XGUESS, float guess (Input)
Initial guess at the internal rate of return.
IMSL_HIGHEST, float max (Input)
Maximum value of the yield.
Default: 1.0 (100%)
Description
Function imsl_f_yield_periodic 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, imsl_f_yield_periodic 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.
#include <stdio.h>
#include <imsl.h>
int main()
{
struct tm settlement, maturity;
float coupon_rate = .06;
float price = 95.40663;
float redemption = 105.;
int frequency = IMSL_SEMIANNUAL;
int basis = IMSL_DAY_CNT_BASIS_NASD;
float yield;
settlement.tm_year = 100;
settlement.tm_mon = 6;
settlement.tm_mday = 1;
maturity.tm_year = 110;
maturity.tm_mon = 6;
maturity.tm_mday = 1;
yield = imsl_f_yield_periodic (settlement, maturity, coupon_rate,
price, redemption, frequency, basis, 0);
printf ("The yield of the bond is %.2f%%.\n", yield * 100.);
}
Output
The yield of the bond is 7.00%.