Derivatives Expert



|   PREVIOUS EXAMPLE   |   INDEX OF EXAMPLES   |   NEXT EXAMPLE   |


Example 4: Defining a term structure function

Often it is the case that you have a number of interest rates that you would like to interpolate into some function. This can be done using the function DerivativesExpert`TermStructureTools`InterpolateInterestRates.

To end up with the following situation 
first enter your thetas (time to maturities) and your interest rates in a table such as the one shown. The range A2:B6 is interpreted as {{0.25, 7.91},{1,8.11},{3,8.2},{4,8.3},{11,8.55}} by the Mathematica kernel, and this is exactly the way you want it to be interpreted.

In cell B8 a function called "termstructure" has been defined (please refer to the Derivatives Expert documentation on the function InterpolateInterestRates in the TermStructureTools.m package). With the termstructure function we can now find any interest rate for the range of thetas 0.25 to 11 years. This is shown here for a selected number of thetas. 
Note that the calculation is just like a function call, e.g. =Math("termstructure", A14) is equal to 8.41 (rounded).

 
Copyright © 1994-2009 Innova Financial Solutions ApS. All rights reserved.   

Updated 2 August 2009