FloatBondOption
Description
Create and price a FloatBondOption
instrument object for
one or more Float Bond Option instruments using this workflow:
Use
fininstrument
to create anFloatBondOption
instrument object for one or more Float Bond Option instruments.Use
finmodel
to specify aHullWhite
,BlackKarasinski
,BlackDermanToy
,BraceGatarekMusiela
,SABRBraceGatarekMusiela
,CoxIngersollRoss
, orLinearGaussian2F
model for theFloatBondOption
instrument object.Choose a pricing method.
When using a
HullWhite
,BlackKarasinski
,CoxIngersollRoss
, orBlackDermanToy
model, usefinpricer
to specify anIRTree
pricing method for one or moreFloatBondOption
instruments.When using a
HullWhite
,BlackKarasinski
,BraceGatarekMusiela
,SABRBraceGatarekMusiela
, orLinearGaussian2F
model, usefinpricer
to specify anIRMonteCarlo
pricing method for one or moreFloatBondOption
instruments.
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
FloatBondOption
instrument, see Choose Instruments, Models, and Pricers.
Creation
Syntax
Description
creates a FloatBondOptionObj
= fininstrument(InstrumentType
,'Strike
',strike_value,'ExerciseDate
',exercise_date,'Bond
',bond_obj)FloatBond
object for one or more Float Bond
Option instruments by specifying InstrumentType
and
sets properties
using the required name-value pair arguments Strike
,
ExerciseDate
, and Bond
.
sets optional properties
using additional name-value pair arguments in addition to the required
arguments in the previous syntax. For example, FloatBondOptionObj
= fininstrument(___,Name,Value
)FloatBondOptionObj =
fininstrument("FloatBondOption",'Strike',100,'ExerciseDate',datetime(2019,1,30),'Bond',bond_obj,'OptionType','put','ExerciseStyle',"american",'Name',"float_bond_option")
creates a FloatBondOption
instrument with a strike of 100
and an American exercise. You can specify multiple name-value pair
arguments.
Input Arguments
InstrumentType
— Instrument type
string with value "FloatBondOption"
| string array with values of
"FloatBondOption"
| character vector with value
'FloatBondOption'
| cell array of character vectors with values of
'FloatBondOption'
Instrument type, specified as a string with the value of
"FloatBondOption"
, a character vector with the
value of 'FloatBondOption'
, an
NINST
-by-1
string array with
values of "FloatBondOption"
, or an
NINST
-by-1
cell array of
character vectors with values of 'FloatBondOption'
.
Data Types: char
| cell
| string
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: FloatBondOptionObj =
fininstrument("FloatBondOption",'Strike',100,'ExerciseDate',datetime(2019,1,30),'Bond',bond_obj,'OptionType','put','ExerciseStyle',"american",'Name',"float_bond_option")
FloatBondOption
Name-Value Pair
ArgumentsStrike
— Option strike value
nonnegative value | vector of nonnegative values
Option strike value, specified as the comma-separated pair
consisting of 'Strike'
and a scalar nonnegative
value or an NINST
-by-1
vector
of nonnegative values.
Data Types: double
ExerciseDate
— Option exercise dates
datetime array | string array | date character vector
Option exercise date, specified as the comma-separated pair
consisting of 'ExerciseDate'
and a scalar or an
NINST
-by-1
vector using a
datetime array, string array, or date character vectors.
To support existing code, FloatBondOption
also
accepts serial date numbers as inputs, but they are not recommended.
For a European option, there is only one
ExerciseDate
on the option expiry date.For a Bermudan option, there is a
1
-by-NSTRIKES
vector of exercise dates.For an American option, the option can be exercised between
ValuationDate
of the stock tree and the single listedExerciseDate
.
If you use date character vectors or strings, the format must be
recognizable by datetime
because
the Maturity
property is stored as a
datetime.
Bond
— Underlying float bond
FloatBond
object | vector of FloatBond
objects
Underlying float bond, specified as the comma-separated pair
consisting of 'Bond'
and the name of a FloatBond
object or an
NINST
-by-1
vector of
FloatBond
objects.
Data Types: object
FloatBondOption
Name-Value Pair
ArgumentsOptionType
— Definition of option
"call"
(default) | string with value "call"
or
"put"
| string array with values of "call"
or
"put"
| character vector with value 'call'
or
'put'
| cell array of character vectors with values of
'call'
or 'put'
Definition of option, specified as the comma-separated pair
consisting of 'OptionType'
and a scalar character
vector or a string or an
NINST
-by-1
cell array of
character vectors or string array using 'call'
or
'put'
.
With a call option, the issuer has the right to redeem the note before its maturity date. This allows the issuer to refinance the debt at a lower rate if market conditions become favorable.
With a put option, the investor has the right to sell the note back to the issuer before its maturity date. This provides the investor with the flexibility to exit the investment if interest rates rise or market conditions change unfavorably.
Data Types: char
| cell
| string
ExerciseStyle
— Option type
"European"
(default) | string with value "European"
,
"American"
, or
"Bermudan"
| string array with values of "European"
,
"American"
, or
"Bermudan"
| character vector with value 'European'
,
'American'
, or
'Bermudan'
| cell array of character vectors with values of
'European'
, 'American'
, or
'Bermudan'
Option type, specified as the comma-separated pair consisting of
'ExerciseStyle'
and a scalar character vector
or string or an NINST
-by-1
cell array of character vectors or string array.
Data Types: string
| cell
| char
Name
— User-defined name for instrument
" "
(default) | string | string array | character vector | cell array of character vectors
User-defined name for one of more instruments, 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
InstrumentType
— Instrument type
string with value "FloatBondOption"
| string array with values of "FloatBondOption"
Instrument type, returned as a scalar string or an
NINST
-by-1
string array.
Data Types: string
Strike
— Option strike value
nonnegative value | nonnegative value
Option strike value, returned as a scalar nonnegative value or an
NINST
-by-1
vector of nonnegative
values.
Data Types: double
ExerciseDate
— Option exercise date
datetime | vector of datetimes
Option exercise date, returned as a scalar datetime or an
NINST
-by-1
vector of
datetimes.
Data Types: datetime
OptionType
— Definition of option
"call"
(default) | string with value "call"
or
"put"
| string array with values of "call"
or
"put"
Definition of option, returned as a scalar string or an
NINST
-by-1
string array.
Data Types: string
ExerciseStyle
— Option type
"European"
(default) | string with value "European"
,
"American"
, or "Bermudan"
| string array with values of "European"
,
"American"
, or "Bermudan"
Option type, returned as a scalar string or an
NINST
-by-1
string array.
Data Types: string
Bond
— Underlying float bond
FloatBond
object | vector of FloatBond
objects
Underlying float bond, returned as a scalar FloatBond
object or an NINST
-by-1
vector of
FloatBond
objects.
Data Types: object
Name
— User-defined name for instrument
" "
(default) | string | string array
User-defined name for the instrument, returned as a scalar string or an
NINST
-by-1
string array.
Data Types: string
Object Functions
setExercisePolicy | Set exercise policy for FixedBondOption ,
FloatBondOption , or Vanilla instrument |
Examples
Price a FloatBondOption
Instrument Using HullWhite
Model and IRTree
Pricer
This example shows the workflow to price a FloatBondOption
instrument when you use a HullWhite
model and an IRTree
pricing method.
Create FloatBond
Instrument Object
Use fininstrument
to create a FloatBond
instrument object as the underlying bond.
BondInst = fininstrument("FloatBond",'Maturity',datetime(2030,9,15),'Spread',0.021,'Name',"bond_instrument")
BondInst = FloatBond with properties: Spread: 0.0210 ProjectionCurve: [0x0 ratecurve] ResetOffset: 0 Reset: 2 Basis: 0 EndMonthRule: 1 Principal: 100 DaycountAdjustedCashFlow: 0 BusinessDayConvention: "actual" LatestFloatingRate: NaN Holidays: NaT IssueDate: NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate: NaT Maturity: 15-Sep-2030 Name: "bond_instrument"
Create FloatBondOption
Instrument Objects
Use fininstrument
to create three callable FloatBondOption
instrument objects with European, American, and Bermudan exercise.
FloatBOptionEuro = fininstrument("FloatBondOption",'ExerciseDate',datetime(2029,9,15),'Strike',98,'Bond',BondInst,'OptionType',"call",'ExerciseStyle',"european",'Name',"float_bond_option_european")
FloatBOptionEuro = FloatBondOption with properties: OptionType: "call" ExerciseStyle: "european" ExerciseDate: 15-Sep-2029 Strike: 98 Bond: [1x1 fininstrument.FloatBond] Name: "float_bond_option_european"
FloatBOptionAmerican = fininstrument("FloatBondOption",'ExerciseDate',datetime(2029,9,15),'Strike',98,'Bond',BondInst,'OptionType',"call",'ExerciseStyle',"american",'Name',"float_bond_option_american")
FloatBOptionAmerican = FloatBondOption with properties: OptionType: "call" ExerciseStyle: "american" ExerciseDate: 15-Sep-2029 Strike: 98 Bond: [1x1 fininstrument.FloatBond] Name: "float_bond_option_american"
FloatBOptionBermudan = fininstrument("FloatBondOption",'ExerciseDate',[datetime(2025,9,15) , datetime(2029,09,15)],'Strike',[98,100],'Bond',BondInst,'OptionType',"call",'ExerciseStyle',"bermudan",'Name',"float_bond_option_bermudan")
FloatBOptionBermudan = FloatBondOption with properties: OptionType: "call" ExerciseStyle: "bermudan" ExerciseDate: [15-Sep-2025 15-Sep-2029] Strike: [98 100] Bond: [1x1 fininstrument.FloatBond] Name: "float_bond_option_bermudan"
Create ratecurve
Object
Create a ratecurve
object using ratecurve
.
Settle = datetime(2024,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)
myRC = ratecurve with properties: Type: "zero" Compounding: -1 Basis: 0 Dates: [10x1 datetime] Rates: [10x1 double] Settle: 15-Sep-2024 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous"
Create a HullWhite
Model Object
Use finmodel
to create a HullWhite
model object.
HullWhiteModel = finmodel("HullWhite",'Alpha',0.01,'Sigma',0.05)
HullWhiteModel = HullWhite with properties: Alpha: 0.0100 Sigma: 0.0500
Create IRTree
Pricer Object
Use finpricer
to create an IRTree
pricer object and use the ratecurve
object with the 'DiscountCurve'
name-value pair argument.
CFdates = cfdates(Settle, BondInst.Maturity, BondInst.Reset, BondInst.Basis); HWTreePricer = finpricer("IRTree",'Model',HullWhiteModel,'DiscountCurve',myRC,'TreeDates',CFdates')
HWTreePricer = HWBKTree with properties: Tree: [1x1 struct] TreeDates: [12x1 datetime] Model: [1x1 finmodel.HullWhite] DiscountCurve: [1x1 ratecurve]
HWTreePricer.Tree
ans = struct with fields:
tObs: [0 0.4959 1 1.4959 2 2.4959 3 3.4986 4.0027 4.4986 5.0027 5.4986]
dObs: [15-Sep-2024 15-Mar-2025 15-Sep-2025 15-Mar-2026 15-Sep-2026 15-Mar-2027 15-Sep-2027 15-Mar-2028 15-Sep-2028 15-Mar-2029 15-Sep-2029 15-Mar-2030]
CFlowT: {[12x1 double] [11x1 double] [10x1 double] [9x1 double] [8x1 double] [7x1 double] [6x1 double] [5x1 double] [4x1 double] [3x1 double] [2x1 double] [6.0027]}
Probs: {[3x1 double] [3x3 double] [3x5 double] [3x7 double] [3x9 double] [3x11 double] [3x13 double] [3x15 double] [3x17 double] [3x19 double] [3x21 double]}
Connect: {1x11 cell}
FwdTree: {1x12 cell}
RateTree: {1x12 cell}
Price FixedBondOption
Instruments
Use price
to compute the price and sensitivities for the two FixedBondOption
instruments.
[Price, outPR] = price(HWTreePricer,FloatBOptionEuro,["all"])
Price = 3.8040
outPR = priceresult with properties: Results: [1x4 table] PricerData: [1x1 struct]
outPR.Results
ans=1×4 table
Price Delta Gamma Vega
_____ _______ ______ ___________
3.804 -20.465 110.75 -2.6645e-11
[Price, outPR] = price(HWTreePricer,FloatBOptionAmerican,["all"])
Price = 14.1700
outPR = priceresult with properties: Results: [1x4 table] PricerData: [1x1 struct]
outPR.Results
ans=1×4 table
Price Delta Gamma Vega
_____ _______ ______ ____
14.17 -38.981 160.87 0
[Price, outPR] = price(HWTreePricer,FloatBOptionBermudan,["all"])
Price = 12.0676
outPR = priceresult with properties: Results: [1x4 table] PricerData: [1x1 struct]
outPR.Results
ans=1×4 table
Price Delta Gamma Vega
______ _______ ______ ___________
12.068 -39.402 161.55 -2.8422e-10
Price Multiple FloatBondOption
Instruments Using HullWhite
Model and IRTree
Pricer
This example shows the workflow to price multiple FloatBondOption
instruments when you use a HullWhite
model and an IRTree
pricing method.
Create FloatBond
Instrument Object
Use fininstrument
to create a FloatBond
instrument object as the underlying bond.
BondInst = fininstrument("FloatBond",'Maturity',datetime(2030,9,15),'Spread',0.021,'Name',"bond_instrument")
BondInst = FloatBond with properties: Spread: 0.0210 ProjectionCurve: [0x0 ratecurve] ResetOffset: 0 Reset: 2 Basis: 0 EndMonthRule: 1 Principal: 100 DaycountAdjustedCashFlow: 0 BusinessDayConvention: "actual" LatestFloatingRate: NaN Holidays: NaT IssueDate: NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate: NaT Maturity: 15-Sep-2030 Name: "bond_instrument"
Create FloatBondOption
Instrument Objects
Use fininstrument
to create a FloatBondOption
instrument object with European exercise for three Float Bond Option instruments.
FloatBOptionEuro = fininstrument("FloatBondOption",'ExerciseDate',datetime([2030,9,15 ; 2029,09,15 ; 2028,09,15]),'Strike',[98 ; 99 ; 100],'Bond',BondInst,'OptionType',"call",'ExerciseStyle',"european",'Name',"float_bond_option_european")
FloatBOptionEuro=3×1 FloatBondOption array with properties:
OptionType
ExerciseStyle
ExerciseDate
Strike
Bond
Name
Create ratecurve
Object
Create a ratecurve
object using ratecurve
.
Settle = datetime(2024,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)
myRC = ratecurve with properties: Type: "zero" Compounding: -1 Basis: 0 Dates: [10x1 datetime] Rates: [10x1 double] Settle: 15-Sep-2024 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous"
Create a HullWhite
Model Object
Use finmodel
to create a HullWhite
model object.
HullWhiteModel = finmodel("HullWhite",'Alpha',0.01,'Sigma',0.05)
HullWhiteModel = HullWhite with properties: Alpha: 0.0100 Sigma: 0.0500
Create IRTree
Pricer Object
Use finpricer
to create an IRTree
pricer object and use the ratecurve
object with the 'DiscountCurve'
name-value pair argument.
CFdates = cfdates(Settle, BondInst.Maturity, BondInst.Reset, BondInst.Basis); HWTreePricer = finpricer("IRTree",'Model',HullWhiteModel,'DiscountCurve',myRC,'TreeDates',CFdates')
HWTreePricer = HWBKTree with properties: Tree: [1x1 struct] TreeDates: [12x1 datetime] Model: [1x1 finmodel.HullWhite] DiscountCurve: [1x1 ratecurve]
HWTreePricer.Tree
ans = struct with fields:
tObs: [0 0.4959 1 1.4959 2 2.4959 3 3.4986 4.0027 4.4986 5.0027 5.4986]
dObs: [15-Sep-2024 15-Mar-2025 15-Sep-2025 15-Mar-2026 15-Sep-2026 15-Mar-2027 15-Sep-2027 15-Mar-2028 15-Sep-2028 15-Mar-2029 15-Sep-2029 15-Mar-2030]
CFlowT: {[12x1 double] [11x1 double] [10x1 double] [9x1 double] [8x1 double] [7x1 double] [6x1 double] [5x1 double] [4x1 double] [3x1 double] [2x1 double] [6.0027]}
Probs: {[3x1 double] [3x3 double] [3x5 double] [3x7 double] [3x9 double] [3x11 double] [3x13 double] [3x15 double] [3x17 double] [3x19 double] [3x21 double]}
Connect: {1x11 cell}
FwdTree: {1x12 cell}
RateTree: {1x12 cell}
Price FixedBondOption
Instruments
Use price
to compute the prices and sensitivities for the FixedBondOption
instruments.
[Price, outPR] = price(HWTreePricer,FloatBOptionEuro,["all"])
Price = 3×1
1.8081
2.8617
3.9097
outPR=3×1 priceresult array with properties:
Results
PricerData
outPR.Results
ans=1×4 table
Price Delta Gamma Vega
______ _______ ______ __________
1.8081 -10.854 65.153 4.4409e-12
ans=1×4 table
Price Delta Gamma Vega
______ _______ ______ ___________
2.8617 -15.751 87.167 -1.7764e-11
ans=1×4 table
Price Delta Gamma Vega
______ _______ ______ ___________
3.9097 -20.493 108.64 -7.1054e-11
Price FloatBondOption
Instrument Using HullWhite
Model and IRMonteCarlo
Pricer
This example shows the workflow to price a FloatdBondOption
instrument when using a HullWhite
model and an IRMonteCarlo
pricing method.
Create FloatBond
Instrument Object
Use fininstrument
to create a FloatBond
instrument object as the underlying bond.
BondInst = fininstrument("FloatBond",'Maturity',datetime(2030,9,15),'Spread',0.021,'Name',"bond_instrument")
BondInst = FloatBond with properties: Spread: 0.0210 ProjectionCurve: [0x0 ratecurve] ResetOffset: 0 Reset: 2 Basis: 0 EndMonthRule: 1 Principal: 100 DaycountAdjustedCashFlow: 0 BusinessDayConvention: "actual" LatestFloatingRate: NaN Holidays: NaT IssueDate: NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate: NaT Maturity: 15-Sep-2030 Name: "bond_instrument"
Create FloatBondOption
Instrument Object
Use fininstrument
to create a FloatBondOption
instrument object.
FloatBOptionEuro = fininstrument("FloatBondOption",'ExerciseDate',datetime(2020,3,15),'Strike',98,'Bond',BondInst,'OptionType',"call",'ExerciseStyle',"european",'Name',"float_bond_option_european")
FloatBOptionEuro = FloatBondOption with properties: OptionType: "call" ExerciseStyle: "european" ExerciseDate: 15-Mar-2020 Strike: 98 Bond: [1x1 fininstrument.FloatBond] Name: "float_bond_option_european"
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 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 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 FloatBondOption
Instrument
Use price
to compute the price and sensitivities for the FloatBondOption
instrument.
[Price,outPR] = price(outPricer,FloatBOptionEuro,["all"])
Price = 18.2369
outPR = priceresult with properties: Results: [1x4 table] PricerData: [1x1 struct]
outPR.Results
ans=1×4 table
Price Delta Gamma Vega
______ _______ _____ _______
18.237 -104.22 788.7 -13.949
Price FloatBondOption
Instrument Using CoxIngersollRoss
Model and IRTree
Pricer
This example shows the workflow to price a FloatBondOption
instrument when you use a CoxIngersollRoss
model and an IRTree
pricing method.
Create FloatBond
Instrument Object
Use fininstrument
to first create a FloatBond
instrument object.
Maturity = datetime(2027,1,1); Spread = 0.0020; Reset = 1; FloatBond = fininstrument("FloatBond",Maturity=Maturity,Spread=Spread,Reset=Reset,Name="FloatBond_inst")
FloatBond = FloatBond with properties: Spread: 0.0020 ProjectionCurve: [0x0 ratecurve] ResetOffset: 0 Reset: 1 Basis: 0 EndMonthRule: 1 Principal: 100 DaycountAdjustedCashFlow: 0 BusinessDayConvention: "actual" LatestFloatingRate: NaN Holidays: NaT IssueDate: NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate: NaT Maturity: 01-Jan-2027 Name: "FloatBond_inst"
Create FloatBondOption
Instrument Object
Then use fininstrument
to create a FloatBondOption
instrument object.
Strike = 95; OptionType = 'call'; ExerciseDate = datetime(2025,1,1); FloatBOption = fininstrument("FloatBondOption",ExerciseDate=ExerciseDate,Strike=Strike,Bond=FloatBond,OptionType=OptionType,Name="FloatBondOption_inst")
FloatBOption = FloatBondOption with properties: OptionType: "call" ExerciseStyle: "european" ExerciseDate: 01-Jan-2025 Strike: 95 Bond: [1x1 fininstrument.FloatBond] Name: "FloatBondOption_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 FloatBonOption
Instrument
Use price
to compute the price for the FloatBondOption
instrument.
[Price,outPR] = price(CIRPricer,FloatBOption,"all")
Price = 4.9313
outPR = priceresult with properties: Results: [1x4 table] PricerData: [1x1 struct]
outPR.Results
ans=1×4 table
Price Delta Gamma Vega
______ ______ ______ __________
4.9313 -10.36 22.537 1.7764e-10
More About
Floating-Rate Note Option
A floating-rate note option gives the option holder the right to sell the option back to the issuer (put) or to redeem an option (call) at a specific price and on a specific date.
Financial Instruments Toolbox™ supports three types of put and call options on bonds:
American option — An option that you exercise any time until its expiration date
European option — An option that you exercise only on its expiration date
Bermuda option — A Bermuda option resembles a hybrid of American and European options; you can only exercise it on predetermined dates, usually monthly
For more information, see Bond Options.
Tips
After creating a FloatBondOption
instrument object, you can use
setExercisePolicy
to
change the size of the options. For example, consider the following
instrument:
FloatBOption = fininstrument("FloatBondOption",'ExerciseDate',datetime(2029,9,15),'Strike',98,'Bond',BondInst,'OptionType',"call",'ExerciseStyle',"European")
FloatBondOption
instrument object by changing
the ExerciseStyle
from "European"
to
"American"
, use setExercisePolicy
:FloatBOption = setExercisePolicy(FloatBOption,[datetime(2021,1,1) datetime(2022,1,1)],100,'American')
Version History
Introduced in R2020aR2023b: Support for Pricing FloatBondOption
Instruments Using CoxIngersollRoss
Model and IRTree
Pricer
You can price FloatBondOption
instruments using a CoxIngersollRoss
model object
and an IRTree
pricing
method.
R2022b: Serial date numbers not recommended
Although FloatBondOption
supports serial date numbers,
datetime
values are recommended instead. The
datetime
data type provides flexible date and time
formats, storage out to nanosecond precision, and properties to account for time
zones and daylight saving time.
To convert serial date numbers or text to datetime
values, use the datetime
function. For example:
t = datetime(738427.656845093,"ConvertFrom","datenum"); y = year(t)
y = 2021
There are no plans to remove support for serial date number inputs.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)