主要内容

IRTree

创建IRTree定价的人对象,地板上,交换,掉期期权,FloatBond,FixedBond,FixedBondOption,FloatBondOption,OptionEmbeddedFixedBond,或OptionEmbeddedFloatBond仪器

描述

创建和价格,地板上,交换,掉期期权,FloatBond,FixedBond,FixedBondOption,FloatBondOption,OptionEmbeddedFixedBond,或OptionEmbeddedFloatBond工具对象HullWhiteBlackKarasinski模型和一个IRTree使用此工作流定价方法:

  1. 使用fininstrument创建一个,地板上,掉期期权,交换,FloatBond,FixedBond,FixedBondOption,FloatBondOption,OptionEmbeddedFixedBond,或OptionEmbeddedFloatBond仪对象。

  2. 使用finmodel指定一个HullWhiteBlackKarasinski模型,地板上,掉期期权,交换,FixedBond,FloatBond,FixedBondOption,FloatBondOption,OptionEmbeddedFixedBond,或OptionEmbeddedFloatBond仪对象。

  3. 使用finpricer指定一个IRTree定价的人对象BK或HW三叉树模型,地板上,掉期期权,交换,FixedBond,FloatBond,FixedBondOption,FloatBondOption,OptionEmbeddedFixedBond,或OptionEmbeddedFloatBond仪对象。

此工作流的更多信息,请参阅开始使用工作流使用基于对象的金融工具定价的框架

在可用的工具的更多信息,模型,和定价方法,地板上,掉期期权,交换,FixedBond,FloatBond,FloatBondOption,OptionEmbeddedFixedBond,或OptionEmbeddedFloatBond仪器,看选择工具、模型和定价的人

创建

描述

例子

IRTreePricerObj= finpricer (PricerType”,模型“model_type,”DiscountCurve“ratecurve_obj,”TreeDates”,tree_dates)创建一个IRTree定价的人通过指定对象PricerType和所需的参数名称-值对模型,DiscountCurve,TreeDates设置属性使用名称-值对参数。例如,IRTreePricerObj = finpricer (“IRTree”、“模型”,HullWhite DiscountCurve, ratecure_obj,“TreeDates”, [1 - 30 - 2018, ' 1 - 30 - 2019 '])创建一个IRTree定价的人对象。

输入参数

全部展开

定价的人类型,指定为一个字符串的值“IRTree”或者一个特征向量的值“IRTree”

数据类型:字符|字符串

名称-值参数

需要对参数指定为Name1 = Value1,…,以=家,在那里的名字参数名称和吗价值相应的价值。名称-值参数必须出现在其他参数,但对的顺序无关紧要。

R2021a之前,用逗号来分隔每一个名称和值,并附上的名字在报价。

例子:IRTreePricerObj = finpricer (“IRTree”、“模型”,HullWhite DiscountCurve, ratecure_obj,“TreeDates”, [1 - 30 - 2018, ' 1 - 30 - 2019 '])

模型类型,指定为逗号分隔组成的“模型”和先前创建的名称HullWhiteBlackKarasinski模型对象。创建模型对象使用finmodel

请注意

当你使用HullWhite模型中,IRTree定价的人使用HW2000算法[1]

数据类型:对象

这个属性是只读的。

ratecurve对象创建IRTree和折现现金流,指定为逗号分隔组成的“DiscountCurve”和的名称ratecurve对象。

数据类型:对象

日期标记树的现金流日期,指定为逗号分隔组成的“TreeDates”和一个NLEVELS——- - - - - -1向量的日期。现金流与这些日期将落在树节点。的TreeDates参数确定的数量水平,或深度,树的。日期在增加订单列表。

数据类型:|细胞|datetime

属性

全部展开

HW或BK三叉树,作为struct返回以下属性:

  • 包含树的每一层的时间因素。

  • 强加于人包含树的每一层的日期。

  • 聚合氯化铝包含的单元阵列3——- - - - - -N数值数组的,中期,概率树的每个节点除了最后的水平。细胞从根节点单元阵列中的命令。数组是3——- - - - - -N与第一行对应于一个向上移动,中期行中设置,等等。数组的每一列代表一个节点从顶部节点给定的水平。

  • CFlowT是一个单元阵列和尽可能多的元素树的水平。每个单元格数组元素包含时间因素()相应的树和那些领先的水平。

  • 聚合氯化铝包含概率数组。细胞数组的每个元素包含起来,中间,和向下跃迁概率为每个节点的水平。

  • 连接包含一个单元阵列与树的每个节点的连接信息。类似的安排聚合氯化铝,除了它在每个单元只有一行。代表了节点数中间分支连接到下一个层次。分支连接到顶部上面的值(- 1)和较低的分支连接到下面的值(+ 1)。

  • FwdTree包含了即期汇率从一个节点到另一个。远期现货汇率定义为折现系数的倒数。

  • RateTree包含利率从一个节点到另一个。

数据类型:结构体

树的日期,作为标量datetime或datetime数组返回。

数据类型:datetime

模型类型,返回一个对象。

数据类型:对象

这个属性是只读的。

ratecurve对象创建IRTree对象和折现现金流,作为一个返回ratecurve对象。

数据类型:对象

对象的功能

价格 计算价格的利率工具IRTree定价的人

例子

全部折叠

这个例子显示了工作流价格FixedBondOption当你使用工具HullWhite模型和一个IRTree定价方法。

创建FixedBond仪对象

使用fininstrument创建一个FixedBond仪对象作为底层的债券。

BondInst = fininstrument (“FixedBond”,“成熟”datetime (2029、9、15),“CouponRate”,0.025,“时间”,1“名字”,“fixed_bond_instrument”)
BondInst = FixedBond属性:CouponRate: 0.0250期:1基础:0 EndMonthRule: 1主要:100 DaycountAdjustedCashFlow: 0 BusinessDayConvention:“实际”假期:NaT IssueDate: NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate可以:NaT成熟度:15 - 9 - 2029的名字:“fixed_bond_instrument”

创建FixedBondOption仪对象

使用fininstrument创建一个FixedBondOption仪对象。

FixedBOption = fininstrument (“FixedBondOption”,“ExerciseDate”datetime (2025、9、15),“罢工”,98,“债券”BondInst,“名字”,“fixed_bond_option_instrument”)
FixedBOption = FixedBondOption属性:OptionType:“叫“ExerciseStyle:“欧洲”ExerciseDate: 15 - 9月- 2025年罢工:98年邦德:[1 x1 fininstrument。FixedBond)名称:“fixed_bond_option_instrument”

创建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) ';ZeroDates = + ZeroTimes定居;myRC = ratecurve (“零”、结算、ZeroDates ZeroRates)
myRC = ratecurve属性:类型:“零”组合:1基础:0日期:x1 datetime[10]利率:x1双[10]解决:15 - 9 - 2019 InterpMethod:“线性”ShortExtrapMethod:“下一个”LongExtrapMethod:“以前”

创建HullWhite模型对象

使用finmodel创建一个HullWhite模型对象。

HullWhiteModel = finmodel (“HullWhite”,“α”,0.01,“σ”,0.05)
HullWhiteModel = HullWhite属性:α:0.0100σ:0.0500

创建IRTree定价的人对象

使用finpricer创建一个IRTree定价的人对象和使用ratecurve对象的“DiscountCurve”名称-值对的论点。

HWTreePricer = finpricer (“irtree”,“模型”HullWhiteModel,“DiscountCurve”myRC,“TreeDates”ZeroDates)
HWTreePricer = HWBKTree属性:树:[1 x1 struct] TreeDates: [10 x1 datetime)模型:[1 x1 finmodel。HullWhite] DiscountCurve: [1 x1 ratecurve]
HWTreePricer.Tree
ans =结构体字段:则:[0 1 1.9973 2.9945 3.9918 4.9918 5.9891 6.9863 7.9836 8.9836]罗伯特:[15 - - - - 2019年9月15日- 2021年9月- 2020年9月15 - -…]CFlowT: {1 x10细胞}聚合氯化铝:}{1 x9细胞连接:{1 x9细胞}FwdTree: {1 x10细胞}RateTree: {1 x10细胞}

价格FixedBondOption仪器

使用价格来计算的价格和敏感性FixedBondOption乐器。

(价格、outPR) =价格(HWTreePricer, FixedBOption“所有”])
价格= 11.1739
outPR = priceresult属性:结果:[1 x4表]PricerData: [1 x1 struct]
outPR.Results
ans =1×4表价格看上去织女星γδ长得一样11.174 243.09 3667.6 -272.19

这个例子显示了工作流价格FixedBondOption当你使用工具BlackKarasinski模型和一个IRTree定价方法。

创建FixedBond仪对象

使用fininstrument创建一个FixedBond仪对象作为底层的债券。

BondInst = fininstrument (“FixedBond”,“成熟”datetime (2029、9、15),“CouponRate”,0.025,“时间”,1“名字”,“fixed_bond_instrument”)
BondInst = FixedBond属性:CouponRate: 0.0250期:1基础:0 EndMonthRule: 1主要:100 DaycountAdjustedCashFlow: 0 BusinessDayConvention:“实际”假期:NaT IssueDate: NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate可以:NaT成熟度:15 - 9 - 2029的名字:“fixed_bond_instrument”

创建FixedBondOption仪对象

使用fininstrument创建一个FixedBondOption仪对象。

FixedBOption = fininstrument (“FixedBondOption”,“ExerciseDate”datetime (2025、9、15),“罢工”,100,“债券”BondInst,“名字”,“fixed_bond_option”)
FixedBOption = FixedBondOption属性:OptionType:“叫“ExerciseStyle:“欧洲”ExerciseDate: 15 - 9月- 2025年罢工:100年邦德:[1 x1 fininstrument。FixedBond)名称:“fixed_bond_option”

创建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) ';ZeroDates = + ZeroTimes定居;myRC = ratecurve (“零”、结算、ZeroDates ZeroRates)
myRC = ratecurve属性:类型:“零”组合:1基础:0日期:x1 datetime[10]利率:x1双[10]解决:15 - 9 - 2019 InterpMethod:“线性”ShortExtrapMethod:“下一个”LongExtrapMethod:“以前”

创建BlackKarasinski模型对象

使用finmodel创建一个BlackKarasinski模型对象。

BlackKarasinskiModel = finmodel (“BlackKarasinski”,“α”,0.02,“σ”,0.34)
BlackKarasinskiModel = BlackKarasinski属性:α:0.0200σ:0.3400

创建IRTree定价的人对象

使用finpricer创建一个IRTree定价的人对象和使用ratecurve对象的“DiscountCurve”名称-值对的论点。

BKTreePricer = finpricer (“IRTree”,“模型”BlackKarasinskiModel,“DiscountCurve”myRC,“TreeDates”ZeroDates)
BKTreePricer = HWBKTree属性:树:[1 x1 struct] TreeDates: [10 x1 datetime)模型:[1 x1 finmodel。BlackKarasinski] DiscountCurve: [1 x1 ratecurve]
BKTreePricer.Tree
ans =结构体字段:则:[0 1 1.9973 2.9945 3.9918 4.9918 5.9891 6.9863 7.9836 8.9836]罗伯特:[15 - - - - 2019年9月15日- 2021年9月- 2020年9月15 - -…]CFlowT: {1 x10细胞}聚合氯化铝:}{1 x9细胞连接:{1 x9细胞}FwdTree: {1 x10细胞}RateTree: {1 x10细胞}

价格FixedBondOption仪器

使用价格来计算的价格和敏感性FixedBondOption乐器。

(价格、outPR) =价格(BKTreePricer, FixedBOption“所有”])
价格= 0.5814
outPR = priceresult属性:结果:[1 x4表]PricerData: [1 x1 struct]
outPR.Results
ans =1×4表价格织女星γδ累积专攻0.58143 2.793 45.702 -15.842

这个例子显示了香草工作流价格FixedBond当你使用工具HullWhite模型和一个IRTree定价方法。

创建FixedBond仪对象

使用fininstrument创建一个FixedBond仪对象。

成熟= datetime (2024、1、1);时间= 1;VBond = fininstrument (“FixedBond”,“成熟”成熟,“CouponRate”,0.025,“时间”期)
VBond = FixedBond属性:CouponRate: 0.0250期:1基础:0 EndMonthRule: 1主要:100 DaycountAdjustedCashFlow: 0 BusinessDayConvention:“实际”假期:NaT IssueDate: NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate可以:NaT成熟度:01 - 1月- 2024的名字:“

创建ratecurve对象

创建一个ratecurve对象使用ratecurve

解决= 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 = + ZeroTimes定居;复合= 1;ZeroCurve = ratecurve (“零”、结算、ZeroDates ZeroRates,“复合”、复合);

创建HullWhite模型对象

使用finmodel创建一个HullWhite模型对象。

VolCurve = 0.01;AlphaCurve = 0.1;HWModel = finmodel (“HullWhite”,“α”AlphaCurve,“σ”,VolCurve);

创建IRTree定价的人对象

使用finpricer创建一个IRTree定价的人对象和使用ratecurve对象的“DiscountCurve”名称-值对的论点。

HWTreePricer = finpricer (“IRTree”,“模型”HWModel,“DiscountCurve”ZeroCurve,“TreeDates”ZeroDates)
HWTreePricer = HWBKTree属性:树:[1 x1 struct] TreeDates: [10 x1 datetime)模型:[1 x1 finmodel。HullWhite] DiscountCurve: [1 x1 ratecurve]

价格FixedBond仪器

使用价格计算价格和香草的敏感性FixedBond乐器。

(价格、outPR) =价格(HWTreePricer, VBond“所有”])
价格= 107.7023
outPR = priceresult属性:结果:[1 x4表]PricerData: [1 x1 struct]
outPR.Results
ans =1×4表价格织女星γδ_____ _____ _____ 107.7 0 4086.4 - -602.56

这个例子显示了香草工作流价格FloatBond当你使用工具HullWhite模型和一个IRTree定价方法。

创建ratecurve对象

创建一个ratecurve对象使用ratecurve

解决= 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 = + ZeroTimes定居;复合= 1;ZeroCurve = ratecurve (“零”、结算、ZeroDates ZeroRates,“复合”、复合);

创建FloatBond仪对象

使用fininstrument创建一个香草FloatBond仪对象。

传播= 0.03;重置= 1;成熟= datetime (2024、1、1);时间= 1;浮动= fininstrument (“FloatBond”,“成熟”成熟,“传播”传播,“重置”重置,“ProjectionCurve”ZeroCurve)
浮动= FloatBond属性:传播:0.0300 ProjectionCurve: [1 x1 ratecurve] ResetOffset: 0重置:1基础:0 EndMonthRule: 1主要:100 DaycountAdjustedCashFlow: 0 BusinessDayConvention:“实际”LatestFloatingRate:南假日:NaT IssueDate: NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate可以:NaT成熟度:01 - 1月- 2024的名字:“

创建HullWhite模型对象

使用finmodel创建一个HullWhite模型对象。

VolCurve = 0.01;AlphaCurve = 0.1;HWModel = finmodel (“HullWhite”,“α”AlphaCurve,“σ”,VolCurve);

创建IRTree定价的人对象

使用finpricer创建一个IRTree定价的人对象和使用ratecurve对象的“DiscountCurve”名称-值对的论点。

HWTreePricer = finpricer (“IRTree”,“模型”HWModel,“DiscountCurve”ZeroCurve,“TreeDates”ZeroDates)
HWTreePricer = HWBKTree属性:树:[1 x1 struct] TreeDates: [10 x1 datetime)模型:[1 x1 finmodel。HullWhite] DiscountCurve: [1 x1 ratecurve]

价格FloatBond仪器

使用价格计算价格和香草的敏感性FloatBond乐器。

价格(价格、outPR) = (HWTreePricer、浮点数、“所有”])
价格= 117.4686
outPR = priceresult属性:结果:[1 x4表]PricerData: [1 x1 struct]
outPR.Results
ans =1×4表价格看上去织女星γδ辩得一样117.47 0 315.09 - -60.007

引用

[1]船体、约翰和艾伦·怀特。“将军Hull-White模型和Supercalibration。”金融分析师期刊卷,57号2001年11月6日,34-43页。

版本历史

介绍了R2020a