Usage Notes¶
Users can perform financial computations by using pre-defined data types. Most of the financial functions require one or more of the following:
- Date
- Number of payments per year
- A variable to indicate when payments are due
- Day count basis
PyIMSL Math Library provides the identifiers for the input, frequency
,
to indicate the number of payments for each year. The identifiers are
ANNUAL
, SEMIANNUAL
, and
QUARTERLY
.
Identifier (frequency) | Meaning |
---|---|
ANNUAL |
One payment per year (Annual payment) |
SEMIANNUAL |
Two payments per year (Semi-annual payment) |
QUARTERLY |
Four payments per year (Quarterly payment) |
PyIMSL Math Library provides the identifiers for the input, when
, to
indicate when payments are due. The identifiers are AT_END_OF_PERIOD
,
AT_BEGINNING_OF_PERIOD
.
Identifier (when) | Meaning |
---|---|
AT_END_OF_PERIOD |
Payments are due at the end of the period |
AT_BEGINNING_OF_PERIOD |
Payments are due at the beginning of the period |
PyIMSL Math Library provides the identifiers for the input, basis
, to
indicate the type of day count basis. Day count basis is the method for
computing the number of days between two dates. The identifiers are
DAY_CNT_BASIS_NASD
, DAY_CNT_BASIS_ACTUALACTUAL
,
DAY_CNT_BASIS_ACTUAL360
, DAY_CNT_BASIS_ACTUAL365
, and
DAY_CNT_BASIS_30E360
.
Identifier (basis) | Day count basis |
---|---|
DAY_CNT_BASIS_NASD |
US (NASD) 30/360 |
DAY_CNT_BASIS_ACTUALACTUAL |
Actual/Actual |
DAY_CNT_BASIS_ACTUAL360 |
Actual/360 |
DAY_CNT_BASIS_ACTUAL365 |
Actual/365 |
DAY_CNT_BASIS_30E360 |
European 30/360 |
PyIMSL Math Library uses the Python programming language date objects from the datetime module to represent dates.
For example, to declare a variable to represent Jan 2, 2008, use the following code segment:
from datetime import date
var = date(2008,1,2)
Additional Information¶
In preparing the finance and bond functions we incorporated standards used by SIA Standard Securities Calculation Methods.
More detailed information on finance and bond functionality can be found in the following manuals:
- SIA Standard Securities Calculation Methods 1993, vols. 1 & 2, Third Edition.
- Accountants’ Handbook, Volume 1, Sixth Edition.
- Microsoft Excel 5, Worksheet Function Reference.