accrInterestPeriodic

Evaluates the interest which has accrued on a security that pays interest periodically.

Synopsis

accrInterestPeriodic (issue, firstCoupon, settlement, couponRate, parValue, frequency, basis)

Required Arguments

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.
date firstCoupon (Input)
First date on which an interest payment is due on the security (e.g., the coupon date). For a more detailed discussion on dates see the Usage Notes section of this chapter.
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.
float couponRate (Input)
Annual interest rate set forth on the face of the security; the coupon rate.
float parValue (Input)
Nominal or face value of the security used to calculate interest payments.
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 see the Usage Notes section of this chapter.

Return Value

The accrued interest for a security that pays periodic interest. If no result can be computed, NaN is returned.

Description

Function accrInterestPeriodic computes the accrued interest for a security that pays periodic interest.

In the equation below, \(A_i\) represents the number of days which have accrued for the i-th quasi-coupon period within the odd period. (The quasi-coupon periods are periods obtained by extending the series of equal payment periods to before or after the actual payment periods.) NC represents the number of quasi-coupon periods within the odd period, rounded to the next highest integer. (The odd period is a period between payments that differs from the usual equally spaced periods at which payments are made.) \(NL_i\) represents the length of the normal i-th quasi-coupon period within the odd period. \(NL_i\) is expressed in days.

Function accrInterestPeriodic can be found by solving the following:

\[(\mathit{parValue})\left( \frac{\mathit{rate}}{\mathit{frequency}} \left[ \sum_{\mathrm{i}=1}^{\mathrm{NC}} \left(\frac{A_{\mathrm{i}}}{NL_{\mathrm{i}}}\right) \right] \right)\]

Example

In this example, accrInterestPeriodic computes the accrued interest for a security that pays periodic interest using the US (NASD) 30/360 day count method. The security has a par value of $1,000, the issue date of October 1, 1999, the settlement date of November 3, 1999, the first coupon date of March 31, 2000, and a coupon rate of 6%.

from __future__ import print_function
from numpy import *
from datetime import date
from pyimsl.math.accrInterestPeriodic import accrInterestPeriodic, DAY_CNT_BASIS_NASD, SEMIANNUAL

rate = .06
par = 1000.
frequency = SEMIANNUAL
basis = DAY_CNT_BASIS_NASD

issue = date(1999, 10, 1)
first_coupon = date(2000, 3, 31)
settlement = date(1999, 11, 3)

accrint = accrInterestPeriodic(issue, first_coupon,
                               settlement, rate, par, frequency, basis)
print("The accrued interest is $%.2f." % (accrint))

Output

The accrued interest is $5.33.