Language Reference

RATES Function

calculates a column vector of (per-period, such as per-year) interest rates converted from one base to another

RATES( rates,oldfreq,newfreq)

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 corresponding to the old base. Elements should be positive.
oldfreq
is a scalar that represents the old base. If positive, it represents discrete compounding as the reciprocal of the number of compoundings per period. If zero, it represents continuous compounding. If -1, the rates represent discount factors. No other negative values are accepted.
newfreq
is a scalar that represents the new base. If positive, it represents discrete compounding as the reciprocal of the number of compoundings per period. If zero, it represents continuous compounding. If -1, the rates represent discount factors. No other negative values are accepted.

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-period discount factors d_t:
d(t) = d_t^t
with continuous compounding:
   d(t) = e^{-r_t t}
with discrete compounding:
   d(t) = (1+fr)^{-t/f}
where 0 \lt f \lt 1 is the frequency, the reciprocal of the number of compoundings per period. The RATES function converts between these three representations.

For example, the following code uses the RATES function:

  
    rates=T(do(0.1,0.3,0.1)); 
    oldfreq=0; 
    newfreq=0; 
    rates=rates(rates,oldfreq,newfreq); 
    print rates;
 

The output is as follows:

  
                              RATES 
                               0.1 
                               0.2 
                               0.3
 

Previous Page | Next Page | Top of Page