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

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

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

                                        Calendar functions from QuantLib
                                         日历功能QuantLib

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

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

The isBusinessDay function evaluates the given dates in the context of the given calendar, and returns a vector of booleans indicating business day status. BusinessDay is also recognised (but may be deprecated one day).
isBusinessDay函数在给定的日历的背景下,给定的日期进行评估,并返回一个布尔值,指示工作日状态向量的。 BusinessDay也确认(但可能会过时一天)。

The isHoliday function evaluates the given dates in the context of the given calendar, and returns a vector of booleans indicating holiday day status.
isHoliday函数在给定的日历的背景下,给定的日期进行评估,并返回一个布尔值,表示休假日的状态向量。

The isWeekend function evaluates the given dates in the context of the given calendar, and returns a vector of booleans indicating weekend status.
isWeekend函数在给定的日历的背景下,给定的日期进行评估,并返回一个布尔值,表示周末的状态向量。

The isEndOfMonth function evaluates the given dates in the context of the given calendar, and returns a vector of booleans indicating end of month status.
isEndOfMonth函数在给定的日历的背景下,给定的日期进行评估,并返回一个向量,表示结束的一个月状态的布尔值。

The getEndOfMonth function evaluates the given dates in the context of the given calendar, and returns a vector that corresponds to the end of month. endOfMonth is a deprecated form for this function.
getEndOfMonth函数在给定的日历的背景下,给定的日期进行评估,并返回一个向量,对应于月末。 endOfMonth不推荐使用此功能。

The getHolidayList function returns the holidays between the given dates, with an option to exclude weekends.  holidayList is a deprecated form for this function.
getHolidayList函数返回给定的日期之间的假期,有一个选项,以排除周末。 holidayList不推荐使用此功能。

The adjust function evaluates the given dates in the context of the given calendar, and returns a vector that adjusts each input dates to the appropriate near business day with respect to the given convention.
adjust函数在给定的日历的背景下,给定的日期进行评估,并返回一个向量,调整每个输入日期以适当的近工作日,对于给定的公约。

The advance function evaluates the given dates in the context of the given calendar, and returns a vector that advances the given dates of the given number of business days and returns the result. This functions gets called either with both argument n and timeUnit, or with argument period.
advance函数在给定的日历的背景下,给定的日期进行评估,并返回一个向量的进步给定数量的营业日,并返回结果给定的日期。这个函数被调用都参数n和timeUnit,或参数period。

The businessDaysBetween function evaluates two given dates in the context of the given calendar, and returns a vector that gives the number of business day between.  
businessDaysBetween函数在给定的日历的背景下,两个给定日期进行评估,并返回一个向量,提供了数之间的营业日。

The dayCount function returns the number of day between two dates given a day counter, see Enum.
dayCount函数返回了天数计数器的两个日期之间的天数,枚举。

The yearFraction function returns year fraction between two dates given a day counter, see Enum.
yearFraction函数返回年部分两个日期之间给出一个天数计数器,请参见枚举。

The setCalendarContext function sets three values to a singleton instance at the C++ layer.
setCalendarContext功能设置三个值的单一实例在C + +层。

The setEvaluationDate function sets the evaluation date used by the QuantLib pricing engines.
setEvaluationDate功能设置评价QuantLib定价引擎的使用日期。


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


isBusinessDay(calendar="TARGET", dates=Sys.Date())
businessDay(calendar="TARGET", dates=Sys.Date())  # deprecated form
isHoliday(calendar="TARGET", dates=Sys.Date())
isWeekend(calendar="TARGET", dates=Sys.Date())
isEndOfMonth(calendar="TARGET", dates=Sys.Date())
getEndOfMonth(calendar="TARGET", dates=Sys.Date())
endOfMonth(calendar="TARGET", dates=Sys.Date())
getHolidayList(calendar="TARGET", from=Sys.Date(), to = Sys.Date() + 5, includeWeekends = 0)
holidayList(calendar="TARGET", from=Sys.Date(), to = Sys.Date() + 5,
includeWeekends = 0)
adjust(calendar="TARGET", dates=Sys.Date(), bdc = 0)
advance(calendar="TARGET", dates=Sys.Date(), n, timeUnit, period, bdc = 0, emr =0)

businessDaysBetween(calendar="TARGET", from=Sys.Date(),
to = Sys.Date() + 5, includeFirst = 1, includeLast = 0)
dayCount(startDates, endDates, dayCounters)
yearFraction(startDates, endDates, dayCounters)
setCalendarContext(calendar, fixingDays, settleDate)
setEvaluationDate(evalDate)



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

参数:calendar
A string identifying one of the supported QuantLib calendars, see Details for more
一个字符串,标识QuantLib的支持日历,查看更多详情


参数:dates
A vector (or scalar) of Date types.
Date类型的一个向量(或标量)。


参数:from
A vector (or scalar) of Date types.
Date类型的一个向量(或标量)。


参数:to
A vector (or scalar) of Date types.
Date类型的一个向量(或标量)。


参数:includeWeekends
boolean that indicates whether the calculation should include the weekends. Default = false
布尔值,表示的计算是否应包括周末。默认值=假


参数:fixingDays
An integer for the fixing day period, defaults to 2.
一个整数的固定天的时间,默认为2。


参数:settleDate
A date on which trades settles, defaults to two days after the current day.
上交易结算的日期,两天后,默认为当前日期。


参数:n
an integer number
一个整数


参数:timeUnit
A value of 0,1,2,3 that corresponds to Days, Weeks, Months, and Year; for more detail, see the QuantLib documentation at http://quantlib.org/reference/group__datetime.html
值0,1,2,3,对应于天,周,月,年;更多详细信息,请参阅QuantLib在http://quantlib.org/reference/group__datetime.html的文件


参数:period
See Enum
请参见枚举


参数:bdc
Business day convention. By default, this value is 0 and correspond to Following convention
业务一天公约。默认情况下,这个值是0,对应于以下公约


参数:emr
End Of Month rule, default is false
年底个月的规则,默认为false


参数:includeFirst
boolean that indicates whether the calculation should include the first day. Default = true
布尔值,表示的计算是否应包括的第一天。默认值=真


参数:includeLast
Default = false
默认值=假


参数:startDates
A vector of Date type.
的向量Date类型。


参数:endDates
A vector of Date type.
的向量Date类型。


参数:dayCounters
A vector of numeric type. See Enum
一个矢量的数字类型。请参见枚举


参数:evalDate
A single date used for the pricing valuations.
一个日期的定价估值。


Details

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

The calendars are coming from QuantLib, and the QuantLib documentation should be consulted for details.
日历是来自QuantLib,QuantLib文件应详细咨询。

Currently, the following strings are recognised: TARGET (a default calendar), Canada and Canada/Settlement, Canada/TSX, Germany and Germany/FrankfurtStockExchange, Germany/Settlement, Germany/Xetra, Germany/Eurex, Italy and Italy/Settlement, Italy/Exchange, Japan, UnitedKingdom and UnitedKingdom/Settlement, UnitedKingdom/Exchange, UnitedKingdom/Metals, UnitedStates and UnitedStates/Settlement, UnitedStates/NYSE, UnitedStates/GovernmentBond, UnitedStates/NERC.
目前,确认以下字符串:目标(默认日历),加拿大和加拿大/结算,加拿大/ TSX,德国和德国/ FrankfurtStockExchange,德国/结算,德国/ XETRA,德国/欧洲期货交易所(Eurex),意大利和意大利/结算,意大利/兑换,日本,大英帝国,英帝国/结算,英帝国/交换,英帝国/金属,UnitedStates的和UnitedStates /结算,UnitedStates的国家UnitedStates / NYSE / GovernmentBond,国家UnitedStates / NERC。

(In case of multiples entries per country, the country default is listed right after the country itself. Using the shorter form is equivalent.)
(在每个国家的倍数项的情况下,上市后,该国本身的国家默认使用较短的形式是等价的。)


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

A named vector of booleans each of which is true if the corresponding date is a business day (or holiday or weekend) in the given calendar. The element names are the dates (formatted as text in yyyy-mm-dd format).
一个命名为向量的布尔值,每一个相应的日期是真实的,如果是一个营业日(或假期或周末)在给定的日历。元素名称的日期(YYYY-MM-DD格式的文本格式)。

For setCalendarContext, a boolean or NULL in case of error.
对于setCalendarContext在发生错误的情况下,布尔型或者NULL。


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

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


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


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 19:45 , Processed in 0.025999 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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