Main Content

BlackKarasinski

Create BlackKarasinski model object for a Cap, FloorSwaption, Swap, FloatBond, FixedBond, FixedBondOption, FloatBondOption, OptionEmbeddedFixedBond, or OptionEmbeddedFloatBond instrument

Description

Create and price a Cap, Floor, Swaption, Swap, FloatBond, FixedBond, FixedBondOption, FloatBondOption, OptionEmbeddedFixedBond, or OptionEmbeddedFloatBond instrument object with a BlackKarasinski model using this workflow:

  1. Use fininstrument to create a Cap, Floor, Swaption, Swap, FloatBond, FixedBond, FixedBondOption, FloatBondOption, OptionEmbeddedFixedBond, or OptionEmbeddedFloatBond instrument object.

  2. Use finmodel to specify a BlackKarasinski model object for the Cap, Floor, Swaption, Swap, FixedBond, FloatBond, FixedBondOption, FloatBondOption, OptionEmbeddedFixedBond, or OptionEmbeddedFloatBond instrument.

  3. Use finpricer to specify a IRTree pricing method for the Cap, Floor, Swaption, SwapFixedBond, FloatBond, FixedBondOption or OptionEmbeddedFixedBond 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 pricing methods for a Cap, FloorSwaption, Swap, FixedBond, FloatBond, FixedBondOption, FloatBondOption, OptionEmbeddedFixedBond, or OptionEmbeddedFloatBond instrument, see Choose Instruments, Models, and Pricers.

Creation

Description

example

BlackKarasinskiModelObj = finmodel(ModelType,'Alpha',alpha_value,'Sigma',sigma_value) creates a BlackKarasinski model object by specifying ModelType and the required name-value pair arguments Alpha and Sigma to set properties using required name-value pair arguments. For example, BlackKarasinskiModelObj = finmodel("BlackKarasinski",'Alpha',0.052,'Sigma',0.34) creates a BlackKarasinski model object.

Input Arguments

expand all

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

Data Types: char | string

BlackKarasinski 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: BlackKarasinskiModelObj = finmodel("BlackKarasinski",'Alpha',0.052,'Sigma',0.34)

Mean reversion speed, specified as the comma-separated pair consisting of 'Alpha' and a scalar numeric value or timetable.

Alpha accepts a timetable, where the first column is dates and the second column is the associated Alpha value.

Data Types: double | timetable

Volatility, specified as the comma-separated pair consisting of 'Sigma' and a scalar numeric value or timetable.

Sigma accepts a timetable, where the first column is dates and the second column is the associated Sigma value.

Data Types: double | timetable

Properties

expand all

Mean reversion speed, returned as a scalar numeric value or timetable.

Data Types: double | timetable

Volatility, returned as a scalar numeric value or timetable.

Data Types: double | timetable

Examples

collapse all

This example shows the workflow to price a FixedBondOption instrument when you use a BlackKarasinski model and an IRTree pricing method.

Create FixedBond Instrument Object

Use fininstrument to create a FixedBond instrument object as the underlying bond.

BondInst = fininstrument("FixedBond",'Maturity',datetime(2029,9,15),'CouponRate',.024,'Principal',100,'Basis',1,'Period',1,'Name',"fixed_bond")
BondInst = 
  FixedBond with properties:

                  CouponRate: 0.0240
                      Period: 1
                       Basis: 1
                EndMonthRule: 1
                   Principal: 100
    DaycountAdjustedCashFlow: 0
       BusinessDayConvention: "actual"
                    Holidays: NaT
                   IssueDate: NaT
             FirstCouponDate: NaT
              LastCouponDate: NaT
                   StartDate: NaT
                    Maturity: 15-Sep-2029
                        Name: "fixed_bond"

Create FixedBondOption Instrument Object

Use fininstrument to create a FixedBondOption instrument object.

FixedBOption = fininstrument("FixedBondOption",'ExerciseDate',datetime(2025,9,15),'Strike',800,'Bond',BondInst,'OptionType',"put",'ExerciseStyle',"american",'Name',"fixed_bond_option")
FixedBOption = 
  FixedBondOption with properties:

       OptionType: "put"
    ExerciseStyle: "american"
     ExerciseDate: 15-Sep-2025
           Strike: 800
             Bond: [1x1 fininstrument.FixedBond]
             Name: "fixed_bond_option"

Create ratecurve Object

Create a ratecurve object using ratecurve.

Settle = datetime(2019,9,15);
Type = 'zero';
ZeroTimes = [calyears([1:10])]';
ZeroRates = [0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307 0.0310]';
ZeroDates = Settle + ZeroTimes;
 
myRC = ratecurve('zero',Settle,ZeroDates,ZeroRates, 'Basis',5)
myRC = 
  ratecurve with properties:

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

Create BlackKarasinski Model Object

Use finmodel to create a BlackKarasinski model object.

BlackKarasinskiModel = finmodel("BlackKarasinski",'Alpha',0.02,'Sigma',0.34)
BlackKarasinskiModel = 
  BlackKarasinski with properties:

    Alpha: 0.0200
    Sigma: 0.3400

Create IRTree Pricer Object

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

BKTreePricer = finpricer("IRTree",'Model',BlackKarasinskiModel,'DiscountCurve',myRC,'TreeDates',ZeroDates)
BKTreePricer = 
  HWBKTree with properties:

             Tree: [1x1 struct]
        TreeDates: [10x1 datetime]
            Model: [1x1 finmodel.BlackKarasinski]
    DiscountCurve: [1x1 ratecurve]

BKTreePricer.Tree
ans = struct with fields:
     FinObj: 'BKFwdTree'
       tObs: [0 1 2 3 4 5 6 7 8 9]
       dObs: [1x10 datetime]
     CFlowT: {1x10 cell}
      Probs: {1x9 cell}
    Connect: {1x9 cell}
    FwdTree: {1x10 cell}

Price FixedBondOption Instrument

Use price to compute the price and sensitivities for the FixedBondOption instrument.

[Price, outPR] = price(BKTreePricer,FixedBOption,["all"])
Price = 705.2729
outPR = 
  priceresult with properties:

       Results: [1x4 table]
    PricerData: [1x1 struct]

outPR.Results
ans=1×4 table
    Price        Vega         Gamma     Delta 
    ______    ___________    _______    ______

    705.27    -1.1369e-09    -8084.8    844.75

Introduced in R2020a