bootstrap

Bootstrap interest-rate curve from market data

Syntax

Dcurve = IRDataCurve.bootstrap(Type, Settle, InstrumentTypes,
Instruments) Dcurve = IRDataCurve.bootstrap(Type, Settle, InstrumentTypes,
Instruments, 'Parameter1', Value1, 'Parameter2', Value2, ...)

Arguments

Type

Type of interest-rate curve. Acceptable values are: discount, forward, or zero.

Settle

Scalar or column vector of settlement dates.

InstrumentTypes

N-by-1 cell array (where N is the number of instruments) indicating what kind of instrument is in the Instruments matrix. Acceptable values are deposit, futures, swap, bond, and fra.

Instruments

N-by-3 data matrix for Instruments where the first column is Settle date, the second column is Maturity, and the third column is the market quote (dates must be MATLAB® date numbers). The market quote represents the following for each instrument:

  • deposit: rate

  • futures: price (e.g., 9628.54)

  • swap: rate

  • bond: clean price

  • fra: forward rate

      Note:   When using fra, the first column of N-by-3 data matrix for Instruments is the start dates for the forward rate agreement (FRA).

Compounding

(Optional) Scalar that sets the compounding frequency per year for an IRDataCurve object:

  • -1 =  Continuous compounding

  • 1 = Annual compounding

  • 2 = Semiannual compounding (default)

  • 3 = Compounding three times per year

  • 4 = Quarterly compounding

  • 6 = Bimonthly compounding

  • 12 = Monthly compounding

    Note:   Simple interest can be specified for an instrument by specifying the Compounding value as 0.

Basis

(Optional) Day-count basis of the interest-rate curve. A scalar of integers.

  • 0 = actual/actual (default)

  • 1 = 30/360 (SIA)

  • 2 = actual/360

  • 3 = actual/365

  • 4 = 30/360 (BMA)

  • 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/actual (ISDA)

  • 13 = BUS/252

For more information, see basis.

InterpMethod

(Optional) Values are:

  • 'linear' — Linear interpolation (default).

  • 'constant' — Piecewise constant interpolation.

  • 'pchip' — Piecewise cubic Hermite interpolation.

  • 'spline' — Cubic spline interpolation.

IRBootstrapOptionsObj

(Optional) An IRBootstrapOptions object.

DiscountCurve

(Optional) RateSpec for a curve used to discount the cash flows.

Instrument Parameters

For each bond Instrument, you can specify the following additional instrument parameters as parameter/value pairs. For example, InstrumentBasis distinguishes a bond instrument's Basis value from the curve's Basis value. For instruments of type deposit, futures, or swap the Basis and Compounding values must be identical for each instance of the instrument.

InstrumentCouponRate

(Optional) Decimal number indicating the annual percentage rate used to determine the coupons payable on an instrument.

InstrumentPeriod

(Optional) Coupons per year of the instrument. A vector of integers. Allowed values are 0, 1, 2 (default), 3, 4, 6, and 12.

InstrumentBasis

(Optional) Day-count basis of the instrument. A vector of integers.

  • 0 = actual/actual (default)

  • 1 = 30/360 (SIA)

  • 2 = actual/360

  • 3 = actual/365

  • 4 = 30/360 (BMA)

  • 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/actual (ISDA)

  • 13 = BUS/252

For more information, see basis.

InstrumentEndMonthRule

(Optional) End-of-month rule. A vector. This rule applies only when Maturity is an end-of-month date for a month having 30 or fewer days. 0 = ignore rule, meaning that an instrument's coupon payment date is always the same numerical day of the month. 1 = set rule on (default), meaning that an instrument's coupon payment date is always the last actual day of the month.

InstrumentIssueDate

(Optional) Date when an instrument was issued.

InstrumentFirstCouponDate

(Optional) Date when a bond makes its first coupon payment; used when bond has an irregular first coupon period. When FirstCouponDate and LastCouponDate are both specified, FirstCouponDate takes precedence in determining the coupon payment structure. If you do not specify a FirstCouponDate, the cash flow payment dates are determined from other inputs.

InstrumentLastCouponDate

(Optional) Last coupon date of a bond before the maturity date; used when bond has an irregular last coupon period. In the absence of a specified FirstCouponDate, a specified LastCouponDate determines the coupon structure of the bond. The coupon structure of a bond is truncated at the LastCouponDate, regardless of where it falls, and is followed only by the bond's maturity cash flow date. If you do not specify a LastCouponDate, the cash flow payment dates are determined from other inputs.

InstrumentFace

(Optional) Face or par value. Default = 100.

    Note:   When using Instrument parameter/value pairs, you can specify simple interest for an Instrument by specifying the InstrumentPeriod value as 0. If InstrumentBasis and InstrumentPeriod are not specified for an Instrument, the following default values are used:

    • deposit instrument uses Basis as 2 (act/360) and Compounding is 0 (simple interest).

    • futures instrument uses Basis as 2 (act/360) and Compounding is 4 (quarterly).

    • swap instrument uses Basis as 2 (act/360) and Compounding is 2.

    • bond instrument uses Basis as 0 (act/act) and Compounding is 2.

    • FRA instrument uses Basis as 2 (act/360) and Compounding is 4 (quarterly).

Description

Dcurve = IRDataCurve.bootstrap(Type, Settle, InstrumentTypes, Instruments, 'Parameter1', Value1, 'Parameter2', Value2, ...) bootstraps an interest-rate curve from market data. The dates of the bootstrapped curve correspond to the maturity dates of the input instruments. You must enter the optional arguments for Basis, Compounding, Interpmethod, IRBootstrapOptionsObj, and DiscountCurve as parameter/value pairs.

Examples

expand all

Use the bootstrap Method to Create an IRDataCurve Object

In this bootstrapping example, InstrumentTypes, Instruments, and a Settle date are defined:

InstrumentTypes = {'Deposit';'Deposit';...
'Futures';'Futures';'Futures';'Futures';'Futures';'Futures';...
'Swap';'Swap';'Swap';'Swap';};

Instruments = [datenum('08/10/2007'),datenum('09/17/2007'),.0532000; ...
datenum('08/10/2007'),datenum('11/17/2007'),.0535866; ...
datenum('08/08/2007'),datenum('19-Dec-2007'),9485; ...
datenum('08/08/2007'),datenum('19-Mar-2008'),9502; ...
datenum('08/08/2007'),datenum('18-Jun-2008'),9509.5; ...
datenum('08/08/2007'),datenum('17-Sep-2008'),9509; ...
datenum('08/08/2007'),datenum('17-Dec-2008'),9505.5; ...
datenum('08/08/2007'),datenum('18-Mar-2009'),9501; ...
datenum('08/08/2007'),datenum('08/08/2014'),.0530; ...
datenum('08/08/2007'),datenum('08/08/2019'),.0551; ...
datenum('08/08/2007'),datenum('08/08/2027'),.0565; ...
datenum('08/08/2007'),datenum('08/08/2037'),.0566];

CurveSettle = datenum('08/10/2007');

Use the bootstrap method to create an IRDataCurve object.

bootModel = IRDataCurve.bootstrap('Forward', CurveSettle, ...
InstrumentTypes, Instruments,'InterpMethod','pchip');

To create the plot for the bootstrapped market data:

PlottingDates = (datenum('08/11/2007'):30:CurveSettle+365*25)';
plot(PlottingDates, getParYields(bootModel, PlottingDates),'r')
ylim([0 .06])
datetick

Use the bootstrap Method to Create an IRDataCurve Object That Includes Bonds

In this bootstrapping example, InstrumentTypes, Instruments, and a Settle date are defined:

CurveSettle = datenum('8-Mar-2010');

InstrumentTypes = {'Deposit';'Deposit';'Deposit';'Deposit';...
    'Futures';'Futures';'Futures';'Futures';'Swap';'Swap';'Bond';'Bond'};

Instruments = [datenum('8-Mar-2010'),datenum('8-Apr-2010'),.003; ...
    datenum('8-Mar-2010'),datenum('8-Jun-2010'),.005; ...
    datenum('8-Mar-2010'),datenum('8-Sep-2010'),.007; ...
    datenum('8-Mar-2010'),datenum('8-Mar-2011'),.009; ...
    datenum('8-Mar-2010'),datenum('18-Jun-2011'),9840; ...
    datenum('8-Mar-2010'),datenum('17-Sep-2011'),9820; ...
    datenum('8-Mar-2010'),datenum('17-Dec-2011'),9810; ...
    datenum('8-Mar-2010'),datenum('18-Mar-2012'),9800; ...
    datenum('8-Mar-2010'),datenum('8-Mar-2015'),.025; ...
    datenum('8-Mar-2010'),datenum('8-Mar-2020'),.035; ...
    datenum('8-Mar-2010'),datenum('8-Mar-2030'),99; ...
    datenum('8-Mar-2010'),datenum('8-Mar-2040'),101];

When bonds are used, InstrumentCouponRate must be specified:

InstrumentCouponRate = [zeros(10,1);.045;.05];

Note, for parameters that are only applicable to bonds (e.g.: InstumentFirstCouponDate, InstrumentLastCouponDate, InstumentIssueDate, InstumentFace) the entries for non-bond instruments (deposits and futures) are ignored.

Use the bootstrap method to create an IRDataCurve object.

bootModel = IRDataCurve.bootstrap('Forward', CurveSettle, ...
InstrumentTypes, Instruments,'InterpMethod','pchip',...
'InstrumentCouponRate',InstrumentCouponRate);

To create the plot for the bootstrapped market data:

PlottingDates = daysadd(CurveSettle,30:30:30*360,1);
plot(PlottingDates, getParYields(bootModel, PlottingDates),'r')
ylim([0 .06])
datetick

Was this topic helpful?