Finance - Maple Programming Help

Home : Support : Online Help : Mathematics : Finance : Interest Rates : Finance/FairRate

Finance

 FairRate
 return the fair rate of an interest rate swap

 Calling Sequence FairRate(swap, discountrate)

Parameters

 swap - swap data structure; interest rate swap discount - non-negative constant of a yield term structure; discount rate

Description

 • The FairRate command returns the fair rate of the given interest rate swap.

Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$
 > $\mathrm{SetEvaluationDate}\left("January 02, 2007"\right):$
 > $\mathrm{EvaluationDate}\left(\right)$
 ${"January 2, 2007"}$ (1)

Consider two payment schedules. The first one consists of payments of 5% of the nominal every month between January 3, 2008 and January 3, 2018. The second one consists of payments of 3% of the nominal every quarter between January 3, 2010 and January 3, 2015.

 > $\mathrm{Schedule1}≔\mathrm{Schedule}\left("January 03, 2008","January 03, 2018",\mathrm{Monthly}\right)$
 ${\mathrm{Schedule1}}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (2)
 > $\mathrm{Schedule2}≔\mathrm{Schedule}\left("January 03, 2010","January 03, 2015",\mathrm{Quarterly}\right)$
 ${\mathrm{Schedule2}}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (3)
 > $\mathrm{Rate1}≔0.05$
 ${\mathrm{Rate1}}{≔}{0.05}$ (4)
 > $\mathrm{Rate2}≔\mathrm{BenchmarkRate}\left(0.03\right)$
 ${\mathrm{Rate2}}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (5)

Consider two simple swaps that exchange the first set of payments with the second set.

 > $\mathrm{Swap1}≔\mathrm{InterestRateSwap}\left(1000,\mathrm{Rate1},\mathrm{Schedule1},\mathrm{Rate2},\mathrm{Schedule2},0.03\right)$
 ${\mathrm{Swap1}}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (6)
 > $\mathrm{Swap2}≔\mathrm{InterestRateSwap}\left(1000,\mathrm{Rate2},\mathrm{Schedule2},\mathrm{Rate1},\mathrm{Schedule1},0.03\right)$
 ${\mathrm{Swap2}}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (7)
 > $\mathrm{DiscountRate}≔0.05$
 ${\mathrm{DiscountRate}}{≔}{0.05}$ (8)
 > $\mathrm{NetPresentValue}\left(\mathrm{Swap1},\mathrm{DiscountRate}\right)$
 ${-146.0132438}$ (9)
 > $\mathrm{NetPresentValue}\left(\mathrm{Swap2},\mathrm{DiscountRate}\right)$
 ${146.0132438}$ (10)
 > $\mathrm{FairRate1}≔\mathrm{FairRate}\left(\mathrm{Swap1},\mathrm{DiscountRate}\right)$
 ${\mathrm{FairRate1}}{≔}{0.03045073683}$ (11)
 > $\mathrm{FairRate2}≔\mathrm{FairRate}\left(\mathrm{Swap2},\mathrm{DiscountRate}\right)$
 ${\mathrm{FairRate2}}{≔}{0.03045073683}$ (12)

Consider the same simple swaps that use the fair rate.

 > $\mathrm{Swap3}≔\mathrm{InterestRateSwap}\left(1000,\mathrm{FairRate1},\mathrm{Schedule1},\mathrm{Rate2},\mathrm{Schedule2},0.03\right)$
 ${\mathrm{Swap3}}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (13)
 > $\mathrm{Swap4}≔\mathrm{InterestRateSwap}\left(1000,\mathrm{Rate2},\mathrm{Schedule2},\mathrm{FairRate2},\mathrm{Schedule1},0.03\right)$
 ${\mathrm{Swap4}}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (14)
 > $\mathrm{NetPresentValue}\left(\mathrm{Swap3},\mathrm{DiscountRate}\right)$
 ${-1.451178377}{}{{10}}^{{-8}}$ (15)
 > $\mathrm{NetPresentValue}\left(\mathrm{Swap4},\mathrm{DiscountRate}\right)$
 ${1.451178377}{}{{10}}^{{-8}}$ (16)

Compatibility

 • The Finance[FairRate] command was introduced in Maple 15.