找回密码
 注册
查看: 872|回复: 0

R语言 RQuantLib包 FixedRateBond()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-28 20:33:24 | 显示全部楼层 |阅读模式
FixedRateBond(RQuantLib)
FixedRateBond()所属R语言包:RQuantLib

                                        Fixed-Rate bond pricing
                                         固定利率债券定价

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

The FixedRateBond function evaluates a fixed rate bond using discount curve.  More specificly, the calculation is done by DiscountingBondEngine from QuantLib. The NPV, clean price, dirty price, accrued interest, yield and cash flows of the bond is returned.  For more detail, see the source codes in QuantLib's file test-suite/bond.cpp.
FixedRateBond函数计算固定利率债券,采用的折现曲线。更多specificly,计算通过从QuantLib DiscountingBondEngine。返回净现值(NPV),清洁的价格,全价,应计利息,收益和现金流的债券。欲知更多详情,请参阅QuantLib的文件test-suite/bond.cpp的源代码。

The FixedRateBondPriceByYield function calculates the theoretical price of a fixed rate bond from its yield.
FixedRateBondPriceByYield函数计算其收益率固定利率债券的理论价格。

The FixedRateBondYield function calculates the theoretical yield of a fixed rate bond from its price.
FixedRateBondYield函数计算固定利率债券,其价格的理论产量。


用法----------Usage----------


## Default S3 method:[默认方法]
FixedRateBond(bond, rates, discountCurve, dateparams )

## Default S3 method:[默认方法]
FixedRateBondPriceByYield( settlementDays=1, yield, faceAmount,
                                 effectiveDate, maturityDate,
                                 period, calendar="us",
                                 rates, dayCounter=2,
                                 businessDayConvention=0, compound = 0, redemption=100,
                                 issueDate)

## Default S3 method:[默认方法]
FixedRateBondYield( settlementDays=1, price, faceAmount,
                                 effectiveDate, maturityDate,
                                 period, calendar="us",
                                 rates, dayCounter=2,
                                 businessDayConvention=0,
                                 compound = 0, redemption=100,
                                 issueDate)



参数----------Arguments----------

参数:bond
bond parameters, a named list whose elements are:    <table summary="Rd table"> <tr>  <td align="left"> issueDate     </td><td align="left"> a Date, the bond's issue date</td> </tr> <tr>  <td align="left"> maturityDate  </td><td align="left"> a Date, the bond's maturity date</td> </tr> <tr>  <td align="left"> faceAmount    </td><td align="left"> (Optional) a double, face amount of the bond.</td> </tr> <tr>  <td align="left">         </td><td align="left">  Default value is 100. </td> </tr> <tr>  <td align="left"> redemption    </td><td align="left"> (Optional) a double, percentage of the initial </td> </tr> <tr>  <td align="left">         </td><td align="left">         face amount that will be returned at maturity </td> </tr> <tr>  <td align="left">         </td><td align="left">    date. Default value is 100.</td> </tr> <tr>  <td align="left"> effectiveDate  </td><td align="left"> (Optinal) a Date, the bond's effective date. Default value is issueDate</td> </tr> <tr>  <td align="left"> </td> </tr>  </table>  
键参数,命名列表,其元素是:<table summary="Rd table"> <TR> <td ALIGN="LEFT"> issueDate</ TD> <TD ALIGN="LEFT">一个日期,债券的发行日期</ TD> </ TR> <TR> <td ALIGN="LEFT">maturityDate </ TD> <TD ALIGN="LEFT">日期,债券的到期日期</ TD > </ TR> <TR> <td ALIGN="LEFT"> faceAmount </ TD> <TD ALIGN="LEFT">(可选)双债券,票面金额。</ TD> < / TR> <TR> <td ALIGN="LEFT">  </ TD> <TD ALIGN="LEFT">默认值是100。 </ TD> </ TR> <TR> <td ALIGN="LEFT"> redemption </ TD> <TD ALIGN="LEFT">(可选)双比例的初始</ TD> </ TR> <TR> <td ALIGN="LEFT">  </ TD> <TD ALIGN="LEFT">票面金额于到期日将返回</ TD> </ TR> <TR > <td ALIGN="LEFT">  </ TD> <TD ALIGN="LEFT">日期。默认值是100。</ TD> </ TR> <TR> <td ALIGN="LEFT"> effectiveDate </ TD> <TD ALIGN="LEFT">(Optinal)一个日期,债券的有效日。默认值是issueDate的</ TD> </ TR> <TR> <td ALIGN="LEFT"> </ TD> </ TR> </ TABLE>


参数:rates
a numeric vector, bond's coupon rates
一个数值向量,债券的票面息率


参数:discountCurve
Can be one of the following:   <table summary="Rd table"> <tr>  <td align="left"> a DiscountCurve </td><td align="left">  a object of DiscountCurve class </td> </tr> <tr>  <td align="left">         </td><td align="left"> For more detail, see example or </td> </tr> <tr>  <td align="left">          </td><td align="left"> the discountCurve function </td> </tr> <tr>  <td align="left"> A 2 items list </td><td align="left"> specifies a flat curve in two </td> </tr> <tr>  <td align="left">         </td><td align="left"> values "todayDate" and "rate"   </td> </tr> <tr>  <td align="left"> A 3 items list </td><td align="left"> specifies three values to construct a </td> </tr> <tr>  <td align="left">         </td><td align="left"> DiscountCurve object, "params" , </td> </tr> <tr>  <td align="left">   </td><td align="left"> "tsQuotes", "times". </td> </tr> <tr>  <td align="left">         </td><td align="left"> For more detail, see example or </td> </tr> <tr>  <td align="left">          </td><td align="left"> the discountCurve function </td> </tr> <tr>  <td align="left"> </td> </tr>  </table>  
可以是下列之一:<table summary="Rd table"> <TR> <td ALIGN="LEFT">a DiscountCurve </ TD> <TD ALIGN="LEFT">一个对象的DiscountCurve类< / TD> </ TR> <TR> <td ALIGN="LEFT">  </ TD> <TD ALIGN="LEFT">的更多详细信息,请参阅示例或</ TD> </ TR> <TR> <td ALIGN="LEFT"> </ TD> <TD ALIGN="LEFT"> discountCurve功能</ TD> </ TR> <TR> <td ALIGN="LEFT"> A 2 items list </ TD> <TD ALIGN="LEFT">指定一条平坦的曲线在2 </ TD> </ TR> <TR> <td ALIGN="LEFT"></ TD > <td ALIGN="LEFT">的价值“todayDate”和“速度”</ TD> </ TR> <TR> <td ALIGN="LEFT">A 3 items list </ TD> <TD对齐=“离开“>指定三个值来构建一个</ TD> </ TR> <TR>”<td ALIGN="LEFT">的 </ TD> <TD ALIGN="LEFT"> DiscountCurve对象,“PARAMS “</ TD> </ TR> <TR> <td ALIGN="LEFT">  </ TD> <TD ALIGN="LEFT">”tsQuotes“,”与时俱进“。 </ TD> </ TR> <TR> <td ALIGN="LEFT">  </ TD> <TD ALIGN="LEFT">的更多详细信息,请参阅示例或</ TD> </ TR文章<td ALIGN="LEFT"> </ TD> <TD ALIGN="LEFT"> discountCurve功能</ TD> </ TR> <TR> <TD对齐=“左边” > </ TD> </ TR> </ TABLE>


参数:dateparams
(Optional) a named list, QuantLib's date parameters of the bond.    <table summary="Rd table"> <tr>  <td align="left"> settlementDays </td><td align="left"> (Optional) a double, settlement days. </td> </tr> <tr>  <td align="left">          </td><td align="left"> Default value is 1.</td> </tr> <tr>  <td align="left"> calendar </td><td align="left"> (Optional) a string, either 'us' or 'uk' </td> </tr> <tr>  <td align="left">          </td><td align="left"> corresponding to US Goverment Bond </td> </tr> <tr>  <td align="left">                    </td><td align="left"> calendar and UK Exchange calendar.</td> </tr> <tr>  <td align="left">         </td><td align="left">  Default value is 'us'.</td> </tr> <tr>  <td align="left"> dayCounter </td><td align="left"> (Optional) a number or string, </td> </tr> <tr>  <td align="left">          </td><td align="left"> day counter convention.</td> </tr> <tr>  <td align="left">         </td><td align="left">  See Enum. Default value is 'Thirty360' </td> </tr> <tr>  <td align="left">  period  </td><td align="left"> (Optional) a number or string, </td> </tr> <tr>  <td align="left">        </td><td align="left">  interest compounding interval. See Enum. </td> </tr> <tr>  <td align="left">        </td><td align="left"> Default value is 'Semiannual'.</td> </tr> <tr>  <td align="left"> businessDayConvention </td><td align="left"> (Optional) a number or string, </td> </tr> <tr>  <td align="left">           </td><td align="left"> business day convention. </td> </tr> <tr>  <td align="left">  </td><td align="left"> See Enum. Default value is 'Following'. </td> </tr> <tr>  <td align="left"> terminationDateConvention </td><td align="left"> (Optional) a number or string, </td> </tr> <tr>  <td align="left">           </td><td align="left"> termination day convention. </td> </tr> <tr>  <td align="left">  </td><td align="left"> See Enum. Default value is 'Following'. </td> </tr> <tr>  <td align="left"> endOfMonth </td><td align="left"> (Optional) a numeric with value 1 or 0. </td> </tr> <tr>  <td align="left">     </td><td align="left"> End of Month rule. Default value is 0.</td> </tr> <tr>  <td align="left"> dateGeneration </td><td align="left"> (Optional) a numeric, date generation method. </td> </tr> <tr>  <td align="left">   </td><td align="left"> See Enum. Default value is 'Backward' </td> </tr> <tr>  <td align="left"> </td> </tr>  </table>  See example below.
(可选)命名列表,QuantLib的日期参数的债券。 <table summary="Rd table"> <TR> <td ALIGN="LEFT">settlementDays </ TD> <TD ALIGN="LEFT">(可选)双交收日。 </ TD> </ TR> <TR> <td ALIGN="LEFT">  </ TD> <TD ALIGN="LEFT">默认值是1。</ TD> </ TR> < TR> <td ALIGN="LEFT"> calendar </ TD> <TD ALIGN="LEFT">(可选)一个字符串,是我们或UK</ TD> </ TR> < TR> <td ALIGN="LEFT">  </ TD> <TD ALIGN="LEFT">相应的美国电子政务债券的</ TD> </ TR> <TR> <TD对齐=“左边” ></ TD> <TD ALIGN="LEFT">日历和英国的Exchange日历。</ TD> </ TR> <TR> <td ALIGN="LEFT"></ TD> <TD ALIGN="LEFT">默认值是我们。</ TD> </ TR> <TR> <td ALIGN="LEFT">dayCounter </ TD> <TD对齐=“左“>(可选)一个数字或字符串,</ TD> </ TR> <TR> <td ALIGN="LEFT"> </ TD> <TD ALIGN="LEFT">天数计数器公约</ TD> </ TR> <TR> <td ALIGN="LEFT"> </ TD> <TD ALIGN="LEFT">枚举。默认值是“Thirty360”</ TD> </ TR> <TR> <td ALIGN="LEFT"> period </ TD> <TD ALIGN="LEFT">(可选)一个数字或字符串, </ TD> </ TR> <TR> <td ALIGN="LEFT">  </ TD> <TD ALIGN="LEFT">利息复利的时间间隔。请参阅枚举。 </ TD> </ TR> <TR> <td ALIGN="LEFT">  </ TD> <TD ALIGN="LEFT">默认值是“半年报”。</ TD> </ TR文章<td ALIGN="LEFT"> businessDayConvention </ TD> <TD ALIGN="LEFT">(可选)一个数字或字符串</ TD> </ TR> <TR> <TD ALIGN =“”> </ TD> <TD ALIGN="LEFT">工作日约定。 </ TD> </ TR> <TR> <td ALIGN="LEFT"> </ TD> <TD ALIGN="LEFT">枚举。默认值是“继”。 </ TD> </ TR> <TR> <td ALIGN="LEFT"> terminationDateConvention </ TD> <TD ALIGN="LEFT">(可选)一个数字或字符串,</ TD> </ TR> <TR> <td ALIGN="LEFT"> </ TD> <TD ALIGN="LEFT">终止日约定。 </ TD> </ TR> <TR> <td ALIGN="LEFT"> </ TD> <TD ALIGN="LEFT">枚举。默认值是“继”。 </ TD> </ TR> <TR> <td ALIGN="LEFT"> endOfMonth </ TD> <TD ALIGN="LEFT">(可选)一个数字值1或0。 </ TD> </ TR> <TR> <td ALIGN="LEFT">  </ TD> <TD ALIGN="LEFT">月份结束规则。默认值是0。</ TD> </ TR> <TR> <td ALIGN="LEFT"> dateGeneration </ TD> <TD ALIGN="LEFT">(可选)一个数字,日期生成方法。 </ TD> </ TR> <TR> <td ALIGN="LEFT"> </ TD> <TD ALIGN="LEFT">枚举。默认值是“落后”</ TD> </ TR> <TR> <td ALIGN="LEFT"> </ TD> </ TR> </ TABLE>参见下面的例子。


参数:settlementDays
an integer, 1 for T+1, 2 for T+2, etc...
一个整数,1为T +2,等等,为T 1,2 ..


参数:yield
yield of the bond
收益率的债券


参数:price
price of the bond
债券价格


参数:effectiveDate
bond's effective date
债券的有效日期


参数:maturityDate
bond's maturity date
债券的到期日


参数:period
frequency of events,0=NoFrequency, 1=Once, 2=Annual, 3=Semiannual, 4=EveryFourthMonth, 5=Quarterly, 6=Bimonthly ,7=Monthly ,8=EveryFourthWeely,9=Biweekly, 10=Weekly, 11=Daily. For more information, see QuantLib's Frequency class
频率的事件,0 = NoFrequency,1 =一次,2 =年,3 =半年,EveryFourthMonth,4 = 5 = 6 =双月刊,7 =月,8 = EveryFourthWeely,9 =双周,10 =每周11 =日报。有关详细信息,请参阅QuantLib的频率类


参数:calendar
Business Calendar. Either us or uk
业务日历。无论是us或uk


参数:faceAmount
face amount of the bond
债券的票面金额


参数:businessDayConvention
convention used to adjust a date in case it is not a valid business day. See quantlib for more detail. 0 = Following, 1 = ModifiedFollowing, 2 = Preceding, 3 = ModifiedPreceding, other = Unadjusted
惯例来调整日期的情况下,它是不是一个有效的营业日。更多详细信息,请参阅quantlib。 0 =以下,1 = ModifiedFollowing,2 = 3 = ModifiedPreceding前面,其他月份未经调整的


参数:dayCounter
day count convention. 0 = Actual360(), 1 = Actual365Fixed(), 2 = ActualActual(), 3 = Business252(), 4 = OneDayCounter(), 5 = SimpleDayCounter(), all other = Thirty360(). For more information, see QuantLib's DayCounter class
天数计算惯例。 0 = Actual360(),1 = Actual365Fixed(),2 = ActualActual(),3 = Business252(),4 = OneDayCounter(),5 = SimpleDayCounter(),所有其他= Thirty360()。有关详细信息,请参阅QuantLib的DayCounter类


参数:compound
compounding type. 0=Simple, 1=Compounded, 2=Continuous, all other=SimpleThenCompounded. See QuantLib's Compound class
复合型。 0 =简单,1 =复合,2 =连续,所有其他= SimpleThenCompounded。 QuantLib的复合类


参数:redemption
redemption when the bond expires
债券到期赎回时


参数:issueDate
date the bond is issued
债券发行的日期


Details

详细信息----------Details----------

A discount curve is built to calculate the bond value.
的折扣曲线是建立在计算债券价值。

Please see any decent Finance textbook for background reading, and the QuantLib documentation for details on the QuantLib implementation.  
请参阅任何像样的金融教科书的背景阅读,QuantLibQuantLib实施的细节上的文件。


值----------Value----------

The FixedRateBond function returns an object of class FixedRateBond (which inherits from class  Bond). It contains a list with the following components: <table summary="R valueblock"> <tr valign="top"><td>NPV</td> <td> net present value of the bond</td></tr> <tr valign="top"><td>cleanPrice</td> <td> clean price of the bond</td></tr> <tr valign="top"><td>dirtyPrice</td> <td> dirty price of the bond</td></tr> <tr valign="top"><td>accruedAmount</td> <td> accrued amount of the bond</td></tr> <tr valign="top"><td>yield</td> <td> yield of the bond</td></tr> <tr valign="top"><td>cashFlows</td> <td> cash flows of the bond</td></tr>
FixedRateBond函数返回一个类的对象FixedRateBond(继承自类Bond)。它包含以下组件的列表:<table summary="R valueblock"> <tr valign="top"> <TD>NPV</ TD> <TD>的债券净现值</ TD > </ TR> <tr valign="top"> <TD>cleanPrice </ TD> <TD>干净的债券价格</ TD> </ TR> <tr valign="top"> < dirtyPrice TD> </ TD> <TD>脏债券价格</ TD> </ TR> <tr valign="top"> <TD> accruedAmount</ TD> <TD>应计的债券金额</ TD> </ TR> <tr valign="top"> <TD>yield </ TD> <TD>债券的收益率</ TD> </ TR> <TR VALIGN =“”> <TD>cashFlows </ TD> <TD>现金流的债券</ TD> </ TR>

</table> The FixedRateBondPriceByYield function returns an object of class FixedRateBondPriceByYield (which inherits from class  Bond). It contains a list with the following components: <table summary="R valueblock"> <tr valign="top"><td>price</td> <td> price of the bond</td></tr>
</ TABLE> FixedRateBondPriceByYield函数返回一个类的对象FixedRateBondPriceByYield(继承自类Bond)。它包含了以下组件:<table summary="R valueblock"> <tr valign="top"> <TD> price </ TD> <TD>债券价格</ TD> < / TR>

</table> The FixedRateBondYield function returns an object of class FixedRateBondYield (which inherits from class  Bond). It contains a list with the following components: <table summary="R valueblock"> <tr valign="top"><td>yield</td> <td> yield of the bond</td></tr> </table>
</ TABLE> FixedRateBondYield函数返回一个类的对象FixedRateBondYield(继承自类Bond)。它包含了以下组件:<table summary="R valueblock"> <tr valign="top"> <TD> yield </ TD> <TD>债券的收益率</ TD> < / TR> </ TABLE>


注意----------Note----------

The interface might change in future release as QuantLib
该接口在将来的版本中可能会改变QuantLib


(作者)----------Author(s)----------


Khanh Nguyen <a href="mailto:knguyen@cs.umb.edu">knguyen@cs.umb.edu</a> for the inplementation; Dirk Eddelbuettel <a href="mailto:edd@debian.org">edd@debian.org</a> for the <font face="Courier New,Courier" color="#666666"><b>R</b></font> interface;
the QuantLib Group for <code>QuantLib</code>



参考文献----------References----------

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-26 18:27 , Processed in 0.020412 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表