Compute the discount factor for a specific time period, compounding type,
day count basis and compounding frequency.
Input and output variables:
- d1: number of days until first date (scalar)
- d2: number of days until second date (scalar)
- rate: interest rate between first and second date (scalar)
- comp_type: compounding type: [simple, simp, disc, discrete,
cont, continuous] (string)
- basis: day-count basis (scalar or string)
- comp_freq: 1,2,4,12,52,365 or [daily,weekly,monthly,
quarter,semi-annual,annual] (scalar or string)
- df: OUTPUT: discount factor (scalar)
See also: timefactor.