swaptionbycir

Price swaption from Cox-Ingersoll-Ross interest-rate tree

Syntax

[Price,PriceTree] = swaptionbycir(CIRTree,OptSpec,Strike,ExerciseDates,Spread,Settle,Maturity)
[Price,PriceTree] = swaptionbycir(___,Name,Value)

Description

example

[Price,PriceTree] = swaptionbycir(CIRTree,OptSpec,Strike,ExerciseDates,Spread,Settle,Maturity) prices swaption with a Cox-Ingersoll-Ross (CIR) tree using a CIR++ model with the Nawalka-Beliaeva (NB) approach.

example

[Price,PriceTree] = swaptionbycir(___,Name,Value) adds optional name-value pair arguments.

Examples

collapse all

Define a 3-year put swaption.

Rates =0.075 * ones (10,1);   
Compounding = 2;    
StartDates = ['Jan-1-2017';'Jul-1-2017';'Jan-1-2018';'Jul-1-2018';'Jan-1-2019';...
'Jul-1-2019';'Jan-1-2020'; 'Jul-1-2020';'Jan-1-2021';'Jul-1-2021'];    
EndDates =['Jul-1-2017';'Jan-1-2018';'Jul-1-2018';'Jan-1-2019';'Jul-1-2019';...
'Jan-1-2020';'Jul-1-2020';'Jan-1-2021';'Jul-1-2021';'Jan-1-2022'];      
ValuationDate = 'Jan-1-2017';      

Create a RateSpec using the intenvset function.

RateSpec = intenvset('ValuationDate', ValuationDate, 'StartDates', ValuationDate, 'EndDates',EndDates,'Rates', Rates, 'Compounding', Compounding); 

Create a CIR tree.

NumPeriods = length(EndDates); 
Alpha = 0.03; 
Theta = 0.02;  
Sigma = 0.1;    
Maturity = '01-jan-2023'; 
CIRTimeSpec = cirtimespec(ValuationDate, Maturity, NumPeriods); 
CIRVolSpec = cirvolspec(Sigma, Alpha, Theta); 

CIRT = cirtree(CIRVolSpec, RateSpec, CIRTimeSpec)
CIRT = struct with fields:
      FinObj: 'CIRFwdTree'
     VolSpec: [1x1 struct]
    TimeSpec: [1x1 struct]
    RateSpec: [1x1 struct]
        tObs: [0 0.6000 1.2000 1.8000 2.4000 3 3.6000 4.2000 4.8000 5.4000]
        dObs: [1x10 double]
     FwdTree: {1x10 cell}
     Connect: {1x9 cell}
       Probs: {1x9 cell}

Use the following arguments for a 1-year swap and a 3-year swaption.

ExerciseDates = 'Jan-1-2020';
SwapSettlement = ExerciseDates;
SwapMaturity   = 'Jan-1-2022';
Spread = 0;
SwapReset = 2 ; 
Principal = 100;
OptSpec = 'put';  
Strike= 0.04;
Basis=1;

Price the swaption.

[Price,PriceTree] = swaptionbycir(CIRT,OptSpec,Strike,ExerciseDates,Spread,SwapSettlement,SwapMaturity,'SwapReset',SwapReset, ...
'Basis',Basis,'Principal',Principal)
Price = 3.1537
PriceTree = struct with fields:
     FinObj: 'CIRPriceTree'
      PTree: {1x11 cell}
       tObs: [0 0.6000 1.2000 1.8000 2.4000 3 3.6000 4.2000 4.8000 5.4000 6]
    Connect: {1x9 cell}
      Probs: {1x9 cell}

Input Arguments

collapse all

Interest-rate tree structure, specified by using cirtree.

Data Types: struct

Definition of the option as 'call' or 'put', specified as a NINST-by-1 cell array of character vectors or string arrays. For more information, see Definitions.

Data Types: char | cell | string

Strike swap rate values, specified as a NINST-by-1 vector.

Data Types: double

Exercise dates for the swaption, specified as a NINST-by-1 vector or NINST-by-2 using serial date numbers, date character vectors, string arrays, or datetime arrays depending on the option type.

  • For a European option, ExerciseDates are a NINST-by-1 vector of exercise dates. Each row is the schedule for one option. When using a European option, there is only one ExerciseDate on the option expiry date.

  • For an American option, ExerciseDates are a NINST-by-2 vector of exercise date boundaries. For each instrument, the option can be exercised on any coupon date between or including the pair of dates on that row. If only one non-NaN date is listed, or if ExerciseDates is NINST-by-1, the option can be exercised between the ValuationDate of the tree and the single listed ExerciseDate.

Data Types: double | char | cell | string | datetime

Number of basis points over the reference rate, specified as a NINST-by-1 vector.

Data Types: double

Settlement date (representing the settle date for each swap), specified as a NINST-by-1 vector of serial date numbers, date character vectors, string arrays, or datetime arrays. The Settle date for every swaption is set to the ValuationDate of the CIR tree. The swap argument Settle is ignored. The underlying swap starts at the maturity of the swaption.

Data Types: double | char | string | datetime

Maturity date for each swap, specified as a NINST-by-1 vector of dates using serial date numbers, date character vectors, string arrays, or datetime arrays.

Data Types: double | char | cell | string | datetime

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: [Price,PriceTree] = swaptionbycir(CIRTree,OptSpec, ExerciseDates,Spread,Settle,Maturity,'SwapReset',4,'Basis',5,'Principal',10000)

Option type, specified as the comma-separated pair consisting of 'AmericanOpt'and NINST-by-1 positive integer flags with values:

  • 0 — European

  • 1 — American

Data Types: double

Reset frequency per year for the underlying swap, specified as the comma-separated pair consisting of 'SwapReset' and a NINST-by-1 vector or NINST-by-2 matrix representing the reset frequency per year for each leg. If SwapReset is NINST-by-2, the first column represents the receiving leg, and the second column represents the paying leg.

Data Types: double

Day-count basis representing the basis used when annualizing the input forward-rate tree for each instrument, specified as the comma-separated pair consisting of 'Basis' and a NINST-by-1 vector or NINST-by-2 matrix representing the basis for each leg. If Basis is NINST-by-2, the first column represents the receiving leg, while the second column represents the paying leg.

  • 0 = actual/actual

  • 1 = 30/360 (SIA)

  • 2 = actual/360

  • 3 = actual/365

  • 4 = 30/360 (PSA)

  • 5 = 30/360 (ISDA)

  • 6 = 30/360 (European)

  • 7 = actual/365 (Japanese)

  • 8 = actual/actual (ICMA)

  • 9 = actual/360 (ICMA)

  • 10 = actual/365 (ICMA)

  • 11 = 30/360E (ICMA)

  • 12 = actual/365 (ISDA)

  • 13 = BUS/252

For more information, see basis.

Data Types: double

Notional principal amount, specified as the comma-separated pair consisting of 'Principal' and a NINST-by-1 vector.

Data Types: double

Output Arguments

collapse all

Expected prices of the swaptions at time 0, returned as a NINST-by-1 vector.

Tree structure of instrument prices, returned as a MATLAB® structure of trees containing vectors of swaption instrument prices and a vector of observation times for each node. Within PriceTree:

  • PriceTree.PTree contains the clean prices.

  • PriceTree.tObs contains the observation times.

  • PriceTree.Connect contains the connectivity vectors. Each element in the cell array describes how nodes in that level connect to the next. For a given tree level, there are NumNodes elements in the vector, and they contain the index of the node at the next level that the middle branch connects to. Subtracting 1 from that value indicates where the up-branch connects to, and adding 1 indicated where the down branch connects to.

  • PriceTree.Probs contains the probability arrays. Each element of the cell array contains the up, middle, and down transition probabilities for each node of the level.

More About

collapse all

Call Swaption

A call swaption or payer swaption allows the option buyer to enter into an interest-rate swap in which the buyer of the option pays the fixed rate and receives the floating rate.

Put Swaption

A put swaption or receiver swaption allows the option buyer to enter into an interest-rate swap in which the buyer of the option receives the fixed rate and pays the floating rate.

References

[1] Cox, J., Ingersoll, J., and S. Ross. "A Theory of the Term Structure of Interest Rates." Econometrica. Vol. 53, 1985.

[2] Brigo, D. and F. Mercurio. Interest Rate Models - Theory and Practice. Springer Finance, 2006.

[3] Hirsa, A. Computational Methods in Finance. CRC Press, 2012.

[4] Nawalka, S., Soto, G., and N. Beliaeva. Dynamic Term Structure Modeling. Wiley, 2007.

[5] Nelson, D. and K. Ramaswamy. "Simple Binomial Processes as Diffusion Approximations in Financial Models." The Review of Financial Studies. Vol 3. 1990, pp. 393–430.

Introduced in R2018a