Posted by
Simon Ibbotson on
URL: http://quantlib.414.s1.nabble.com/Why-does-DayCounter-Business252-blow-up-the-pricing-time-tp852p854.html
Why does it have to be so inefficient? If the time period is greater than even a few days, it would be more efficient to count the number of holidays between the days (and total up the number of weekends) and remove the total from the number of days...
Sent from my BlackBerry® wireless device
-----Original Message-----
From: Luigi Ballabio <
[hidden email]>
Date: Tue, 02 Feb 2010 18:52:21
To: ravi agrawal<
[hidden email]>
Cc: <
[hidden email]>
Subject: Re: [Quantlib-users] Why does DayCounter Business252 blow up the
pricing time
On Tue, 2010-02-02 at 11:15 -0600, ravi agrawal wrote:
> I wanted to know why is Business252
> DayCounter dayCounter252 =
> Business252(UnitedStates(UnitedStates::NYSE));
> is increasing the time taken to price option.
Business252 must count the business days between the dates, which can
only be done by iterating over all the dates in between and checking
whether they are holidays (see the Calendar::businessDaysBetween method,
which is called by Business252::Impl::dayCount.) All other day counters
just count the actual days between the dates (or some approximation
thereof) which can be done very quickly by taking the difference between
the two dates.
Luigi
--
All parts should go together without forcing. You must remember that
the parts you are reassembling were disassembled by you. Therefore, if
you can't get them together again, there must be a reason. By all
means, do not use a hammer.
-- IBM maintenance manual, 1925
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users