irbootstrap

Bootstrap interest-rate curve from market data

Description

example

outCurve = irbootstrap(BootInstruments,Settle) creates a data structure for storing interest-rate term structure data. The outCurve output is a ratecurve object.

example

outCurve = irbootstrap(___,Name,Value) specifies options using one or more name-value pair arguments in addition to any of the input argument combinations in the previous syntax. For example, OutCurve = irbootstrap("zero",BootInstruments,Settle,'Compounding',2,'Basis',5,'InterpMethod',"cubic") bootstraps a zero curve from BootInstruments.

Examples

collapse all

Define Deposit and Swap Parameters

Settle = datetime(2018,3,21);
DepRates = [.0050769 .0054934 .0061432 .0072388 .0093263]';
DepTimes = [1 2 3 6 12]';
DepDates = datemnth(Settle,DepTimes);
nDeposits = length(DepTimes);
 
SwapRates = [.0112597 0;.0128489 0;.0138917 0;.0146135 0;.0151175 0;...
      .0155184 0;.0158536 0;.0161435 0];
SwapTimes = (2:9)';
SwapDates = datemnth(Settle,12*SwapTimes);
nSwaps = length(SwapTimes);
 
nInst = nDeposits + nSwaps;

Create a Vector of Market Swap Instruments

Use fininstrument to create a vector of market Deposit and Swap instrument objects.

 BootInstruments(nInst,1) = fininstrument.FinInstrument;
 for ii=1:length(DepDates)
      BootInstruments(ii) = fininstrument("deposit",'Maturity',DepDates(ii),'Rate',DepRates(ii));
 end
 
 for ii=1:length(SwapDates)
      BootInstruments(ii+nDeposits) = fininstrument("swap",'Maturity',SwapDates(ii),'LegRate',[SwapRates(ii) 0]);
 end

Create ratecurve Object for Zero-Rate Curve

Use irbootstrap to create a ratecurve object for the zero-rate curve.

ZeroCurve = irbootstrap(BootInstruments,Settle)
ZeroCurve = 
  ratecurve with properties:

                 Type: "zero"
          Compounding: -1
                Basis: 0
                Dates: [13x1 datetime]
                Rates: [13x1 double]
               Settle: 21-Mar-2018
         InterpMethod: "linear"
    ShortExtrapMethod: "linear"
     LongExtrapMethod: "linear"

Input Arguments

collapse all

Collection of instruments, specified as an array of instrument objects.

Data Types: object

Settlement date, specified as a scalar datetime, serial date number, date character vector, or date string.

Data Types: double | char | 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: OutCurve = irbootstrap("zero",BootInstruments,Settle,'Compounding',2,'Basis',5,'InterpMethod',"cubic")

Type of interest-rate curve, specified as a scalar string or character vector.

When you use irbootstrap, the value you specify for Type can impact the curve construction because it affects the type of data that is interpolated on (that is, forward rates, zero rates, or discount factors) during the bootstrapping process.

Data Types: char | string

Compounding frequency, specified as the comma-separated pair consisting of 'Compounding' and a scalar numeric using the supported values: –1, 0, 1, 2, 3, 4, 6, or 12.

Data Types: double

Day-count basis, specified as the comma-separated pair consisting of 'Basis' and a scalar integer.

  • 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

Interpolation method, specified as the comma-separated pair consisting of 'InterpMethod' and a scalar string or character vector using a supported value. For more information on interpolation methods, see interp1.

Data Types: char | string

Extrapolation method for data before first data, specified as the comma-separated pair consisting of 'ShortExtrapMethod' and a scalar string or character vector using a supported value. For more information on interpolation methods, see interp1.

Data Types: char | string

Extrapolation method for data after last data, specified as the comma-separated pair consisting of 'LongExtrapMethod' and a scalar string or character vector using a supported value. For more information on interpolation methods, see interp1.

Data Types: char | string

Output Arguments

collapse all

Rate curve, returned as a ratecurve object. The object has the following properties:

  • Type

  • Settle

  • Compounding

  • Basis

  • Dates

  • Rates

  • InterpMethod

  • ShortExtrapMethod

  • LongExtrapMethod

Introduced in R2020a