Main Content


Create CDSBlack pricer object for CDSOption instrument using CDSBlack model


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

  1. Use fininstrument to create the CDSOption instrument object.

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

  3. Use finpricer to specify the CDSBlack pricer object for the CDSOption instrument.

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 instruments, models, and pricing methods for a CDSOption instrument, see Choose Instruments, Models, and Pricers.




CDSBlackPricerObj = finpricer(PricerType,'DiscountCurve',ratecurve_obj,'Model',model,'DefaultProbabilityCurve',defaultprobabilitycurve_obj) creates a CDSBlack pricer object by specifying PricerType and the required name-value pair arguments for DiscountCurve, Model, and DefaultProbabilityCurve to set properties using name-value pairs. For example, CDSBlackPricerObj = finpricer("Analytic",'Model',CDSBlack,'DiscountCurve',ratecurve_obj,'DefaultProbabilityCurve',defaultprobabilitycurve_obj) creates a CDSBlack pricer object.

Input Arguments

expand all

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

Data Types: char | string

CDSBlack Name-Value Pair Arguments

Specify required 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: CDSBlackPricerObj = finpricer("Analytic",'Model',CDSBlack,'DiscountCurve',ratecurve_obj,'DefaultProbabilityCurve',defaultprobabilitycurve_obj)
Required CDSBlack Name-Value Pair Arguments

expand all

ratecurve object for discounting cash flows, specified as the comma-separated pair consisting of 'DiscountCurve' and the name of the previously created ratecurve object.

Data Types: object

Model object, specified as the comma-separated pair consisting of 'Model' and the name of a previously created CDSBlack model object using finmodel.

Data Types: object

Default probability curve, specified as the comma-separated pair consisting of 'DefaultProbabilityCurve' and a name of a previously created defprobcurve.

Data Types: object


expand all

ratecurve object for discounting cash flows, returned as the ratecurve object.

Data Types: object

Model, returned as a CDSBlack model object.

Data Types: object

Default probability curve, returned as a defprobcurve object.

Data Types: object

Object Functions

priceCompute price for interest-rate, equity, or credit derivative instrument with Analytic pricer


collapse all

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

Create ratecurve Object

Create a ratecurve object using ratecurve.

Settle = datetime(2017,9,20);
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)
ZeroCurve = 
  ratecurve with properties:

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

Create defprobcurve Object

Create a defprobcurve object using defprobcurve.

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)
DefaultProbCurve = 
  defprobcurve with properties:

                  Settle: 20-Sep-2017
                   Basis: 2
                   Dates: [10x1 datetime]
    DefaultProbabilities: [10x1 double]

Create CDS Instrument Object

Use fininstrument to create an underlying CDS instrument object.

ContractSpreadBP = 0; % Contractual spread is determined on ExerciseDate
CDS = fininstrument("CDS",'Maturity',datetime(2027,9,20),'ContractSpread',ContractSpreadBP)
CDS = 
  CDS with properties:

           ContractSpread: 0
                 Maturity: 20-Sep-2027
                   Period: 4
                    Basis: 2
             RecoveryRate: 0.4000
    BusinessDayConvention: "actual"
                 Holidays: NaT
        PayAccruedPremium: 1
                 Notional: 10000000
                     Name: ""

Create CDSOption Instrument Object

Use fininstrument to create a CDSOption instrument object.

ExerciseDate = datetime(2017, 12, 20);
Strike = 50;
CDSOption = fininstrument("CDSOption",'Strike',Strike,'ExerciseDate',ExerciseDate,'OptionType',"put",'CDS',CDS)
CDSOption = 
  CDSOption with properties:

      OptionType: "put"
          Strike: 50
        Knockout: 0
    ExerciseDate: 20-Dec-2017
             CDS: [1x1 fininstrument.CDS]
            Name: ""

Create CDSBlack Model Object

Use finmodel to create a CDSBlack model object.

SpreadVolatility = 0.3;
CDSOptionModel = finmodel("CDSBlack",'SpreadVolatility',SpreadVolatility)
CDSOptionModel = 
  CDSBlack with properties:

    SpreadVolatility: 0.3000

Create CDSBlack Pricer Object

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

CDSOptionpricer = finpricer("analytic",'Model',CDSOptionModel,'DiscountCurve',ZeroCurve,'DefaultProbabilityCurve',DefaultProbCurve)
CDSOptionpricer = 
  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.

outPrice = price(CDSOptionpricer,CDSOption)
outPrice = 6.5054
Introduced in R2020a