 EuropeanSwaption - Maple Help

Finance

 EuropeanSwaption
 create a new European-style swaption Calling Sequence EuropeanSwaption(irswap, exercise, opts) Parameters

 swap - simple swap data structures; interest rate swap exercise - a non-negative constant, a string containing a date specification in a format recognized by Finance[ParseDate], or a date data structure; the maturity time or date opts - (optional) equation(s) of the form option = value where option is one of referencedate or daycounter; specify options for the EuropeanSwaption command Options

 • referencedate = a string containing a date specification in a format recognized by Finance[ParseDate] or a date data structure -- This option provides the evaluation date. It is set to the global evaluation date by default.
 • daycounter = a name representing a supported day counter (e.g. ISDA, Simple) or a day counter data structure created using the DayCounter constructor -- This option provides a day counter that will be used to convert the period between two dates to a fraction of the year. This option is used only if one of earliestexercise or latestexercise is specified as a date. Description

 • The EuropeanSwaption command creates a new European-style swaption with the specified payoff and maturity. The swaption can be exercised only at the time or date specified by the exercise parameter. This is the opposite of an American-style swaption, which can be exercised at any time before the expiration.
 • The parameter swap is the underlying interest rate swap (see InterestRateSwap for more details).
 • The parameter exercise specifies the time or date when the option can be exercised. It can be given either as a non-negative constant or as a date in any of the formats recognized by the Finance[ParseDate] command.
 • The LatticePrice command can be used to price a European-style swaption using any given binomial or trinomial tree. Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$
 > $\mathrm{SetEvaluationDate}\left("November 17, 2006"\right):$
 > $\mathrm{nominal}≔1000.0$
 ${\mathrm{nominal}}{≔}{1000.0}$ (1)
 > $\mathrm{fixing_days}≔2$
 ${\mathrm{fixing_days}}{≔}{2}$ (2)
 > $\mathrm{start}≔\mathrm{AdvanceDate}\left(1,\mathrm{Years},\mathrm{EURIBOR}\right)$
 ${\mathrm{start}}{≔}{"November 17, 2007"}$ (3)
 > $\mathrm{maturity}≔\mathrm{AdvanceDate}\left(\mathrm{start},5,\mathrm{Years},\mathrm{EURIBOR}\right)$
 ${\mathrm{maturity}}{≔}{"November 17, 2012"}$ (4)
 > $\mathrm{discount_curve}≔\mathrm{ForwardCurve}\left(0.04875825,'\mathrm{daycounter}'=\mathrm{Actual365Fixed}\right)$
 ${\mathrm{discount_curve}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (5)
 > $\mathrm{fixed_schedule}≔\mathrm{Schedule}\left(\mathrm{start},\mathrm{maturity},\mathrm{Annual},'\mathrm{convention}'=\mathrm{Unadjusted},'\mathrm{calendar}'=\mathrm{EURIBOR}\right)$
 ${\mathrm{fixed_schedule}}{≔}{\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{floating_schedule}≔\mathrm{Schedule}\left(\mathrm{start},\mathrm{maturity},\mathrm{Semiannual},'\mathrm{convention}'=\mathrm{ModifiedFollowing},'\mathrm{calendar}'=\mathrm{EURIBOR}\right)$
 ${\mathrm{floating_schedule}}{≔}{\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{benchmark}≔\mathrm{BenchmarkRate}\left(6,\mathrm{Months},\mathrm{EURIBOR},0.04875825\right)$
 ${\mathrm{benchmark}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (8)

Construct an interest rate swap receiving the fixed-rate payments in exchange for the floating-rate payments.

 > $\mathrm{swap}≔\mathrm{InterestRateSwap}\left(\mathrm{nominal},0.0,\mathrm{fixed_schedule},\mathrm{benchmark},\mathrm{floating_schedule},0.0\right)$
 ${\mathrm{swap}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (9)

Compute the at-the-money rate for this interest rate swap.

 > $\mathrm{atm_rate}≔\mathrm{FairRate}\left(\mathrm{swap},\mathrm{discount_curve}\right)$
 ${\mathrm{atm_rate}}{≔}{0.04995609574}$ (10)

Construct three swaps.

 > $\mathrm{itm_swap}≔\mathrm{InterestRateSwap}\left(\mathrm{nominal},0.8\mathrm{atm_rate},\mathrm{fixed_schedule},\mathrm{benchmark},\mathrm{floating_schedule},0.0\right)$
 ${\mathrm{itm_swap}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (11)
 > $\mathrm{atm_swap}≔\mathrm{InterestRateSwap}\left(\mathrm{nominal},1.0\mathrm{atm_rate},\mathrm{fixed_schedule},\mathrm{benchmark},\mathrm{floating_schedule},0.0\right)$
 ${\mathrm{atm_swap}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (12)
 > $\mathrm{otm_swap}≔\mathrm{InterestRateSwap}\left(\mathrm{nominal},1.2\mathrm{atm_rate},\mathrm{fixed_schedule},\mathrm{benchmark},\mathrm{floating_schedule},0.0\right)$
 ${\mathrm{otm_swap}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (13)

Here are cash flows for the paying leg of your interest rate swap.

 > $\mathrm{cash_flows}≔\mathrm{CashFlows}\left(\mathrm{itm_swap},\mathrm{paying}\right)$
 ${\mathrm{cash_flows}}{≔}\left[{\mathrm{39.97833882 on \text{'}November 17, 2008\text{'}}}{,}{\mathrm{39.95141436 on \text{'}November 17, 2009\text{'}}}{,}{\mathrm{39.96487659 on \text{'}November 17, 2010\text{'}}}{,}{\mathrm{39.96487659 on \text{'}November 17, 2011\text{'}}}{,}{\mathrm{39.97833882 on \text{'}November 19, 2012\text{'}}}\right]$ (14)

Here are cash flows for the receiving leg of your interest rate swap.

 > $\mathrm{CashFlows}\left(\mathrm{itm_swap},\mathrm{receiving}\right)$
 $\left[{\mathrm{24.55793340 on \text{'}May 19, 2008\text{'}}}{,}{\mathrm{24.54222773 on \text{'}November 17, 2008\text{'}}}{,}{\mathrm{24.59383300 on \text{'}May 18, 2009\text{'}}}{,}{\mathrm{24.74716833 on \text{'}November 17, 2009\text{'}}}{,}{\mathrm{24.47342475 on \text{'}May 17, 2010\text{'}}}{,}{\mathrm{24.88406756 on \text{'}November 17, 2010\text{'}}}{,}{\mathrm{24.47342475 on \text{'}May 17, 2011\text{'}}}{,}{\mathrm{24.88406756 on \text{'}November 17, 2011\text{'}}}{,}{\mathrm{24.55868130 on \text{'}May 17, 2012\text{'}}}{,}{\mathrm{25.08832826 on \text{'}November 19, 2012\text{'}}}\right]$ (15)

These are days when coupon payments are scheduled to occur.

 > $\mathrm{dates}≔\mathrm{map}\left(t→{t}_{\mathrm{date}},\mathrm{cash_flows}\right)$
 ${\mathrm{dates}}{≔}\left[{\mathrm{date}}{,}{\mathrm{date}}{,}{\mathrm{date}}{,}{\mathrm{date}}{,}{\mathrm{date}}\right]$ (16)
 > $\mathrm{itm_swaption}≔\mathrm{EuropeanSwaption}\left(\mathrm{itm_swap},\mathrm{AdvanceDate}\left({\mathrm{dates}}_{-2},1,\mathrm{Days},\mathrm{EURIBOR}\right)\right)$
 ${\mathrm{itm_swaption}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (17)
 > $\mathrm{atm_swaption}≔\mathrm{EuropeanSwaption}\left(\mathrm{atm_swap},\mathrm{AdvanceDate}\left({\mathrm{dates}}_{-2},1,\mathrm{Days},\mathrm{EURIBOR}\right)\right)$
 ${\mathrm{atm_swaption}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (18)
 > $\mathrm{otm_swaption}≔\mathrm{EuropeanSwaption}\left(\mathrm{otm_swap},\mathrm{AdvanceDate}\left({\mathrm{dates}}_{-2},1,\mathrm{Days},\mathrm{EURIBOR}\right)\right)$
 ${\mathrm{otm_swaption}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (19)

Price these swaptions using the Hull-White trinomial tree.

 > $a≔0.048696$
 ${a}{≔}{0.048696}$ (20)
 > $\mathrm{σ}≔0.0058904$
 ${\mathrm{\sigma }}{≔}{0.0058904}$ (21)
 > $\mathrm{model}≔\mathrm{HullWhiteModel}\left(\mathrm{discount_curve},a,\mathrm{σ}\right)$
 ${\mathrm{model}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (22)
 > $\mathrm{time_grid}≔\mathrm{TimeGrid}\left(\mathrm{YearFraction}\left(\mathrm{maturity}\right)+0.5,100\right)$
 ${\mathrm{time_grid}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (23)
 > $\mathrm{short_rate_tree}≔\mathrm{ShortRateTree}\left(\mathrm{model},\mathrm{time_grid}\right)$
 ${\mathrm{short_rate_tree}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (24)

Price your swaptions using the tree constructed above.

 > $\mathrm{LatticePrice}\left(\mathrm{itm_swaption},\mathrm{short_rate_tree},\mathrm{discount_curve}\right)$
 ${9.794855431}$ (25)
 > $\mathrm{LatticePrice}\left(\mathrm{atm_swaption},\mathrm{short_rate_tree},\mathrm{discount_curve}\right)$
 ${4.523445349}$ (26)
 > $\mathrm{LatticePrice}\left(\mathrm{otm_swaption},\mathrm{short_rate_tree},\mathrm{discount_curve}\right)$
 ${1.502550032}$ (27)

You can also price these swaptions using an explicitly constructed trinomial tree.

 > $\mathrm{ou_process}≔\mathrm{OrnsteinUhlenbeckProcess}\left(0.04875,0.04875,1.0,0.3\right)$
 ${\mathrm{ou_process}}{≔}{\mathrm{_X0}}$ (28)
 > $\mathrm{tree}≔\mathrm{ShortRateTree}\left(\mathrm{ou_process},\mathrm{time_grid}\right)$
 ${\mathrm{tree}}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (29)

Price your swaptions using the second tree.

 > $\mathrm{LatticePrice}\left(\mathrm{itm_swaption},\mathrm{tree},\mathrm{discount_curve}\right)$
 ${8.995305075}$ (30)
 > $\mathrm{LatticePrice}\left(\mathrm{atm_swaption},\mathrm{tree},\mathrm{discount_curve}\right)$
 ${1.528598823}$ (31)
 > $\mathrm{LatticePrice}\left(\mathrm{otm_swaption},\mathrm{tree},\mathrm{discount_curve}\right)$
 ${0.}$ (32) References

 Brigo, D., Mercurio, F., Interest Rate Models: Theory and Practice. New York: Springer-Verlag, 2001. Compatibility

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