Main Content


Bootstrap defprobcurve object from market CDS instruments



OutCurve = defprobstrip(ZeroCurve,MarketInstruments,MarketQuotes) bootstraps a defprobcurve object from market CDS instruments.


OutCurve = defprobstrip(___,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.


collapse all

This example shows how to use defprobstrip to bootstrap a defprobcurve object based on market CDS instruments.

Create ratecurve Object for Zero-Rate Curve

Create a ratecurve object using ratecurve.

Settle = datetime(2017,9,15);
ZeroTimes = [calmonths(6) calyears([1 2 3 4 5 7 10 20 30])];
ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]';
ZeroDates = Settle + ZeroTimes;
ZeroCurve = ratecurve("zero",Settle,ZeroDates,ZeroRates);

Market CDS Spreads and Vector of Market CDS Instruments

Define the market CDS spreads and use fininstrument to create a vector of market CDS instrument objects.

SpreadTimes = [1 2 3 4 5 7 10 20 30]';
Spread = [140 175 210 265 310 360 410 460 490]';
MarketDates = datemnth(Settle,12*SpreadTimes);
NumMarketInst = length(MarketDates);
ContractSpreadBP = zeros(NumMarketInst,1);
MarketCDSInstruments(NumMarketInst,1) = fininstrument("cds", ...
      'ContractSpread', ContractSpreadBP(end), 'Maturity', MarketDates(end));
  for k = 1:NumMarketInst
      MarketCDSInstruments(k,1) = fininstrument("cds", ...
          'ContractSpread', ContractSpreadBP(k), 'Maturity', MarketDates(k));

Use defprobstrip to create a defprobcurve object.

DefaultProbCurve = defprobstrip(ZeroCurve,MarketCDSInstruments, Spread)
DefaultProbCurve = 
  defprobcurve with properties:

                  Settle: 15-Sep-2017
                   Basis: 2
                   Dates: [9x1 datetime]
    DefaultProbabilities: [9x1 double]

Input Arguments

collapse all

Zero-rate curve, specified by a previously created ratecurve.

Data Types: object

Market CDS instruments, specified as an NINST-by-1 vector.

Data Types: double

Market quotes, specified as an NINST-by-1 vector.

Data Types: double

Name-Value 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: DefaultProbCurve = defprobstrip(ZeroCurve, MarketInstruments, MarketQuotes,'QuoteType',"upfront")

Frequency of payments per year, specified as the comma-separated pair consisting of 'QuoteType' and a scalar character vector or string.

  • "fairspread" — CDS break-even spread for zero upfront price

  • "upfront" — CDS upfront price for a given contractual spread

Data Types: char | string

Dates for probability data, specified as the comma-separated pair consisting of 'ProbDates' and a P-by-1 vector of dates for the output defprobcurve object, given as serial date numbers, date character vectors, or datetimes.

Data Types: datetime | double | char

Output Arguments

collapse all

Default probability curve, returned as a defprobcurve object with the following properties:

  • Settle

  • Basis

  • Dates

  • DefaultProbabilities

Introduced in R2020a