FixedBondOption
仪对象
创建和定价FixedBondOption
一个或多个固定债券期权工具的工具对象,使用以下工作流:
使用fininstrument
创建一个FixedBondOption
一个或多个固定债券期权工具的工具对象。
使用finmodel
指定一个HullWhite
,BlackKarasinski
,BraceGatarekMusiela
,SABRBraceGatarekMusiela
,或LinearGaussian2F
模型FixedBondOption
仪对象。
选择一种定价方法。
当使用一个HullWhite
或BlackKarasinski
模型,使用finpricer
指定一个IRTree
一个或多个的定价方法FixedBondOption
仪器。
当使用一个HullWhite
,BraceGatarekMusiela
,SABRBraceGatarekMusiela
,或LinearGaussian2F
模型,使用finpricer
指定一个IRMonteCarlo
一个或多个的定价方法FixedBondOption
仪器。
有关此工作流的更多信息,请参见开始使用基于对象的框架为金融工具定价的工作流.
欲了解更多关于a的可用模型和定价方法的信息FixedBondOption
仪器,看选择仪器、型号和定价.
创建一个FixedBondOptionObj
= fininstrument (InstrumentType
”,罢工
“strike_value,”ExerciseDate
“exercise_date,”债券
”,bond_obj)FixedBondOption
为一个或多个固定债券期权工具指定InstrumentType
并设置属性用于指定的名称-值对参数罢工
,ExerciseDate
,债券
.
的FixedBondOption
工具支持欧洲或美国期权金宝app。有关更多信息,请参见更多关于.
设置可选属性除了前面语法中要求的参数外,还使用了其他的名称-值对。例如,FixedBondOptionObj
= fininstrument (___,名称,值
)FixedBondOptionObj = fininstrument(“FixedBondOption”、“罢工”,100年,“ExerciseDate”,datetime(2019, 30),“债券”,bond_obj,‘OptionType’,‘把’,‘ExerciseStyle’,“美国”、“名称”、“fixed_bond_option”)
创建一个FixedBondOption
一种打击为100的仪器和一种美国演习。可以指定多个名称-值对参数。
InstrumentType
- - - - - -仪器类型“FixedBondOption”
|值为的字符串数组“FixedBondOption”
|带值字符向量“FixedBondOption”
|值为的字符向量单元格数组“FixedBondOption”
仪器类型,指定为值为的字符串“FixedBondOption”
的字符向量“FixedBondOption”
,一个NINST
——- - - - - -1
值为的字符串数组“FixedBondOption”
,或者一个NINST
——- - - - - -1
值为的字符向量单元格数组“FixedBondOption”
.
数据类型:字符
|细胞
|字符串
FixedBondOption
名称-值对的观点
指定必需的和可选的逗号分隔的对名称,值
参数。的名字
参数名和价值
为对应值。的名字
必须出现在引号内。可以以任意顺序指定多个名称和值对参数Name1, Value1,…,的家
.
FixedBondOptionObj = fininstrument(“FixedBondOption”、“罢工”,100年,“ExerciseDate”,datetime(2019, 30),“债券”,bond_obj,‘OptionType’,‘把’,‘ExerciseStyle’,“美国”、“名称”、“fixed_bond_option”)
FixedBondOption
名称-值对的观点
罢工
- - - - - -选择罢工价值选项的strike值,指定为逗号分隔的对,由“罢工”
和一个标量非负的数字或NINST
——- - - - - -1
非负数字向量。
数据类型:双
ExerciseDate
- - - - - -选择锻炼时间选项执行日期,指定为逗号分隔对,由“ExerciseDate”
和标量日期时间、串行日期号、日期字符向量、日期字符串或NINST
——- - - - - -1
日期时间向量、连续日期号、日期字符向量的单元格数组或日期字符串数组。
对于欧洲来说,只有一个选择ExerciseDate
在期权到期日。
对于百慕大的选择,有一个1
——- - - - - -NSTRIKES
运动日期向量。
对于美式期权,期权可以在两者之间行使解决
的ratecurve
单列的ExerciseDate
.
如果使用日期字符向量或日期字符串,则格式必须是可识别的datetime
因为ExerciseDate
属性存储为datetime
.
数据类型:双
|字符
|细胞
|字符串
|datetime
债券
- - - - - -潜在的FixedBond
仪器FixedBond
对象|向量的FixedBond
对象潜在的FixedBond
指定为逗号分隔对的仪器,由“债券”
和一个标量FixedBond
对象或一个NINST
——- - - - - -1
向量的FixedBond
对象。
数据类型:对象
FixedBondOption
名称-值对的观点
OptionType
- - - - - -选择类型“电话”
(默认)|字符串值“电话”
或“把”
|值为的字符串数组“电话”
或“把”
|带值字符向量“电话”
或“把”
|值为的字符向量单元格数组“电话”
或“把”
选项类型,指定为逗号分隔的对,由“OptionType”
标量字符串或字符向量或NINST
——- - - - - -1
字符向量或字符串数组的单元格数组。
数据类型:字符
|细胞
|字符串
ExerciseStyle
- - - - - -选择运动风格“欧洲”
(默认)|字符串值“欧洲”
,“美国”
,或“百慕大”
|值为的字符串数组“欧洲”
,“美国”
,或“百慕大”
|带值字符向量“欧洲”
,“美国”
,或“百慕大”
|值为的字符向量单元格数组“欧洲”
,“美国”
,或“百慕大”
选项练习样式,指定为逗号分隔对组成“ExerciseStyle”
标量字符串或字符向量或NINST
——- - - - - -1
字符向量的单元格数组或值为的字符串数组“欧洲”
,“美国”
,或“百慕大”
.
数据类型:字符串
|细胞
|字符
的名字
- - - - - -用户自定义仪器名称”“
(默认)|字符串|字符串数组|特征向量|字符向量的单元格数组多个仪器中的一个用户定义的名称,指定为逗号分隔对,由“名字”
标量字符串或字符向量或NINST
——- - - - - -1
字符向量或字符串数组的单元格数组。
数据类型:字符
|细胞
|字符串
罢工
- - - - - -选择罢工价值选项的strike值,返回为标量非负数值或NINST
——- - - - - -1
非负值的数值向量。
数据类型:双
ExerciseDate
- - - - - -选择锻炼时间选项执行日期,返回标量日期时间或NINST
——- - - - - -1
向量的日期时间。
数据类型:datetime
OptionType
- - - - - -选择类型“电话”
(默认)|带值标量字符串“电话”
或“把”
|值为的字符串数组“电话”
或“把”
选项类型,作为标量字符串或NINST
——- - - - - -1
值为的字符串数组“电话”
或“把”
.
数据类型:字符串
ExerciseStyle
- - - - - -选择运动风格“欧洲”
(默认)|带值标量字符串“欧洲”
,“美国”
|值为的字符串数组“欧洲”
,“美国”
选项练习样式,返回为标量字符串或NINST
——- - - - - -1
值为的字符串数组“欧洲”
或“美国”
.
数据类型:字符串
债券
- - - - - -潜在的FixedBond
仪器FixedBond
对象|向量的FixedBond
对象潜在的FixedBond
仪器,作为标量返回FixedBond
对象或一个NINST
——- - - - - -1
向量的FixedBond
对象。
数据类型:对象
的名字
- - - - - -用户自定义仪器名称”“
(默认)|标量字符串|字符串数组仪器的用户定义名称,返回为标量字符串或NINST
——- - - - - -1
字符串数组。
数据类型:字符串
setExercisePolicy |
为…制定运动政策FixedBondOption ,FloatBondOption ,或香草 仪器 |
这个例子展示了定价a的工作流程FixedBondOption
当你使用HullWhite
模型和一个IRTree
定价方法。
创建FixedBond
仪对象
使用fininstrument
创建一个FixedBond
作为基础债券的工具对象。
BondInst = fininstrument (“FixedBond”,“成熟”datetime(2029、9、15),“CouponRate”.021,“时间”,1,“名字”,“bond_instrument”)
BondInst = FixedBond with properties: CouponRate: 0.0210 Period: 1 Basis: 0 EndMonthRule: 1 Principal: 100 DaycountAdjustedCashFlow: 0 BusinessDayConvention:“实际”假期:NaT issueddate: NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate: NaT Maturity: 15- september 2029名称:“bond_instrument”
创建FixedBondOption
仪的对象
使用fininstrument
创建三个可调用对象FixedBondOption
与欧洲、美国和百慕大人的运动相抵触。
FixedBOptionEuro = fininstrument (“FixedBondOption”,“ExerciseDate”datetime(2025、9、15),“罢工”, 98,“债券”BondInst,“OptionType”,“电话”,“ExerciseStyle”,“欧洲”,“名字”,“fixed_bond_option_european”)
FixedBOptionEuro = FixedBondOption with properties: OptionType: "call" exercisstyle: "european" exercisdate: 15- september -2025 Strike: 98FixedBond)名称:“fixed_bond_option_european”
FixedBOptionAmerican = fininstrument (“FixedBondOption”,“ExerciseDate”datetime(2025、9、15),“罢工”, 98,“债券”BondInst,“OptionType”,“电话”,“ExerciseStyle”,“美国”,“名字”,“fixed_bond_option_american”)
FixedBOptionAmerican = FixedBondOption with properties: OptionType: "call" exercisstyle: "american" exercisdate: 15-Sep-2025 Strike: 98 Bond: [1x1 fininstrument。FixedBond)名称:“fixed_bond_option_american”
FixedBOptionBermudan = fininstrument (“FixedBondOption”,“ExerciseDate”[datetime(2025、9、15),datetime(2025、11、15)),“罢工”(98、1000),“债券”BondInst,“OptionType”,“电话”,“ExerciseStyle”,“百慕大”,“名字”,“fixed_bond_option_bermudan”)
fixedboptionbermuda = FixedBondOption with properties: OptionType: "call" exercisstyle: "bermuda " exercisdate: [98 1000] Strike: [98 1000] Bond: [1x1 fininstrument.]FixedBond)名称:“fixed_bond_option_bermudan”
创建ratecurve
对象
创建一个ratecurve
对象使用ratecurve
.
解决= datetime(2019、9、15);类型=“零”;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]';zeroates = Settle + ZeroTimes;myRC = ratecurve (“零”、结算、ZeroDates ZeroRates)
myRC = ratecurve with properties: Type: "zero" compound: -1 Basis: 0 date: [10x1 datetime] Rates: [10x1 double] Settle: 15-Sep-2019 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous"
创建一个HullWhite
模型对象
使用finmodel
创建一个HullWhite
模型对象。
HullWhiteModel = finmodel (“HullWhite”,“α”, 0.01,“σ”, 0.05)
HullWhiteModel = HullWhite属性:Alpha: 0.0100 Sigma: 0.0500
创建IRTree
定价的人对象
使用finpricer
创建一个IRTree
对象,并使用ratecurve
对象的“DiscountCurve”
名称-值对的论点。
HWTreePricer = finpricer (“IRTree”,“模型”HullWhiteModel,“DiscountCurve”myRC,“TreeDates”ZeroDates)
HWTreePricer = HWBKTree with properties: Tree: [1x1 struct] TreeDates: [10x1 datetime] Model: [1x1 finmodel. HWTreePricer = HWBKTree折现曲线:[1x1率曲线]
HWTreePricer。树
ans =结构体字段:dObs: [0 1 1.9973 2.9945 3.9918 4.9918 5.9891 6.9863 7.9836 8.9836]CFlowT: {1x10 cell} Probs: {1x9 cell} Connect: {1x9 cell} FwdTree: {1x10 cell} rattree: {1x10 cell}
价格FixedBondOption
仪器
使用价格
来计算两者的价格和敏感性FixedBondOption
仪器。
[Price, outPR] = Price (HWTreePricer,FixedBOptionEuro,[“所有”])
价格= 10.7571
outPR = pricerresult with properties: Results: [1x4 table]
outPR。结果
ans =1×4表价格织女星γδ ______ ______ ______ _______ 10.757 308.87 2207.3 -178.78
[Price, outPR] = Price (HWTreePricer,FixedBOptionAmerican,[“所有”])
价格= 19.2984
outPR = pricerresult with properties: Results: [1x4 table]
outPR。结果
ans =1×4表价格织女星γδ ______ ______ ______ _______ 19.298 437.32 4977.1 -459.06
[Price, outPR] = Price (HWTreePricer, fixedboption百慕大,[“所有”])
价格= 11.1241
outPR = pricerresult with properties: Results: [1x4 table]
outPR。结果
ans =1×4表价格织女星γδ ______ ______ ______ _______ 11.124 322.94 2243.7 -182.44
这个例子展示了定价倍数的工作流程FixedBondOption
当你使用HullWhite
模型和一个IRTree
定价方法。
创建FixedBond
仪对象
使用fininstrument
创建一个FixedBond
作为基础债券的工具对象。
BondInst = fininstrument (“FixedBond”,“成熟”datetime(2029、9、15),“CouponRate”.021,“时间”,1,“名字”,“bond_instrument”)
BondInst = FixedBond with properties: CouponRate: 0.0210 Period: 1 Basis: 0 EndMonthRule: 1 Principal: 100 DaycountAdjustedCashFlow: 0 BusinessDayConvention:“实际”假期:NaT issueddate: NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate: NaT Maturity: 15- september 2029名称:“bond_instrument”
创建FixedBondOption
仪的对象
使用fininstrument
创建一个FixedBondOption
欧洲行使三种固定债券期权工具的工具对象。
FixedBOptionEuro = fininstrument (“FixedBondOption”,“ExerciseDate”datetime([2025、9、15;2025、10、15;2025、11、15]),“罢工”, 98;100;102年),“债券”BondInst,“OptionType”,“电话”,“ExerciseStyle”,“欧洲”,“名字”,“fixed_bond_option_european”)
FixedBOptionEuro =3×1对象3x1 FixedBondOption数组带有属性:OptionType exercisstyle exercisdate Strike Bond名称
创建ratecurve
对象
创建一个ratecurve
对象使用ratecurve
.
解决= datetime(2019、9、15);类型=“零”;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]';zeroates = Settle + ZeroTimes;myRC = ratecurve (“零”、结算、ZeroDates ZeroRates)
myRC = ratecurve with properties: Type: "zero" compound: -1 Basis: 0 date: [10x1 datetime] Rates: [10x1 double] Settle: 15-Sep-2019 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous"
创建一个HullWhite
模型对象
使用finmodel
创建一个HullWhite
模型对象。
HullWhiteModel = finmodel (“HullWhite”,“α”, 0.01,“σ”, 0.05)
HullWhiteModel = HullWhite属性:Alpha: 0.0100 Sigma: 0.0500
创建IRTree
定价的人对象
使用finpricer
创建一个IRTree
对象,并使用ratecurve
对象的“DiscountCurve”
名称-值对的论点。
HWTreePricer = finpricer (“IRTree”,“模型”HullWhiteModel,“DiscountCurve”myRC,“TreeDates”ZeroDates)
HWTreePricer = HWBKTree with properties: Tree: [1x1 struct] TreeDates: [10x1 datetime] Model: [1x1 finmodel. HWTreePricer = HWBKTree折现曲线:[1x1率曲线]
HWTreePricer。树
ans =结构体字段:dObs: [0 1 1.9973 2.9945 3.9918 4.9918 5.9891 6.9863 7.9836 8.9836]CFlowT: {1x10 cell} Probs: {1x9 cell} Connect: {1x9 cell} FwdTree: {1x10 cell} rattree: {1x10 cell}
价格FixedBondOption
仪器
使用价格
来计算价格和敏感度FixedBondOption
仪器。
[Price, outPR] = Price (HWTreePricer,FixedBOptionEuro,[“所有”])
价格=3×110.7571 10.5781 10.0178
outPR =3×1对象3x1带有属性的pricerresult数组
outPR。结果
ans =1×4表价格织女星γδ ______ ______ ______ _______ 10.757 308.87 2207.3 -178.78
ans =1×4表价格织女星γδ ______ ______ ______ ______ 10.578 314.43 2205.2 -177.6
ans =1×4表价格织女星γδ ______ ______ ______ _______ 10.018 305.41 2164.2 -172.53
这个例子展示了定价a的工作流程FixedBondOption
阶梯式仪器FixedBond
当你使用HullWhite
模型和一个IRTree
定价方法。
创建了FixedBond
仪对象
使用fininstrument
创建一个阶梯式FixedBond
作为基础债券的工具对象。
成熟= datetime(2027、1、1);时间= 1;cdate = datetime([2022,1,1;2027年,1,1);箱= [.022;.027];CouponRate =时间表(CDates、箱);SBond = fininstrument (“FixedBond”,“成熟”成熟,“CouponRate”CouponRate,“时间”期,“名字”,“stepped_bond_instrument”)
SBond = FixedBond with properties: CouponRate: [2x1时间表]Period: 1 Basis: 0 EndMonthRule: 1 Principal: 100 DaycountAdjustedCashFlow: 0 BusinessDayConvention: "实际"假期:NaT issueddate: NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate: NaT Maturity: 01-Jan-2027名称:"stepped_bond_instrument"
创建FixedBondOption
仪对象
使用fininstrument
创建一个FixedBondOption
仪器对象与欧洲的运动。
FixedBOption = fininstrument (“FixedBondOption”,“ExerciseDate”datetime (2026, 1, 1),“罢工”, 90,“债券”SBond,“OptionType”,“电话”,“ExerciseStyle”,“欧洲”,“名字”,“fixed_bond_option_european”)
FixedBOption = FixedBondOption with properties: OptionType: "call" exercisstyle: "european" exercisdate: 01-Jan-2026 Strike: 90 Bond: [1x1 fininstrument。FixedBond)名称:“fixed_bond_option_european”
创建ratecurve
对象
创建一个ratecurve
对象使用ratecurve
.
解决= datetime(2018、1、1);ZeroTimes = calyears(1:10)”;ZeroRates = [0.0055 0.0063 0.0071 0.0083 0.0099 0.0131 0.0178 0.0262 0.0343 0.0387]';zeroates = Settle + ZeroTimes;复合= 1;ZeroCurve = ratecurve (“零”、结算、ZeroDates ZeroRates,“复合”、复合);
创建HullWhite
模型对象
使用finmodel
创建一个HullWhite
模型对象。
VolCurve = 0.15;AlphaCurve = 0.03;HWModel = finmodel (“HullWhite”,“α”AlphaCurve,“σ”VolCurve)
HWModel = HullWhite属性:Alpha: 0.0300 Sigma: 0.1500
创建IRTree
定价的人对象
使用finpricer
创建一个IRTree
对象,并使用ratecurve
对象的“DiscountCurve”
名称-值对的论点。
HWTreePricer = finpricer (“IRTree”,“模型”HWModel,“DiscountCurve”ZeroCurve,“TreeDates”ZeroDates)
HWTreePricer = HWBKTree with properties: Tree: [1x1 struct] TreeDates: [10x1 datetime] Model: [1x1 finmodel. HWTreePricer = HWBKTree折现曲线:[1x1率曲线]
HWTreePricer。树
ans =结构体字段:[01 2 3.0027 4.0027 5.0027 6.0027 7.0055 8.0055 9.0055][01- 1- 2018 01- 1- 2019 01- 1- 2020…CFlowT: {1x10 cell} Probs: {1x9 cell} Connect: {1x9 cell} FwdTree: {1x10 cell} rattree: {1x10 cell}
价格FixedBondOption
仪器
使用价格
来计算价格和敏感度FixedBondOption
乐器。
[Price, outPR] = Price (HWTreePricer,FixedBOption,“所有”)
价格= 12.2717
outPR = pricerresult with properties: Results: [1x4 table]
outPR。结果
ans =1×4表价格织女星γδ ______ ______ ______ ______ 12.272 100.91 1438.4 -130.1
这个例子展示了定价a的工作流程FixedBondOption
仪器在使用时HullWhite
模型和一个IRMonteCarlo
定价方法。
创建FixedBond
仪对象
使用fininstrument
创建一个FixedBond
作为基础债券的工具对象。
BondInst = fininstrument (“FixedBond”,“成熟”datetime(2022、9、15),“CouponRate”.021,“时间”,1,“名字”,“bond_instrument”)
BondInst = FixedBond with properties: CouponRate: 0.0210 Period: 1 Basis: 0 EndMonthRule: 1 Principal: 100 DaycountAdjustedCashFlow: 0 BusinessDayConvention:“实际”假期:NaT issueddate: NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate: NaT Maturity: 15- september 2022名称:“bond_instrument”
创建FixedBondOption
仪对象
使用fininstrument
创建一个FixedBondOption
仪对象。
FixedBOptionEuro = fininstrument (“FixedBondOption”,“ExerciseDate”datetime (2020 3 15),“罢工”, 98,“债券”BondInst,“OptionType”,“电话”,“ExerciseStyle”,“欧洲”,“名字”,“fixed_bond_option_european”)
FixedBOptionEuro = FixedBondOption with properties: OptionType: "call" exercisstyle: "european" exercisdate: 15- march -2020 Strike: 98FixedBond)名称:“fixed_bond_option_european”
创建HullWhite
模型对象
使用finmodel
创建一个HullWhite
模型对象。
HullWhiteModel = finmodel (“HullWhite”,“α”, 0.32,“σ”, 0.49)
HullWhiteModel = HullWhite与性质:阿尔法:0.3200西格玛:0.4900
创建ratecurve
对象
创建一个ratecurve
对象使用ratecurve
.
解决= datetime(2019、1、1);类型=“零”;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]';zeroates = Settle + ZeroTimes;myRC = ratecurve (“零”、结算、ZeroDates ZeroRates)
myRC = ratecurve with properties: Type: "zero" compound: -1 Basis: 0 date: [10x1 datetime] Rates: [10x1 double] Settle: 01-Jan-2019 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous"
创建IRMonteCarlo
定价的人对象
使用finpricer
创建一个IRMonteCarlo
对象,并使用ratecurve
对象的“DiscountCurve”
名称-值对的论点。
outPricer = finpricer (“IRMonteCarlo”,“模型”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- 9 -2019 15-Mar-2020…模型:[1x1 finmodel.]HullWhite]
价格FixedBondOption
仪器
使用价格
来计算价格和敏感度FixedBondOption
乐器。
(价格、outPR) =价格(outPricer, FixedBOptionEuro“所有”])
价格= 24.0750
outPR = pricerresult with properties: Results: [1x4 table]
outPR。结果
ans =1×4表价格三角洲伽马织女星 ______ _______ ______ ______ 24.075 -166.42 1456.2 20.329
在创建一个FixedBondOption
仪器对象,可以使用setExercisePolicy
更改选项的大小。例如,如果你有以下仪器:
FixedBOption = fininstrument(“FixedBondOption”、“ExerciseDate”,datetime(2022、9、15),“罢工”,98年,“债券”,BondInst,“OptionType”、“电话”,“ExerciseStyle”,“欧洲”)
FixedBondOption
仪器的大小通过改变ExerciseStyle
从“欧洲”
来“美国”
,使用setExercisePolicy
:FixedBOption = setExercisePolicy(FixedBOption,[datetime(2021,1,1) datetime(2022,1,1)],100,'American')
你点击一个链接对应于这个MATLAB命令:
通过在MATLAB命令窗口中输入命令来运行命令。Web浏览器不支持MATLAB命令。金宝app
你也可以从以下列表中选择一个网站:
选择中国网站(中文或英文)以获得最佳网站性能。其他MathWorks国家站点没有针对您所在位置的访问进行优化。