主要内容

IRTree

创建IRTree的price对象地板上交换掉期期权FloatBondFixedBondFixedBondOptionFloatBondOptionOptionEmbeddedFixedBond,或OptionEmbeddedFloatBond仪器

描述

创建并定价地板上交换掉期期权FloatBondFixedBondFixedBondOptionFloatBondOptionOptionEmbeddedFixedBond,或OptionEmbeddedFloatBond具有HullWhiteBlackKarasinski模型和IRTree使用此工作流的定价方法:

  1. 使用fininstrument要创建地板上掉期期权交换FloatBondFixedBondFixedBondOptionFloatBondOptionOptionEmbeddedFixedBond,或OptionEmbeddedFloatBond仪对象。

  2. 使用finmodel要指定HullWhiteBlackKarasinski,或BlackDermanToy的模型地板上掉期期权交换FixedBondFloatBondFixedBondOptionFloatBondOptionOptionEmbeddedFixedBond,或OptionEmbeddedFloatBond仪对象。

  3. 使用finpricer要指定IRTree对象的BK、BDT或HW三叉树模型的地板上掉期期权交换FixedBondFloatBondFixedBondOptionFloatBondOptionOptionEmbeddedFixedBond,或OptionEmbeddedFloatBond仪对象。

有关此工作流的详细信息,请参见开始使用基于对象的金融工具定价框架的工作流程

有关a的可用工具、模型和定价方法的更多信息地板上掉期期权交换FixedBondFloatBondFloatBondOptionOptionEmbeddedFixedBond,或OptionEmbeddedFloatBond仪器,看选择仪器,模型和价格

创建

描述

例子

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

输入参数

全部展开

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

数据类型:字符|字符串

名称-值参数

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

在R2021a之前,使用逗号分隔每个名称和值,并将其括起来的名字在报价。

例子:IRTreePricerObj = finpricer("IRTree",'Model',HullWhite,'DiscountCurve',ratecure_obj,'TreeDates',['jan-30-2018';'jan-30-2019'])

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

请注意

当你使用HullWhite模型中,IRTreepricer使用HW2000算法[1]

数据类型:对象

此属性是只读的。

ratecurve对象,用于创建IRTree和贴现现金流,由逗号分隔的对组成“DiscountCurve”还有a的名字ratecurve对象。

数据类型:对象

标记树的现金流日期的日期,指定为逗号分隔的对,由“TreeDates”和一个NLEVELS——- - - - - -1日期向量。这些日期的现金流将落在树节点上。的TreeDates参数确定树的层数或深度。按递增顺序列出日期。

数据类型:|细胞|datetime

属性

全部展开

HW或BK三叉树,作为具有以下属性的结构返回:

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

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

  • 聚合氯化铝的单元格数组3.——- - - - - -N除最后一层外,树中每个节点的向上、中间、向下概率的数字数组。单元格数组中的单元格是从根节点开始排序的。数组是3.——- - - - - -N第一行对应向上移动,中间一行对应中间移动,依此类推。数组的每一列表示从给定级别的顶部节点开始的一个节点。

  • CFlowT是一个单元格数组,其元素与树的级别一样多。每个单元格数组元素都包含时间因子()对应于它所在树的级别和它前面的级别。

  • 聚合氯化铝包含概率数组。单元格数组的每个元素都包含该级别每个节点的向上、中间和向下转换概率。

  • 连接包含一个单元格数组,其中包含树中每个节点的连接信息。安排类似于聚合氯化铝,除了每个单元格中只有一行。该数字表示中间分支所连接到的下一层的节点。上面的分支连接到上面的值(- 1),下面的分支连接到下面的值(+ 1)。

  • FwdTree包含从一个节点到下一个节点的转发即期汇率。远期即期汇率定义为贴现率的倒数。

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

数据类型:结构体

树日期,作为标量日期时间或日期时间数组返回。

数据类型:datetime

模型类型,作为对象返回。

数据类型:对象

此属性是只读的。

ratecurve对象,用于创建IRTree对象和折现现金流,返回为ratecurve对象。

数据类型:对象

对象的功能

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

例子

全部折叠

这个例子展示了为一个对象定价的工作流FixedBondOption仪器当你使用HullWhite模型和IRTree定价方法。

创建FixedBond仪对象

使用fininstrument要创建FixedBond仪器对象作为基础债券。

金融工具(“FixedBond”“成熟”datetime(2029、9、15),“CouponRate”, 0.025,“时间”, 1“名字”“fixed_bond_instrument”
BondInst = FixedBond与属性:CouponRate: 0.0250周期:1基础:0结束月规则:1本金:100 daycountadjuststedcashflow: 0 BusinessDayConvention:“实际”假期:NaT发放日期:NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate: NaT到期日期:15 sep -2029名称:“fixed_bond_instrument”

创建FixedBondOption仪对象

使用fininstrument要创建FixedBondOption仪对象。

FixedBOption = fininstrument(“FixedBondOption”“ExerciseDate”datetime(2025、9、15),“罢工”, 98,“债券”BondInst,“名字”“fixed_bond_option_instrument”
FixedBOption = FixedBondOption与属性:OptionType: "call"锻练风格:"european"锻练日期:15-Sep-2025罢工:98债券:[1x1 fininstrument。名称:"fixed_bond_option_instrument"

创建ratecurve对象

创建一个ratecurve对象使用ratecurve

Settle = 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 = Settle + ZeroTimes;比率曲线(“零”、结算、ZeroDates ZeroRates)
myRC =带有属性的利率曲线:类型:“零”复合:-1基础:0日期:[10x1 datetime]利率:[10x1 double]结算:15-Sep-2019 InterpMethod:“线性”ShortExtrapMethod:“下一个”LongExtrapMethod:“上一个”

创建HullWhite模型对象

使用finmodel要创建HullWhite模型对象。

HullWhiteModel = finmodel(“HullWhite”“α”, 0.01,“σ”, 0.05)
HullWhiteModel = HullWhite属性:阿尔法:0.0100西格玛:0.0500

创建IRTree定价的人对象

使用finpricer要创建IRTreeprice对象和使用ratecurve对象的“DiscountCurve”名称-值对参数。

hwtreeprice = finpricer(“irtree”“模型”HullWhiteModel,“DiscountCurve”myRC,“TreeDates”ZeroDates)
HWTreePricer = HWBKTree with properties: Tree: [1x1 struct] TreeDates: [10x1 datetime] Model: [1x1 finmodel。折扣曲线:[1x1率曲线]
HWTreePricer。树
ans =带字段的结构:tObs: [0 1 1.9973 2.9945 3.9918 4.9918 5.9891 6.9863 7.9836 8.9836] dObs: [15-Sep-2019 15-Sep-2020 15-Sep-2021…CFlowT: {1x10 cell}探针:{1x9 cell}连接:{1x9 cell} FwdTree: {1x10 cell} RateTree: {1x10 cell}

价格FixedBondOption仪器

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

[Price, outPR] = Price (hwtreeprice,FixedBOption,[“所有”])
价格= 11.1739
outPR = priceresult with properties:结果:[1x4表]PricerData: [1x1 struct]
outPR。结果
ans =1×4表价格三角洲伽马织女星  ______ _______ ______ ______ 11.174 -272.19 3667.6 243.09

这个例子展示了为一个对象定价的工作流FixedBondOption仪器当你使用BlackKarasinski模型和IRTree定价方法。

创建FixedBond仪对象

使用fininstrument要创建FixedBond仪器对象作为基础债券。

金融工具(“FixedBond”“成熟”datetime(2029、9、15),“CouponRate”, 0.025,“时间”, 1“名字”“fixed_bond_instrument”
BondInst = FixedBond与属性:CouponRate: 0.0250周期:1基础:0结束月规则:1本金:100 daycountadjuststedcashflow: 0 BusinessDayConvention:“实际”假期:NaT发放日期:NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate: NaT到期日期:15 sep -2029名称:“fixed_bond_instrument”

创建FixedBondOption仪对象

使用fininstrument要创建FixedBondOption仪对象。

FixedBOption = fininstrument(“FixedBondOption”“ExerciseDate”datetime(2025、9、15),“罢工”, 100,“债券”BondInst,“名字”“fixed_bond_option”
FixedBOption = FixedBondOption与属性:OptionType: "call"锻练风格:"european"锻练日期:15-Sep-2025罢工:100债券:[1x1 fininstrument。名称:"fixed_bond_option"

创建ratecurve对象

创建一个ratecurve对象使用ratecurve

Settle = 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 = Settle + ZeroTimes;比率曲线(“零”、结算、ZeroDates ZeroRates)
myRC =带有属性的利率曲线:类型:“零”复合:-1基础:0日期:[10x1 datetime]利率:[10x1 double]结算:15-Sep-2019 InterpMethod:“线性”ShortExtrapMethod:“下一个”LongExtrapMethod:“上一个”

创建BlackKarasinski模型对象

使用finmodel要创建BlackKarasinski模型对象。

BlackKarasinskiModel = finmodel(“BlackKarasinski”“α”, 0.02,“σ”, 0.34)
BlackKarasinskiModel = BlackKarasinski属性:阿尔法:0.0200西格玛:0.3400

创建IRTree定价的人对象

使用finpricer要创建IRTreeprice对象和使用ratecurve对象的“DiscountCurve”名称-值对参数。

BKTreePricer = finpricer(“IRTree”“模型”BlackKarasinskiModel,“DiscountCurve”myRC,“TreeDates”ZeroDates)
BKTreePricer = HWBKTree with properties: Tree: [1x1 struct] TreeDates: [10x1 datetime] Model: [1x1 finmodel。折现曲线:[1x1率曲线]
BKTreePricer。树
ans =带字段的结构:tObs: [0 1 1.9973 2.9945 3.9918 4.9918 5.9891 6.9863 7.9836 8.9836] dObs: [15-Sep-2019 15-Sep-2020 15-Sep-2021…CFlowT: {1x10 cell}探针:{1x9 cell}连接:{1x9 cell} FwdTree: {1x10 cell} RateTree: {1x10 cell}

价格FixedBondOption仪器

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

[Price, outPR] = Price (bktreeprice,FixedBOption,[“所有”])
价格= 0.5814
outPR = priceresult with properties:结果:[1x4表]PricerData: [1x1 struct]
outPR。结果
ans =1×4表价格三角洲伽马织女星  _______ _______ ______ _____ 0.58143 -15.842 45.702 2.793

这个例子展示了香草定价的工作流FixedBond仪器当你使用HullWhite模型和IRTree定价方法。

创建FixedBond仪对象

使用fininstrument要创建FixedBond仪对象。

成熟度= datetime(2024,1,1);周期= 1;仪器仪表(“FixedBond”“成熟”成熟,“CouponRate”, 0.025,“时间”期)
VBond =固定债券与属性:券息率:0.0250周期:1基础:0结束月规则:1本金:100 daycountadjuststed现金流:0营业日惯例:“实际”假期:NaT发行日期:NaT第一券息日期:NaT最后券息日期:NaT开始日期:NaT到期日期:01- january -2024名称:""

创建ratecurve对象

创建一个ratecurve对象使用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;复利= 1;零曲线=利率曲线(“零”、结算、ZeroDates ZeroRates,“复合”、复合);

创建HullWhite模型对象

使用finmodel要创建HullWhite模型对象。

VolCurve = 0.01;阿尔法曲线= 0.1;HWModel = finmodel(“HullWhite”“α”AlphaCurve,“σ”, VolCurve);

创建IRTree定价的人对象

使用finpricer要创建IRTreeprice对象和使用ratecurve对象的“DiscountCurve”名称-值对参数。

hwtreeprice = finpricer(“IRTree”“模型”HWModel,“DiscountCurve”ZeroCurve,“TreeDates”ZeroDates)
HWTreePricer = HWBKTree with properties: Tree: [1x1 struct] TreeDates: [10x1 datetime] Model: [1x1 finmodel。折扣曲线:[1x1率曲线]

价格FixedBond仪器

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

[Price, outPR] = Price (hwtreeprice, VBond,[“所有”])
价格= 107.7023
outPR = priceresult with properties:结果:[1x4表]PricerData: [1x1 struct]
outPR。结果
ans =1×4表价格三角洲伽马织女星  _____ _______ ______ ____ 107.7 -602.56 4086.4 0

这个例子展示了香草定价的工作流FloatBond仪器当你使用HullWhite模型和IRTree定价方法。

创建ratecurve对象

创建一个ratecurve对象使用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;复利= 1;零曲线=利率曲线(“零”、结算、ZeroDates ZeroRates,“复合”、复合);

创建FloatBond仪对象

使用fininstrument制作香草FloatBond仪对象。

价差= 0.03;重置= 1;成熟度= datetime(2024,1,1);周期= 1;浮动=仪表(“FloatBond”“成熟”成熟,“传播”传播,“重置”重置,“ProjectionCurve”ZeroCurve)
浮动= FloatBond带属性:价差:0.0300 ProjectionCurve: [1x1 rate ecurve] ResetOffset: 0重置:1 Basis: 0 EndMonthRule: 1 Principal: 100 daycountadjuststedcashflow: 0 BusinessDayConvention: "actual" LatestFloatingRate: NaN Holidays: NaT IssueDate: NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate: NaT Maturity: 01- january -2024 Name: ""

创建HullWhite模型对象

使用finmodel要创建HullWhite模型对象。

VolCurve = 0.01;阿尔法曲线= 0.1;HWModel = finmodel(“HullWhite”“α”AlphaCurve,“σ”, VolCurve);

创建IRTree定价的人对象

使用finpricer要创建IRTreeprice对象和使用ratecurve对象的“DiscountCurve”名称-值对参数。

hwtreeprice = finpricer(“IRTree”“模型”HWModel,“DiscountCurve”ZeroCurve,“TreeDates”ZeroDates)
HWTreePricer = HWBKTree with properties: Tree: [1x1 struct] TreeDates: [10x1 datetime] Model: [1x1 finmodel。折扣曲线:[1x1率曲线]

价格FloatBond仪器

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

[Price, outPR] = Price (hwtreeprice,Float,[“所有”])
价格= 117.4686
outPR = priceresult with properties:结果:[1x4表]PricerData: [1x1 struct]
outPR。结果
ans =1×4表价格三角洲伽马织女星  ______ _______ ______ ____ 117.47 -60.007 315.09 0

这个例子展示了为一个对象定价的工作流FixedBondOption仪器当你使用BlackDermanToy模型和IRTree定价方法。

创建FixedBond仪对象

使用fininstrument要创建FixedBond仪器对象作为基础债券。

金融工具(“FixedBond”成熟= datetime(2029、9、15),CouponRate = .024主要= 100 = 1,= = 1,名字“fixed_bond”
BondInst = FixedBond与属性:CouponRate: 0.0240周期:1基础:1 EndMonthRule: 1本金:100 daycountadjuststedcashflow: 0 BusinessDayConvention:“实际”假期:NaT发行日期:NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate: NaT到期日期:15 sep -2029名称:“fixed_bond”

创建FixedBondOption仪对象

使用fininstrument要创建FixedBondOption仪对象。

FixedBOption = fininstrument(“FixedBondOption”ExerciseDate = datetime(2025、9、15),罢工= 800,债券= BondInst OptionType =“把”ExerciseStyle =“美国”、名称=“fixed_bond_option”
FixedBOption = FixedBondOption与属性:OptionType: "put"锻练风格:"american"锻练日期:15-Sep-2025罢工:800债券:[1x1 fininstrument。名称:"fixed_bond_option"

创建ratecurve对象

创建一个ratecurve对象使用ratecurve

Settle = 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 = Settle + ZeroTimes;比率曲线(“零”、结算、ZeroDates ZeroRates基础= 5)
myRC =带有属性的利率曲线:类型:“零”复合:-1基础:5日期:[10x1 datetime]利率:[10x1 double]结算:15-Sep-2019 InterpMethod:“线性”ShortExtrapMethod:“下一个”LongExtrapMethod:“上一个”

创建BlackDermanToy模型对象

使用finmodel要创建BlackDermanToy模型对象。

BlackDermanToyModel = finmodel(“BlackDermanToy”,σ= 0.14)
BlackDermanToyModel = BlackDermanToy属性:西格玛:0.1400

创建IRTree定价的人对象

使用finpricer要创建IRTreeprice对象和使用ratecurve对象的“DiscountCurve”名称-值对参数。

BKTreePricer = finpricer(“IRTree”模型= BlackDermanToyModel DiscountCurve = myRC TreeDates = ZeroDates)
BKTreePricer = bdtreree属性:树:[1x1 struct] TreeDates: [10x1 datetime]模型:[1x1 finmodel。折扣曲线:[1x1率曲线]
BKTreePricer。树
ans =带字段的结构:tObs: [0 1 2 3 4 5 6 7 8 9] dObs: [15-Sep-2019 15-Sep-2020 15-Sep-2021…] FwdTree: {1x10 cell}

价格FixedBondOption仪器

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

[Price, outPR] = Price (bktreeprice,FixedBOption,“所有”
价格= 705.2729
outPR = priceresult with properties:结果:[1x4表]PricerData: [1x1 struct]
outPR。结果
ans =1×4表价格三角洲伽马织女星  ______ ______ _______ ___________ 705.27 844.75 -8084.8 -2.0464 e-08

参考文献

赫尔,约翰和艾伦·怀特。"通用船体-怀特模型和超校准"金融分析师杂志,第57卷,no。6, 2001年11月,第34-43页。

版本历史

R2020a中引入

全部展开

Baidu
map