SPOT (times, forward_rates);
The SPOT function returns an
vector of (per-period) spot rates, given vectors of forward rates and times.
The arguments to the SPOT function are as follows:
is an
column vector of times in consistent units. Elements should be nonnegative.
is an
column vector of corresponding (per-period) forward rates. Elements should be positive.
The SPOT function transforms the given spot rates as
![\[ s_1=f_1 \]](images/imlug_langref1351.png)
![\[ s_ i = \left( \Pi _{j=1}^{j=i}(1+f_ j)^{t_ j - t_{j-1}} \right)^{\frac{1}{t_ i}} -1; \quad i=2,\ldots ,n \]](images/imlug_langref1352.png)
where, by convention,
.
For example, the following statements produce the output shown in FigureĀ 25.391:
time = T(do(1, 5, 1)); forward = T(do(0.05, 0.09, 0.01)); spot = spot(time, forward); print spot;