Products & Services Solutions Academia Support User Community Company

Learn more about Fixed-Income Toolbox   

bootstrap - Bootstrap interest-rate curve from market data

Class

@IRDataCurve

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 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, and bond.

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).

    Note   The market quote represents the following for each instrument:

    • deposit: rate

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

    • swap: rate

    • bond: dirty price

Compounding

(Optional) Compounding value for an IRDataCurve object:

  • -1

  • 1

  • 2 (default)

  • 3

  • 4

  • 6

  • 12

Basis

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

  • 0 = actual/actual (default)

  • 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 (ISMA)

  • 9 = actual/360 (ISMA)

  • 10 = actual/365 (ISMA)

  • 11 = 30/360E (ISMA)

  • 12 = actual/365 (ISDA)

  • 13 = BUS/252

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.

Instrument Parameters

For each of the supported InstrumentTypes, you can specify the following additional instrument parameters as parameter/value pairs by prepending the word Instrument to the parameter field. For example, prepending InstrumentBasis distinguishes an instrument's Basis value from the curve's Basis value.

CouponRate

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

Period

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

Basis

(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 (PSA)

  • 5 = 30/360 (ISDA)

  • 6 = 30/360 (European)

  • 7 = actual/365 (Japanese)

  • 8 = actual/actual (ISMA)

  • 9 = actual/360 (ISMA)

  • 10 = actual/365 (ISMA)

  • 11 = 30/360E (ISMA)

  • 12 = actual/365 (ISDA)

  • 13 = BUS/252

EndMonthRule

(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.

IssueDate

(Optional) Date when an instrument was issued.

FirstCouponDate

(Optional) Date when an instrument makes its first coupon payment. When FirstCouponDate and LastCouponDate are both specified, FirstCouponDate takes precedence in determining the coupon payment structure.

LastCouponDate

(Optional) Last coupon date of an instrument before the maturity date. In the absence of a specified FirstCouponDate, a specified LastCouponDate determines the coupon structure of the instrument. The coupon structure of an instrument is truncated at the LastCouponDate regardless of where it falls and will be followed only by the instrument's maturity cash flow date.

Face

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

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, and IRBootstrapOptionsObj as parameter/value pairs.

Examples

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')

bootModel = 

	IRDataCurve

			 Type: Forward
		   Settle: 733264 (10-Aug-2007)
	  Compounding: 2
			Basis: 0 (actual/actual)
	 InterpMethod: pchip
			Dates: [12x1 double]
			 Data: [12x1 double]

To create the plot for the bootstrapped market data:

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

For an example of bootstrapping using instrument parameters support for prepending the word Instrument to the parameter field, see Using IRDataCurve bootstrap Method for Bootstrapping Based on Market Instruments.

See Also

@IRDataCurve, @IRBootstrapOptions

  


Free Interactive Computational Finance CD

View demos and recorded presentations led by industry experts.

Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS