BermudanSwaption(RQuantLib)
BermudanSwaption()所属R语言包:RQuantLib
Bermudan swaption valuation using several short-rate models
百慕达掉期期权估值使用数个短期利率模型
译者:生物统计家园网 机器人LoveR
描述----------Description----------
BermudanSwaption prices a Bermudan swaption with specified strike and maturity (in years), after calibrating the selected short-rate model to an input swaption volatility matrix. Swaption maturities are in years down the rows, and swap tenors are in years along the columns, in the usual fashion. It is assumed that the Bermudan swaption is exercisable on each reset date of the underlying swaps.
BermudanSwaption价格的百慕达指定的罢工和到期日(年),校准后选定的短期利率模型的输入掉期期权波动率阵的掉期期权。利率掉期期权到期日行的几年下来,掉期期限是几年随着列,以通常的方式。据推测,百慕达的基础上每次重设日期掉期掉期期权的行权。
用法----------Usage----------
BermudanSwaption(params, tsQuotes, swaptionMaturities, swapTenors,
volMatrix)
参数----------Arguments----------
参数:params
A list specifying the tradeDate (month/day/year), settlementDate, payFixed flag, strike, pricing method, and curve construction options (see Examples section below). Curve construction options are interpWhat (possible values are discount, forward, and zero) and interpHow (possible values are linear, loglinear , and spline). Both interpWhat and interpHow are ignored when a flat yield curve is requested, but they must be present nevertheless. The pricing method can be one of the following (all short-rate models): <table summary="Rd table"> <tr> <td align="left"> G2Analytic </td><td align="left"> G2 2-factor Gaussian model using analytic formulas.</td> </tr> <tr> <td align="left"> HWAnalytic </td><td align="left"> Hull-White model using analytic formulas.</td> </tr> <tr> <td align="left"> HWTree </td><td align="left"> Hull-White model using a tree.</td> </tr> <tr> <td align="left"> BKTree </td><td align="left"> Black-Karasinski model using a tree. </td> </tr> </table>
列表指定tradeDate(月/日/年),settlementDate,payFixed标志,strike,定价method,曲线施工方案(见例一节)。曲线施工方案是interpWhat(可能的值是discount,forward和zero)interpHow(可能的值是linear,loglinear和spline)。这两个interpWhat和interpHow,要求时,会忽略一个平坦的收益曲线,但它们必须存在,但。定价方法可以是以下(所有短期利率模型):<table summary="Rd table"> <TR> <td ALIGN="LEFT"> G2Analytic</ TD> <TD对齐= “左”> G2的双因素高斯模型解析公式。</ TD> </ TR> <TR> <td ALIGN="LEFT">HWAnalytic </ TD> <TD ALIGN="LEFT"> Hull-White模型,用解析公式。</ TD> </ TR> <TR> <td ALIGN="LEFT">HWTree </ TD> <TD ALIGN="LEFT"> Hull-White模型使用树。</ TD> </ TR> <TR> <td ALIGN="LEFT"> BKTree </ TD> <TD ALIGN="LEFT">黑卡拉辛斯基模型使用树。 </ TD> </ TR> </ TABLE>
参数:tsQuotes
Market observables needed to construct the spot term structure of interest rates. A list of name/value pairs. See the help page for DiscountCurve for details.
市场观测值所需要的即期利率期限结构的构建。名称/值对列表。为DiscountCurve的详细信息,请参阅帮助页面。
参数:swaptionMaturities
A vector containing the swaption maturities associated with the rows of the swaption volatility matrix.
一个向量,包含相关的掉期期权到期日的掉期期权波动率阵行。
参数:swapTenors
A vector containing the underlying swap tenors associated with the columns of the swaption volatility matrix.
的向量含有底层交换男高音相关的与互换期权波幅矩阵的列。
参数:volMatrix
The swaption volatility matrix. Must be a 2D matrix stored by rows. See the example below.
掉期期权波动率阵。必须是按行存储的二维矩阵。请看下面的例子。
Details
详细信息----------Details----------
This function is based on QuantLib Version 0.3.10. It introduces support for fixed-income instruments in RQuantLib.
此功能是基于QuantLib版本0.3.10。它引入了固定收益工具的支持RQuantLib。
At present only a small number of the many parameters that can be set in QuantLib are exposed by this function. Some of the hard-coded parameters that apply to the current version include: day-count conventions, fixing days (2), index (Euribor), fixed leg frequency (annual), and floating leg frequency (semi-annual). Also, it is assumed that the swaption volatility matrix corresponds to expiration dates and tenors that are measured in years (a 6-month expiration date is not currently supported, for example).
目前只有少数的许多参数可以设置在QuantLib所公开的此功能。适用于当前版本的硬编码的参数,包括:天数的公约,的固定天(2),指数(EURIBOR),固定腿的频率(每年一次),以及浮动的的腿频率(半年度)。此外,它假定,掉期期权波动率阵对应的到期日期和期限,以年来衡量(6个月的截止日期,例如目前不支持)。
Given the number of parameters that must be specified and the care with which they must be specified (with no defaults), it is not practical to use this function in the usual interactive fashion.
鉴于必须指定的参数的数目和护理,它们必须被指定(没有缺省值),它是不实际使用此功能,在通常的交互方式。
The simplest approach is simply to save the example below to a file, edit as desired, and source the result. Alternatively, the input commands can be kept in a script file (under Windows) or an Emacs/ESS session (under Linux), and selected parts of the script can be executed in the usual way.
最简单的方法是简单地下面的例子保存到一个文件中,编辑想要的,和source的结果。另外,输入命令可以保存在一个脚本文件(Windows下)或Emacs / ESS的会话(在Linux下),以通常的方式,并选择部分的脚本可以被执行。
Fortunately, the C++ exception mechanism seems to work well with the R interface, and QuantLib exceptions are propagated back to the R user, usually with a message that indicates what went wrong. (The first part of the message contains technical information about the precise location of the problem in the QuantLib code. Scroll to the end to find information that is meaningful to the R user.)
幸运的是,C + +异常处理机制似乎运作良好的R接口,QuantLib例外传回的R用户,通常有一条消息,指出什么地方出了错。 (消息的第一部分包含技术信息的问题,在QuantLib代码的确切位置。滚动到结束是有意义的R用户查找信息。)
值----------Value----------
BermudanSwaption returns a list containing calibrated model paramters (what parameters are returned depends on the model selected) along with: <table summary="R valueblock"> <tr valign="top"><td>price</td> <td> Price of swaption in basis points (actual price equals price times notional divided by 10,000)</td></tr> <tr valign="top"><td>ATMStrike</td> <td> At-the-money strike</td></tr> <tr valign="top"><td>params</td> <td> Input parameter list</td></tr> </table>
BermudanSwaption返回一个列表,其中包含校准模型参数研究(参数返回取决于选择的型号)随着<table summary="R valueblock"> <tr valign="top"> <TD>price </ TD> <TD>个基点,掉期期权在价格(实际价格等于price名义倍除以10000)</ TD> </ TR> <tr valign="top"> <TD> X> </ TD> <TD>在钱罢工</ TD> </ TR> <tr valign="top"> <TD> ATMStrike</ TD> <TD>输入参数列表</ TD> </ TR> </ TABLE>
(作者)----------Author(s)----------
Dominick Samperi
参考文献----------References----------
Brigo, D. and Mercurio, F. (2001) Interest Rate Models: Theory and Practice, Springer-Verlag, New York.
For information about <code>QuantLib</code> see http://quantlib.org.
For information about <code>RQuantLib</code> see http://dirk.eddelbuettel.com/code/rquantlib.html.
参见----------See Also----------
DiscountCurve
DiscountCurve
实例----------Examples----------
# This data is taken from sample code shipped with QuantLib 0.3.10.[这个数据是从QuantLib 0.3.10附带的示例代码。]
params <- list(tradeDate=as.Date('2002-2-15'),
settleDate=as.Date('2002-2-19'),
payFixed=TRUE,
strike=.06,
method="G2Analytic",
interpWhat="discount",
interpHow="loglinear")
# Market data used to construct the term structure of interest rates[市场数据用于构建利率期限结构的]
tsQuotes <- list(d1w =0.0382,
d1m =0.0372,
fut1=96.2875,
fut2=96.7875,
fut3=96.9875,
fut4=96.6875,
fut5=96.4875,
fut6=96.3875,
fut7=96.2875,
fut8=96.0875,
s3y =0.0398,
s5y =0.0443,
s10y =0.05165,
s15y =0.055175)
# Use this to compare with the Bermudan swaption example from QuantLib[使用此百慕达掉期期权的例子比较QuantLib]
#tsQuotes <- list(flat=0.04875825)[tsQuotes < - 表(平= 0.04875825)]
# Swaption volatility matrix with corresponding maturities and tenors[相应的到期日和期限的掉期期权波动率阵]
swaptionMaturities <- c(1,2,3,4,5)
swapTenors <- c(1,2,3,4,5)
volMatrix <- matrix(
c(0.1490, 0.1340, 0.1228, 0.1189, 0.1148,
0.1290, 0.1201, 0.1146, 0.1108, 0.1040,
0.1149, 0.1112, 0.1070, 0.1010, 0.0957,
0.1047, 0.1021, 0.0980, 0.0951, 0.1270,
0.1000, 0.0950, 0.0900, 0.1230, 0.1160),
ncol=5, byrow=TRUE)
# Price the Bermudan swaption[价格百慕达掉期期权]
pricing <- BermudanSwaption(params, tsQuotes,
swaptionMaturities, swapTenors, volMatrix)
summary(pricing)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|