Main Content


Create CDSBlack model object for CDSOption instrument

Since R2020a


Create and price a CDSOption instrument object with a CDSBlack model using this workflow:

  1. Use fininstrument to create a CDSOption instrument object.

  2. Use finmodel to specify a CDSBlack model object for the CDSOption instrument object.

  3. Use finpricer to specify a CDSBlack pricing method for the CDSOption instrument object.

For more information on this workflow, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.

For more information on the available pricing methods for a CDSOption instrument, see Choose Instruments, Models, and Pricers.




CDSBlackModelObj = finmodel(ModelType,'SpreadVolatility',spreadvolatility_value) creates a CDSBlack model object by specifying ModelType and the required name-value pair argument SpreadVolatility to set the properties using name-value pair arguments. For example, CDSBlackModelObj = finmodel("CDSBlack",'SpreadVolatility',0.052) creates a CDSBlack model object.

Input Arguments

expand all

Model type, specified as a string with the value of "CDSBlack" or a character vector with the value of 'CDSBlack'.

Data Types: char | string

Name-Value Arguments

Specify required pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: CDSBlackModelObj = finmodel("CDSBlack",'SpreadVolatility',0.052)

Spread volatility value, specified as the comma-separated pair consisting of 'SpreadVolatility' and a scalar nonnegative numeric.

Data Types: double


expand all

Spread volatility value, returned as a scalar nonnegative numeric.

Data Types: double


collapse all

This example shows the workflow to price a CDSOption instrument when you use a CDSBlack model and a CDSBlack pricing method.

Create CDS Instrument Object

Use fininstrument to create a CDS instrument object as the underlying instrument.

CDS = fininstrument("CDS",'Maturity',datetime(2021,9,15),'ContractSpread',150,'Notional',100,'Name',"CDS_instrument")
CDS = 
  CDS with properties:

           ContractSpread: 150
                 Maturity: 15-Sep-2021
                   Period: 4
                    Basis: 2
             RecoveryRate: 0.4000
    BusinessDayConvention: "actual"
                 Holidays: NaT
        PayAccruedPremium: 1
                 Notional: 100
                     Name: "CDS_instrument"

Create defprobcurve Object

Create a defprobcurve object using defprobcurve.

Settle = datetime(2020,9,20);
DefProbTimes = [calmonths(6) calyears([1 2 3 4 5 7 10 20 30])];
DefaultProbabilities = [0.005 0.007 0.01 0.015 0.026 0.04 0.077 0.093 0.15 0.20]';
ProbDates = Settle + DefProbTimes;
DefaultProbCurve = defprobcurve(Settle,ProbDates,DefaultProbabilities,'Basis',5)
DefaultProbCurve = 
  defprobcurve with properties:

                  Settle: 20-Sep-2020
                   Basis: 5
                   Dates: [10x1 datetime]
    DefaultProbabilities: [10x1 double]

Create ratecurve Object

Create a ratecurve object using ratecurve.

Settle = datetime(2020,9,15);
Type = 'zero';
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;
myRC = ratecurve('zero',Settle,ZeroDates,ZeroRates)
myRC = 
  ratecurve with properties:

                 Type: "zero"
          Compounding: -1
                Basis: 0
                Dates: [10x1 datetime]
                Rates: [10x1 double]
               Settle: 15-Sep-2020
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create CDSOption Instrument Object

Use fininstrument to create a CDSOption instrument object.

CDSOptionInst = fininstrument("CDSOption",'ExerciseDate',datetime(2021,8,15),'Strike',20,'CDS',CDS,'OptionType',"put",'Name',"CDSOption_option")
CDSOptionInst = 
  CDSOption with properties:

               OptionType: "put"
                   Strike: 20
                 Knockout: 0
    AdjustedForwardSpread: NaN
             ExerciseDate: 15-Aug-2021
                      CDS: [1x1 fininstrument.CDS]
                     Name: "CDSOption_option"

Create CDSBlack Model Object

Use finmodel to create a CDSBlack model object.

CDSBlackModel = finmodel("CDSBlack",'SpreadVolatility',.2)
CDSBlackModel = 
  CDSBlack with properties:

    SpreadVolatility: 0.2000

Create CDSBlack Pricer Object

Use finpricer to create a CDSBlack pricer object and use the ratecurve object for the 'DiscountCurve' name-value pair argument.

outPricer = finpricer("analytic",'Model',CDSBlackModel,'DefaultProbabilityCurve',DefaultProbCurve,'DiscountCurve',myRC)
outPricer = 
  CDSBlack with properties:

                      Model: [1x1 finmodel.CDSBlack]
              DiscountCurve: [1x1 ratecurve]
    DefaultProbabilityCurve: [1x1 defprobcurve]

Price CDSOption Instrument

Use price to compute the price for the CDSOption instrument.

Price = price(outPricer,CDSOptionInst)
Price = 3.3016e-04

More About

expand all

Version History

Introduced in R2020a