RATES Function
calculates a column vector of interest rates converted from one base to another
the RATES function returns an n x 1 vector of interest rates converted
from one base to another.
- rates
- is an n x 1 column vector of rates.
Elements should be positive.
- oldfreq
- is a scalar which represents the old base.
If positive, it represents discrete compounding
as the reciprocal of the number of compoundings.
If zero, it represents continuous compounding.
If -1, it represents discount factors.
No other negative values are allowed
- newfreq
- is a scalar which represents the new base.
If positive, it represents discrete compounding
as the reciprocal of the number of compoundings.
If zero, it represents continuous compounding.
If -1, it represents per-period discount factors.
No other negative values are allowed
Let D(t) be the discount function, which is
the present value of a unit amount to be received t periods from now.
The discount function can be expressed in three different ways:
with per-unit-time-period discount factors dt:
-
D(t) = dtt
with continuous compunding:
-
D(t) = e-rt t
with discrete compunding:
-
D(t) = (1+fr)-(t/f)
where f > 0 is the frequency, the reciprocal of the number of
compoundings per unit time period. The RATES function converts
between these three representations.
Example
proc iml;
rates=do(.1,.3,.1);
oldfreq=0;
newfreq=0;
rates2=T(rates);
rates=rates(rates2,oldfreq,newfreq);
print rates;
quit;
RATES
0.1
0.2
0.3
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.