Main Content

OptionEmbeddedFloatBond

OptionEmbeddedFloatBond instrument object

Since R2020a

Description

Create and price a OptionEmbeddedFloatBond instrument object for one or more Option Embedded Float Bond instruments using this workflow:

  1. Use fininstrument to create an OptionEmbeddedFloatBond instrument object for one or more Option Embedded Float Bond instruments.

  2. Use finmodel to specify a HullWhite, BlackKarasinski, BlackDermanToy, BraceGatarekMusiela, SABRBraceGatarekMusiela, CoxIngersollRoss, or LinearGaussian2F model for the OptionEmbeddedFloatBond instrument object.

  3. Choose a pricing method.

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

Creation

Description

OptionEmbeddedFloatBondObj = fininstrument(InstrumentType,'Spread',spread_value,'Maturity',maturity_date,'CallSchedule',call_schedule_value) creates a OptionEmbeddedFloatBond object for one or more Option Embedded Float Bond instruments by specifying InstrumentType and the required name-value pair arguments Spread, Maturity, and CallSchedule sets the properties using required name-value pair arguments.

OptionEmbeddedFloatBond supports vanilla bonds with embedded options and amortizing bonds with embedded options.

example

OptionEmbeddedFloatBondObj = fininstrument(InstrumentType,'Spread',spread_value,'Maturity',maturity_date,'PutSchedule',put_schedule_value) creates a OptionEmbeddedFloatBond object for one or more Option Embedded Float Bond instruments by specifying InstrumentType and the required name-value pair arguments Spread, Maturity, and PutSchedule sets the properties using required name-value pair arguments.

example

OptionEmbeddedFloatBondObj = fininstrument(___,Name,Value) sets optional properties using additional name-value pairs in addition to the required arguments in the previous syntax. For example, OptionEmbeddedFloatBondObj = fininstrument("OptionEmbeddedFloatBond",'Spread',0.01,'Maturity',datetime(2019,1,30),'Period',4,'Basis',5,'Principal',1000,'FirstCouponDate',datetime(2016,1,30),'EndMonthRule',1,'CallSchedule',schedule,'CallExerciseStyle',"american",'ProjectionCurve',ratecurve_obj,'Name',"optionembeddedfloatbond"). You can specify multiple name-value pairs.

example

Input Arguments

expand all

Instrument type, specified as a string with the value of "OptionEmbeddedFloatBond", a character vector with the value of 'OptionEmbeddedFloatBond', an NINST-by-1 string array with values of "OptionEmbeddedFloatBond", or an NINST-by-1 cell array of character vectors with values of 'OptionEmbeddedFloatBond'.

Data Types: char | cell | string

Name-Value Arguments

Specify required and optional 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: OptionEmbeddedFloatBondObj = fininstrument("OptionEmbeddedFloatBond",'Spread',0.01,'Maturity',datetime(2019,1,30),'Period',4,'Basis',5,'Principal',1000,'FirstCouponDate',datetime(2016,1,30),'EndMonthRule',1,'CallSchedule',schedule,'CallExerciseStyle',"american",'ProjectionCurve',ratecurve_obj,'Name',"optionembeddedfloatbond")

Required OptionEmbeddedFloatBond Name-Value Pair Arguments

expand all

Number of basis points over the reference rate, specified as the comma-separated pair consisting of 'Spread' and a scalar nonnegative numeric or an NINST-by-1 vector of nonnegative numeric.

Data Types: double

Maturity date, specified as the comma-separated pair consisting of 'Maturity' and a scalar or an NINST-by-1 vector using a datetime array, string array, or date character vectors.

To support existing code, OptionEmbeddedFloatBond also accepts serial date numbers as inputs, but they are not recommended.

Call schedule, specified as the comma-separated pair consisting of 'CallSchedule' and a timetable of call dates and strikes.

If you use a date character vector or date string for the dates in this timetable, the format must be recognizable by datetime because the CallSchedule property is stored as a datetime.

Note

The OptionEmbeddedFloatBond instrument supports either CallSchedule and CallExerciseStyle or PutSchedule and PutExerciseStyle, but not both.

If you are creating one or more OptionEmbeddedFloatBond instruments and use a timetable, the timetable specification applies to all of the OptionEmbeddedFloatBond instruments. CallSchedule does not accept an NINST-by-1 cell array of timetables as input.

Data Types: timetable

Put schedule, specified as the comma-separated pair consisting of 'PutSchedule' and a timetable of call dates and strikes.

If you use a date character vector or date string for dates in this timetable, the format must be recognizable by datetime because the PutSchedule property is stored as a datetime.

Note

The OptionEmbeddedFloatBond instrument supports either CallSchedule and CallExerciseStyle or PutSchedule and PutExerciseStyle, but not both.

If you are creating one or more OptionEmbeddedFloatBond instruments and use a timetable, the timetable specification applies to all of the OptionEmbeddedFloatBond instruments. PutSchedule does not accept an NINST-by-1 cell array of timetables as input.

Data Types: timetable

Optional OptionEmbeddedFloatBond Name-Value Pair Arguments

expand all

Frequency of payments per year, specified as the comma-separated pair consisting of 'Reset' and a scalar integer or an NINST-by-1 vector of integers. Values for Reset are: 1, 2, 3, 4, 6, and 12.

Data Types: double

Call option exercise style, specified as the comma-separated pair consisting of 'CallExerciseStyle' and a scalar string or character vector or an NINST-by-1 cell array of character vectors or string array.

Note

The CallSchedule is a timetable of call dates and strikes. If you do not specify a CallExerciseStyle, then based on the CallSchedule specification, a default value of CallExerciseStyle is assigned as follows:

  • If there is one exercise date in the CallSchedule, then the CallExerciseStyle is an "European".

  • If there are two exercise dates in the CallSchedule, then the CallExerciseStyle is an "American" with a start date and maturity.

  • If there are more than two exercise dates in the CallSchedule, then the CallExerciseStyle is an "Bermudan".

If the you define a CallExerciseStyle and this is not consistent with what you have specified in the CallSchedule, you receive an error message.

Data Types: string | cell | char

Put option exercise style, specified as the comma-separated pair consisting of 'PutExerciseStyle' and a scalar string or character vector or an NINST-by-1 cell array of character vectors or string array.

Note

The PutSchedule is a timetable of call dates and strikes. If you do not specify a PutExerciseStyle, then based on the PutSchedule specification, a default value of PutExerciseStyle is assigned as follows:

  • If there is one exercise date in the PutSchedule, then the PutExerciseStyle is an "European".

  • If there are two exercise dates in the PutSchedule, then the PutExerciseStyle is an "American" with a start date and maturity.

  • If there are more than two exercise dates in the PutSchedule, then the PutExerciseStyle is an "Bermudan".

If the you define a PutExerciseStyle and this is not consistent with what you have specified in the PutSchedule, you receive an error message.

Data Types: string | cell | char

Day count basis, specified as the comma-separated pair consisting of 'Basis' and scalar integer or an NINST-by-1 vector of integers using the following values:

  • 0 — actual/actual

  • 1 — 30/360 (SIA)

  • 2 — actual/360

  • 3 — actual/365

  • 4 — 30/360 (PSA)

  • 5 — 30/360 (ISDA)

  • 6 — 30/360 (European)

  • 7 — actual/365 (Japanese)

  • 8 — actual/actual (ICMA)

  • 9 — actual/360 (ICMA)

  • 10 — actual/365 (ICMA)

  • 11 — 30/360E (ICMA)

  • 12 — actual/365 (ISDA)

  • 13 — BUS/252

For more information, see Basis.

Data Types: double

Notional principal amount or principal value schedule, specified as the comma-separated pair consisting of 'Principal' and a scalar numeric or an NINST-by-1 numeric vector or a timetable.

Principal accepts a timetable, where the first column is dates and the second column is the associated notional principal value. The date indicates the last day that the principal value is valid.

Note

If you are creating one or more OptionEmbeddedFloatBond instruments and use a timetable, the timetable specification applies to all of the OptionEmbeddedFloatBond instruments. Principal does not accept an NINST-by-1 cell array of timetables as input.

Data Types: double | timetable

Flag indicating whether cash flow adjusts for day count convention, specified as the comma-separated pair consisting of 'DaycountAdjustedCashFlow' and a scalar logical or an NINST-by-1 vector of logicals with values of true or false.

Data Types: logical

Business day conventions, specified as the comma-separated pair consisting of 'BusinessDayConvention' and a scalar string or character vector or an NINST-by-1 cell array of character vectors or string array. The selection for business day convention determines how nonbusiness days are treated. Nonbusiness days are defined as weekends plus any other date that businesses are not open (for example, statutory holidays). Values are:

  • "actual" — Nonbusiness days are effectively ignored. Cash flows that fall on non-business days are assumed to be distributed on the actual date.

  • "follow" — Cash flows that fall on a nonbusiness day are assumed to be distributed on the following business day.

  • "modifiedfollow" — Cash flows that fall on a nonbusiness day are assumed to be distributed on the following business day. However if the following business day is in a different month, the previous business day is adopted instead.

  • "previous" — Cash flows that fall on a nonbusiness day are assumed to be distributed on the previous business day.

  • "modifiedprevious" — Cash flows that fall on a nonbusiness day are assumed to be distributed on the previous business day. However if the previous business day is in a different month, the following business day is adopted instead.

Data Types: char | cell | string

Holidays used in computing business days, specified as the comma-separated pair consisting of 'Holidays' and dates using an NINST-by-1 vector of a datetime array, string array, or date character vectors. For example:

H = holidays(datetime('today'),datetime(2025,12,15));
OptionEmbeddedFixedBondObj = fininstrument("OptionEmbeddedFixedBond",'CouponRate',0.34,'Maturity',datetime(2025,12,15),...
'CallSchedule',schedule,'CallExerciseStyle',"american",'Holidays',H)

To support existing code, OptionEmbeddedFloatBond also accepts serial date numbers as inputs, but they are not recommended.

End-of-month rule flag for generating dates when Maturity is an end-of-month date for a month with 30 or fewer days, specified as the comma-separated pair consisting of 'EndMonthRule' and a scalar logical or an NINST-by-1 vector of logicals values of true or false.

  • If you set EndMonthRule to false, the software ignores the rule, meaning that a payment date is always the same numerical day of the month.

  • If you set EndMonthRule to true, the software sets the rule on, meaning that a payment date is always the last actual day of the month.

Data Types: logical

Bond issue date, specified as the comma-separated pair consisting of 'IssueDate' and a scalar or an NINST-by-1 vector using a datetime array, string array, or date character vectors.

To support existing code, OptionEmbeddedFloatBond also accepts serial date numbers as inputs, but they are not recommended.

If you use date character vectors or strings, the format must be recognizable by datetime because the IssueDate property is stored as a datetime.

Irregular first coupon date, specified as the comma-separated pair consisting of 'FirstCouponDate' and a scalar or an NINST-by-1 vector using a datetime array, string array, or date character vectors.

To support existing code, OptionEmbeddedFloatBond also accepts serial date numbers as inputs, but they are not recommended.

When FirstCouponDate and LastCouponDate are both specified, FirstCouponDate takes precedence in determining the coupon payment structure. If you do not specify FirstCouponDate, the cash flow payment dates are determined from other inputs.

If you use date character vectors or strings, the format must be recognizable by datetime because the FirstCouponDate property is stored as a datetime.

Irregular last coupon date, specified as the comma-separated pair consisting of 'LastCouponDate' and a scalar or an NINST-by-1 vector using a datetime array, string array, or date character vectors.

To support existing code, OptionEmbeddedFloatBond also accepts serial date numbers as inputs, but they are not recommended.

If you specify LastCouponDate but not FirstCouponDate, LastCouponDate determines the coupon structure of the bond. The coupon structure of a bond is truncated at LastCouponDate, regardless of where it falls, and is followed only by the bond's maturity cash flow date. If you do not specify LastCouponDate, the cash flow payment dates are determined from other inputs.

If you use date character vectors or strings, the format must be recognizable by datetime because the LastCouponDate property is stored as a datetime.

Forward starting date of payments, specified as the comma-separated pair consisting of 'StartDate' and a scalar or an NINST-by-1 vector using a datetime array, string array, or date character vectors.

To support existing code, OptionEmbeddedFloatBond also accepts serial date numbers as inputs, but they are not recommended.

If you use date character vectors or strings, the format must be recognizable by datetime because the StartDate property is stored as a datetime.

User-defined name for the instrument, specified as the comma-separated pair consisting of 'Name' and a scalar string or character vector or an NINST-by-1 cell array of character vectors or string array.

Data Types: char | cell | string

Properties

expand all

Number of basis points over the reference rate, returned as a scalar nonnegative numeric or an NINST-by-1 vector of nonnegative numeric values.

Data Types: double

Maturity date, returned as a scalar datetime or an NINST-by-1 vector of datetimes.

Data Types: datetime

Call schedule, returned as a timetable.

Data Types: cell | datetime

Put schedule, returned as a timetable.

Data Types: cell | datetime

Frequency of payments per year, returned as a scalar integer or an NINST-by-1 vector of integers.

Data Types: double

Day count basis, returned as a scalar integer or an NINST-by-1 vector of integers.

Data Types: double

Notional principal amount or principal value schedule, returned as a scalar numeric or an NINST-by-1 numeric vector or a timetable.

Data Types: timetable | double

Flag indicating whether cash flow adjusted for day count convention, returned as scalar logical or an NINST-by-1 vector of logicals with values of true or false.

Data Types: logical

Business day conventions, returned as a string or an NINST-by-1 string array.

Data Types: string

Holidays used in computing business days, returned as an NINST-by-1 vector of datetimes.

Data Types: datetime

End-of-month rule flag for generating dates when Maturity is an end-of-month date for a month with 30 or fewer days, returned as a scalar logical or an NINST-by-1 vector of logicals.

Data Types: logical

Bond issue date, returned as a scalar datetime or an NINST-by-1 vector of datetimes.

Data Types: datetime

Irregular first coupon date, returned as a scalar datetime or an NINST-by-1 vector of datetimes.

Data Types: datetime

Irregular last coupon date, returned as a scalar datetime or an NINST-by-1 vector of datetimes.

Data Types: datetime

Forward starting date of payments, returned as a scalar datetime or an NINST-by-1 vector of datetimes.

Data Types: datetime

This property is read-only.

Call option exercise style, returned as a string or an NINST-by-1 string array with values of "European", "American", or "Bermudan".

Data Types: string

This property is read-only.

Put option exercise style, returned as a string or an NINST-by-1 string array with values of "European", "American", or "Bermudan".

Data Types: string

User-defined name for the instrument, returned as a string or an NINST-by-1 string array.

Data Types: string

Object Functions

setCallExercisePolicySet call exercise policy for OptionEmbeddedFixedBond, OptionEmbeddedFloatBond, or ConvertibleBond instrument
setPutExercisePolicySet put exercise policy for OptionEmbeddedFixedBond, OptionEmbeddedFloatBond, or ConvertibleBond instrument

Examples

collapse all

This example shows the workflow to price American, European, and Bermudan exercise styles for three callable OptionEmbeddedFloatBond instruments when you use a HullWhite model and an IRTree pricing method.

Create ratecurve Object

Create a ratecurve object using ratecurve.

Settle = datetime(2018,1,1);
ZeroTimes = calyears(1:10)';
ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]';
ZeroDates = Settle + ZeroTimes;
Compounding = 1;
ZeroCurve = ratecurve("zero",Settle,ZeroDates,ZeroRates, "Compounding",Compounding);

Create OptionEmbeddedFloatBond Instrument Objects

Use fininstrument to create three OptionEmbeddedFloatBond instrument objects with different exercise styles.

Maturity = datetime(2024,1,1);

% Option embedded float bond (Bermudan callable bond)
Strike = [100; 100];
ExerciseDates = [datetime(2020,1,1); datetime(2024,1,1)];
Reset = 1;
CallSchedule =  timetable(ExerciseDates,Strike,'VariableNames',{'Strike Schedule'}); 

CallableBondBermudan = fininstrument("OptionEmbeddedFloatBond",'Maturity',Maturity,...
                              'Spread',0.025,'Reset',Reset, ...
                              'CallSchedule',CallSchedule,'CallExerciseStyle', "bermudan")
CallableBondBermudan = 
  OptionEmbeddedFloatBond with properties:

                      Spread: 0.0250
             ProjectionCurve: [0x0 ratecurve]
                 ResetOffset: 0
                       Reset: 1
                       Basis: 0
                EndMonthRule: 1
                   Principal: 100
    DaycountAdjustedCashFlow: 0
       BusinessDayConvention: "actual"
                    Holidays: NaT
                   IssueDate: NaT
             FirstCouponDate: NaT
              LastCouponDate: NaT
                   StartDate: NaT
                    Maturity: 01-Jan-2024
                   CallDates: [2x1 datetime]
                    PutDates: [0x1 datetime]
                CallSchedule: [2x1 timetable]
                 PutSchedule: [0x0 timetable]
           CallExerciseStyle: "bermudan"
            PutExerciseStyle: [0x0 string]
                        Name: ""

% Option embedded float bond (American callable bond)
Strike = 100;
ExerciseDates = datetime(2024,1,1);
CallSchedule =  timetable(ExerciseDates,Strike,'VariableNames',{'Strike Schedule'}); 
Reset = 1;

CallableBondAmerican = fininstrument("OptionEmbeddedFloatBond",'Maturity',Maturity,...
                              'Spread',0.025,'Reset', Reset, ...
                              'CallSchedule',CallSchedule,'CallExerciseStyle',"american")
CallableBondAmerican = 
  OptionEmbeddedFloatBond with properties:

                      Spread: 0.0250
             ProjectionCurve: [0x0 ratecurve]
                 ResetOffset: 0
                       Reset: 1
                       Basis: 0
                EndMonthRule: 1
                   Principal: 100
    DaycountAdjustedCashFlow: 0
       BusinessDayConvention: "actual"
                    Holidays: NaT
                   IssueDate: NaT
             FirstCouponDate: NaT
              LastCouponDate: NaT
                   StartDate: NaT
                    Maturity: 01-Jan-2024
                   CallDates: 01-Jan-2024
                    PutDates: [0x1 datetime]
                CallSchedule: [1x1 timetable]
                 PutSchedule: [0x0 timetable]
           CallExerciseStyle: "american"
            PutExerciseStyle: [0x0 string]
                        Name: ""

% Option embedded float bond (European callable bond)
Strike = 100;
ExerciseDates = datetime(2024,1,1);
CallSchedule =  timetable(ExerciseDates,Strike,'VariableNames',{'Strike Schedule'}); 
Reset = 1;

CallableBondEuropean = fininstrument("OptionEmbeddedFloatBond",'Maturity',Maturity,...
                              'Spread',0.025,'Reset',Reset, ...
                              'CallSchedule',CallSchedule)                          
CallableBondEuropean = 
  OptionEmbeddedFloatBond with properties:

                      Spread: 0.0250
             ProjectionCurve: [0x0 ratecurve]
                 ResetOffset: 0
                       Reset: 1
                       Basis: 0
                EndMonthRule: 1
                   Principal: 100
    DaycountAdjustedCashFlow: 0
       BusinessDayConvention: "actual"
                    Holidays: NaT
                   IssueDate: NaT
             FirstCouponDate: NaT
              LastCouponDate: NaT
                   StartDate: NaT
                    Maturity: 01-Jan-2024
                   CallDates: 01-Jan-2024
                    PutDates: [0x1 datetime]
                CallSchedule: [1x1 timetable]
                 PutSchedule: [0x0 timetable]
           CallExerciseStyle: "european"
            PutExerciseStyle: [0x0 string]
                        Name: ""

Create HullWhite Model Object

Use finmodel to create a HullWhite model object.

VolCurve = 0.01;
AlphaCurve = 0.1;

HWModel = finmodel("HullWhite",'alpha',AlphaCurve,'sigma',VolCurve);

Create IRTree Pricer Object

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

HWTreePricer = finpricer("IRTree",'Model',HWModel,'DiscountCurve',ZeroCurve,'TreeDates',ZeroDates)
HWTreePricer = 
  HWBKTree with properties:

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

Price OptionEmbeddedFixedBond Instruments

Use price to compute the price and sensitivities for the three OptionEmbeddedFixedBond instruments.

[Price, outPR] = price(HWTreePricer,CallableBondBermudan,["all"])
Price = 
104.9598
outPR = 
  priceresult with properties:

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

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

    104.96    -7.3926    19.597     0  

[Price, outPR] = price(HWTreePricer,CallableBondAmerican,["all"])
Price = 
100
outPR = 
  priceresult with properties:

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

outPR.Results
ans=1×4 table
    Price    Delta    Gamma    Vega
    _____    _____    _____    ____

     100       0        0       0  

[Price, outPR] = price(HWTreePricer,CallableBondEuropean,["all"])
Price = 
114.5571
outPR = 
  priceresult with properties:

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

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

    114.56    -50.006    262.58    -2.8422e-10

This example shows the workflow to price an OptionEmbeddedFloatBond instrument when using a HullWhite model and an IRMonteCarlo pricing method.

Create ratecurve Object

Create a ratecurve object using ratecurve.

Settle = datetime(2019,1,1);
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: 01-Jan-2019
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create OptionEmbeddedFloatBond Instrument Object

Use fininstrument to create an OptionEmbeddedFloatBond instrument object.

% Option embedded float bond (European callable bond)
Maturity = datetime(2022,9,15);
Strike = 100;
ExerciseDates = datetime(2024,1,1);
CallSchedule = timetable(datetime(2020,3,15), 50);
Reset = 1;

CallableBondEuropean = fininstrument("OptionEmbeddedFloatBond",'Maturity',Maturity,...
                              'Spread',0.025,'Reset',Reset, ...
                              'CallSchedule',CallSchedule)    
CallableBondEuropean = 
  OptionEmbeddedFloatBond with properties:

                      Spread: 0.0250
             ProjectionCurve: [0x0 ratecurve]
                 ResetOffset: 0
                       Reset: 1
                       Basis: 0
                EndMonthRule: 1
                   Principal: 100
    DaycountAdjustedCashFlow: 0
       BusinessDayConvention: "actual"
                    Holidays: NaT
                   IssueDate: NaT
             FirstCouponDate: NaT
              LastCouponDate: NaT
                   StartDate: NaT
                    Maturity: 15-Sep-2022
                   CallDates: 15-Mar-2020
                    PutDates: [0x1 datetime]
                CallSchedule: [1x1 timetable]
                 PutSchedule: [0x0 timetable]
           CallExerciseStyle: "european"
            PutExerciseStyle: [0x0 string]
                        Name: ""

Create HullWhite Model Object

Use finmodel to create a HullWhite model object.

HullWhiteModel = finmodel("HullWhite",'Alpha',0.32,'Sigma',0.49)
HullWhiteModel = 
  HullWhite with properties:

    Alpha: 0.3200
    Sigma: 0.4900

Create IRMonteCarlo Pricer Object

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

outPricer = finpricer("IRMonteCarlo",'Model',HullWhiteModel,'DiscountCurve',myRC,'SimulationDates',datetime(2019,3,15)+calmonths(0:6:48)')
outPricer = 
  HWMonteCarlo with properties:

          NumTrials: 1000
      RandomNumbers: []
      DiscountCurve: [1x1 ratecurve]
    SimulationDates: [15-Mar-2019    15-Sep-2019    15-Mar-2020    15-Sep-2020    15-Mar-2021    15-Sep-2021    15-Mar-2022    15-Sep-2022    15-Mar-2023]
              Model: [1x1 finmodel.HullWhite]

Price OptionEmbeddedFloatBond Instrument

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

[Price,outPR] = price(outPricer,CallableBondEuropean,["all"])
Price = 
51.3788
outPR = 
  priceresult with properties:

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

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

    51.379    61.634    -81.051    -7.0508

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

Create OptionEmbeddedFloatBond Instrument Object

Use fininstrument to create a OptionEmbeddedFloatBond instrument object.

Maturity = datetime(2027,1,1); 
Spread = 0.0020;
Reset = 1;
Strike = 95;
ExerciseDates = datetime(2026,1,1);
CallSchedule = timetable(ExerciseDates,Strike,VariableNames={'Strike Schedule'}); 

CallableFloat = fininstrument("OptionEmbeddedFloatBond",Maturity=Maturity,Spread=Spread,Reset=Reset,CallSchedule=CallSchedule,Name="OptionEmbeddedFloatBond_inst")
CallableFloat = 
  OptionEmbeddedFloatBond with properties:

                      Spread: 0.0020
             ProjectionCurve: [0x0 ratecurve]
                 ResetOffset: 0
                       Reset: 1
                       Basis: 0
                EndMonthRule: 1
                   Principal: 100
    DaycountAdjustedCashFlow: 0
       BusinessDayConvention: "actual"
                    Holidays: NaT
                   IssueDate: NaT
             FirstCouponDate: NaT
              LastCouponDate: NaT
                   StartDate: NaT
                    Maturity: 01-Jan-2027
                   CallDates: 01-Jan-2026
                    PutDates: [0x1 datetime]
                CallSchedule: [1x1 timetable]
                 PutSchedule: [0x0 timetable]
           CallExerciseStyle: "european"
            PutExerciseStyle: [0x0 string]
                        Name: "OptionEmbeddedFloatBond_inst"

Create CoxIngersollRoss Model Object

Use finmodel to create a CoxIngersollRoss model object.

alpha = 0.03; 
theta = 0.02; 
sigma = 0.1; 
CIRModel = finmodel("CoxIngersollRoss",Sigma=sigma,Alpha=alpha,Theta=theta)
CIRModel = 
  CoxIngersollRoss with properties:

    Sigma: 0.1000
    Alpha: 0.0300
    Theta: 0.0200

Create ratecurve Object

Create a ratecurve object using ratecurve.

Times= [calyears([1 2 3 4 ])]';
Settle = datetime(2023,1,1);
ZRates = [0.035; 0.042147; 0.047345; 0.052707]';
ZDates = Settle + Times;
Compounding = -1; 
Basis = 1;
ZeroCurve = ratecurve("zero",Settle,ZDates,ZRates,Compounding = Compounding, Basis = Basis);

Create IRTree Pricer Object

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

CIRPricer = finpricer("irtree",Model=CIRModel,DiscountCurve=ZeroCurve,Maturity=ZDates(end),NumPeriods=length(ZDates))
CIRPricer = 
  CIRTree with properties:

             Tree: [1x1 struct]
        TreeDates: [4x1 datetime]
            Model: [1x1 finmodel.CoxIngersollRoss]
    DiscountCurve: [1x1 ratecurve]

Price OptionEmbeddedFloatBond Instrument

Use price to compute the price for the OptionEmbeddedFloatBond instrument.

[Price,outPR] = price(CIRPricer,CallableFloat,"all")
Price = 
96.2125
outPR = 
  priceresult with properties:

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

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

    96.213    11.933    -36.551    2.8422e-10

This example shows the workflow to price multiple OptionEmbeddedFloatBond instruments with Bermudan exercise styles when you use a HullWhite model and an IRTree pricing method.

Create ratecurve Object

Create a ratecurve object using ratecurve.

Settle = datetime(2018,1,1);
ZeroTimes = calyears(1:10)';
ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]';
ZeroDates = Settle + ZeroTimes;
Compounding = 1;
ZeroCurve = ratecurve("zero",Settle,ZeroDates,ZeroRates, "Compounding",Compounding);

Create OptionEmbeddedFloatBond Instrument Objects

Use fininstrument to create an OptionEmbeddedFloatBond instrument object for three Option Embedded Float Bond instruments with a Bermudan exercise style.

Maturity = datetime([2025,1,1 ; 2026,1,1 ; 2027,1,1]);

% Option embedded float bond (Bermudan callable bond) 
Strike = [101 ; 102 ; 103]; 
ExerciseDates = datetime([2022,1,1 ; 2023,1,1 ; 2024,1,1]); 
CallSchedule =  timetable(ExerciseDates,Strike,'VariableNames',{'Strike Schedule'}); 
Reset = 1;

CallableBondBermudan = fininstrument("OptionEmbeddedFloatBond",'Maturity',Maturity,...
                              'Spread',[0.001; 0.0015; 0.002],'Reset', Reset, ...
                              'CallSchedule',CallSchedule,'CallExerciseStyle',"bermudan")    
CallableBondBermudan=3×1 OptionEmbeddedFloatBond array with properties:
    Spread
    ProjectionCurve
    ResetOffset
    Reset
    Basis
    EndMonthRule
    Principal
    DaycountAdjustedCashFlow
    BusinessDayConvention
    Holidays
    IssueDate
    FirstCouponDate
    LastCouponDate
    StartDate
    Maturity
    CallDates
    PutDates
    CallSchedule
    PutSchedule
    CallExerciseStyle
    PutExerciseStyle
    Name

When you create multiple OptionEmbeddedFloatBond instruments and use a timetable for CallSchedule, the timetable specification applies to all of the OptionEmbeddedFloatBond instruments. The CallSchedule input argument does not accept an NINST-by-1 cell array of timetables as input.

              

Create HullWhite Model Object

Use finmodel to create a HullWhite model object.

VolCurve = 0.01;
AlphaCurve = 0.1;

HWModel = finmodel("HullWhite",'alpha',AlphaCurve,'sigma',VolCurve);

Create IRTree Pricer Object

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

HWTreePricer = finpricer("IRTree",'Model',HWModel,'DiscountCurve',ZeroCurve,'TreeDates',ZeroDates)
HWTreePricer = 
  HWBKTree with properties:

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

Price OptionEmbeddedFixedBond Instruments

Use price to compute the prices and sensitivities for the three OptionEmbeddedFixedBond instruments.

[Price, outPR] = price(HWTreePricer,CallableBondBermudan,"all")
Price = 3×1

  100.6713
  101.1327
  101.6643

outPR=3×1 priceresult array with properties:
    Results
    PricerData

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

    100.67    -2.6133    15.33    -4.2633e-10

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

    101.13    -4.9053    31.676    -5.6843e-10

ans=1×4 table
    Price      Delta     Gamma       Vega   
    ______    _______    ______    _________

    101.66    -7.8748    55.171    -0.066246

More About

expand all

Tips

After creating an OptionEmbeddedFixedBond object, you can modify the CallSchedule and CallExerciseStyle using setCallExercisePolicy. Or, you can modify the PutSchedule and PutExerciseStyle values using setPutExercisePolicy.

Version History

Introduced in R2020a

expand all