英文:
question about refDate and refPeriodStart/End
问题
Quantlib的Event类具有referenceDate,Coupon类具有referenceStartPeriod和referenceEndPeriod,除了accrualStartDate和accrualEndDate。在现实世界中,使用ref date和refPeriodStart/End的场景是什么?
我可以理解其实现,但好奇知道实际应用场景。
英文:
The Quantlib's Event class has referenceDate and Coupon class has referenceStartPeriod and referenceEndPeriod in addition to accrualStartDate and accrualEndDate. What is the real world scenario to use ref date and refPeriodStart/End?
I can follow the implementation but curious to know the real world use cases.
答案1
得分: 0
您说得对,“refDate”参数传递给“Event::hasOccurred”方法的名称可能不应该叫做参考日期;它并不是任何东西的参考。调用“event.hasOccurred(d)”会告诉您事件是否已经在日期“d”发生。目前我没有更好的参数名称;它也不一定是评估日期,因为通过调用该方法,我可能正在询问事件是否会在一年后发生或者是否已经在三个月前发生。欢迎提供建议。
在“Coupon”类中,参考开始和结束日期仅在日计数约定为Act/Act(ISMA)的情况下使用,因为后者在长期或短期票券的情况下需要参考期间;您可以在此文档中找到有关ISDA的详细信息。简而言之,除了短期/长期票券的开始和结束之外,日计数算法还需要一个“常规”参考期间的开始和结束。我们将它们称为“refPeriodStart”和“refPeriodEnd”。
英文:
You're right, the refDate parameter passed to the Event::hasOccurred method probably shouldn't be called reference date; it's not a reference for anything. Calling event.hasOccurred(d) tells you whether or not the event has already occurred at date d. I don't have a better name for the parameter at this time; it's not necessarily an evaluation date either, because by calling the method I might be asking whether the event will have occurred in a year's time or whether it had occurred three months ago. Suggestions are welcome.
In the Coupon class, the reference start and end are only used in the case the day-count convention is Act/Act(ISMA), since the latter requires a reference period in case of long or short coupons; you can find the details in this document from ISDA. In short, besides the start and end of the short/long coupon, the day-count algorithm also needs the start and end of a "regular" reference period. We're calling those refPeriodStart and refPeriodEnd.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论