Posted by
SourceForge.net on
Nov 06, 2012; 11:33am
URL: http://quantlib.414.s1.nabble.com/quantlib-Bugs-3568164-mistake-in-calendar-tp12092.html
Bugs item #3568164, was opened at 2012-09-16 07:19
Message generated for change (Comment added) made by lballabio
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3568164&group_id=12740Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Sebastien Gurrieri (sebgur)
>Assigned to: Luigi Ballabio (lballabio)
Summary: mistake in calendar?
Initial Comment:
I think there is a mistake in your implementation of the holidays of the Japanese calendar. It seems to produce a different answer as to the "golden week" which is a series of holidays in the beginning of May in Japan. The results are inconsistent with other calculators such as Bloomberg. I also compared your code with legal Japanese websites and I believe there is a misunderstanding in your code as to what happens when one or more of the holidays fall in a week-end.
Best Regards,
Sebastien
----------------------------------------------------------------------
Comment By: Luigi Ballabio (lballabio)
Date: 2012-11-06 03:33
Message:
The patch was applied to the Subversion repository.
Thank you for the report and the fix.
----------------------------------------------------------------------
Comment By: Sebastien Gurrieri (sebgur)
Date: 2012-09-17 11:31
Message:
On this link we can see that 07/05/2013 is a business day in Japan
http://portalseven.com/calendar/Holidays_Japan.jsp?year=2013
and this is consistent with what I see in Bloomberg. As you can see at the
bottom of this page, the “Greenery day”, on the 4th, falls on a
Saturday while the Children’s Day falls on the Sunday 5th. I checked the
QuantLib code, and it seems to consider that any day in the 3rd, 4th, and
5th, that falls on a week-end will be compensated by a holiday on the week
after that, and for example, when the 4th is a Saturday and the 5th is a
Sunday, 2 days will be compensated in QuantLib, yielding a holiday on the
7th. The QuantLib addin accordingly answers that the 7th is a holiday,
which does not seem to be in line with Japanese rules. Indeed, the rule is
that only when such a day falls on a Sunday will it be compensated for.
See the reference
http://www8.cao.go.jp/chosei/shukujitsu/gaiyou.html
Sorry for the Japanese, but here is the sentence saying it in the link
above
また、「国民の祝日」が日曜日に当たるときは、その日後においてその日に最も近い「国民の祝日」でない日を休日とすることになりました。
I’m not a Japanese native so I checked by asking around me to Japanese
people, and they confirmed the Sunday-only rule (I work in a Japanese
bank).
This rule is indeed consistent with what is observed in the first link for
2013. Currently the code is (I’m still on the 1.2.0)
|| (d == 3 && m == May)
// Holiday for a Nation
|| (d == 4 && m == May)
// Children's Day
|| (d == 5 && m == May)
// any of the three above observed later if on Saturday or
Sunday
|| ((d == 6 || d == 7) && m == May
&& (w == Monday || w == Tuesday || w == Wednesday))
but I’m thinking that
|| (d == 3 && m == May)
// Holiday for a Nation
|| (d == 4 && m == May)
// Children's Day
|| (d == 5 && m == May)
// any of the three above observed later if on Saturday or
Sunday
|| (d == 6 && m == May
&& (w == Monday || w == Tuesday || w == Wednesday))
would probably be more in line with what the official rule seems to be.
Best regards,
Sebastien
----------------------------------------------------------------------
Comment By: Luigi Ballabio (lballabio)
Date: 2012-09-17 01:59
Message:
May you provide some examples of correct data?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=3568164&group_id=12740------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev