Main Content


Create SABR pricer object for Swaption instrument using SABR model

Since R2020a


Create and price a Swaption instrument object with a SABR model and a SABR pricing method using this workflow:

  1. Use fininstrument to create a Swaption instrument object.

  2. Use finmodel to specify a SABR model for the Swaption instrument object.

  3. Use finpricer to specify a SABR pricer object for the Swaption instrument object.


    If you do not specify ProjectionCurve when you create a Swaption instrument with the SABR pricer, the ProjectionCurve value defaults to the DiscountCurve value.

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 Swaption instrument, see Choose Instruments, Models, and Pricers.




SABRPricerObj = finpricer(PricerType,'DiscountCurve',ratecurve_obj,'Model',model) creates a SABR pricer object by specifying PricerType and the required name-value pair argument Model to set properties using name-value pairs. For example, SABRPricerObj = finpricer("Analytic",'DiscountCurve',ratecurve_obj,'Model',SABRModel) creates a SABR pricer object.

Input Arguments

expand all

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

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: SABRPricerObj = finpricer("Analytic",'DiscountCurve',ratecurve_obj,'Model',SABRModel)

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

Data Types: object

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

Data Types: object


expand all

ratecurve object for discounting cash flows, returned as a ratecurve object

Data Types: object

Model, returned as a SABR model object.

Data Types: object

Object Functions

priceCompute price for interest-rate, equity, or credit derivative instrument with Analytic pricer
volatilitiesCompute implied volatilities when using SABR pricer


collapse all

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

Create ratecurve Object

Create a ratecurve object using ratecurve.

Settle = datetime(2018,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-2018
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create Swap Instrument Object

Use fininstrument to create the underlying Swap instrument object.

Swap = fininstrument("Swap",'Maturity',datetime(2023,1,30),'LegRate',[0.018 0.24],'LegType',["fixed","float"],'Basis',1,'Notional',100,'StartDate',datetime(2020,3,30),'ProjectionCurve',myRC,'Name',"swap_instrument")
Swap = 
  Swap with properties:

                     LegRate: [0.0180 0.2400]
                     LegType: ["fixed"    "float"]
                       Reset: [2 2]
                       Basis: [1 1]
                    Notional: 100
          LatestFloatingRate: [NaN NaN]
                 ResetOffset: [0 0]
    DaycountAdjustedCashFlow: [0 0]
             ProjectionCurve: [1x2 ratecurve]
       BusinessDayConvention: ["actual"    "actual"]
                    Holidays: NaT
                EndMonthRule: [1 1]
                   StartDate: 30-Mar-2020
                    Maturity: 30-Jan-2023
                        Name: "swap_instrument"

Create Swaption Instrument Object

Use fininstrument to create a Swaption instrument object.

Swaption = fininstrument("Swaption",'Strike',0.275,'ExerciseDate',datetime(2021,7,30),'Swap',Swap,'OptionType',"put",'ExerciseStyle',"european",'Name',"swaption_instrument")
Swaption = 
  Swaption with properties:

       OptionType: "put"
    ExerciseStyle: "european"
     ExerciseDate: 30-Jul-2021
           Strike: 0.2750
             Swap: [1x1 fininstrument.Swap]
             Name: "swaption_instrument"

Create SABR Model Object

Use finmodel to create a SABR model object.

SABRModel = finmodel("SABR",'Alpha',0.032,'Beta',0.04,'Rho',.08,'Nu',0.49,'Shift',0.002)
SABRModel = 
  SABR with properties:

             Alpha: 0.0320
              Beta: 0.0400
               Rho: 0.0800
                Nu: 0.4900
             Shift: 0.0020
    VolatilityType: "black"

Create SABR Pricer Object

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

outPricer = finpricer("analytic",'Model',SABRModel,'DiscountCurve',myRC)
outPricer = 
  SABR with properties:

    DiscountCurve: [1x1 ratecurve]
            Model: [1x1 finmodel.SABR]

Price Swaption Instrument

Use price to compute the price for the Swaption instrument.

Price = price(outPricer,Swaption)
Price = 10.3771

Version History

Introduced in R2020a