Login  Register

Re: Slow impliedVolatility and NPV calculation when using Business252 dayCounter

Posted by Luigi Ballabio on Sep 18, 2012; 7:23am
URL: http://quantlib.414.s1.nabble.com/Slow-impliedVolatility-and-NPV-calculation-when-using-Business252-dayCounter-tp200p201.html

While actual/365 just counts days by taking the difference between the
start and end dates, the business/252 day counter has no choice but to
loop over each day and check whether it's a business day or a holiday.
 The speed is better in version 1.2, since the day counter caches day
counts for months and years (you might want to switch to that version
if you're still using QuantLib 1.1) but there are still quite a few
calculations done at each call.  If that is still too slow, you may
try adding caching results for pairs of dates; that would speed you up
a lot if you're always recalculating the same options.  If you do,
please send the patch here and I'll apply it to the repository.

Later,
    Luigi


On Tue, Sep 18, 2012 at 8:57 AM, aimz <[hidden email]> wrote:

>
> I am having a bit of an issue with the speed of calculation. As I need to
> recalculate hundreds of options every few hundred milliseconds it generates
> a problem.
>
> Here is what I do to calculate simple vanilla EuropeanOptions: I use a
> simple BlackConstantVol, a BlackScholesMertonProcess to calculate NPV and
> impliedVolatility.
>
> Question: this process is very fast when I use a Actual365Fixed but VERY
> SLOW when I replace this counter with a Business 252 day counter. Basically
> the calculation takes many orders of magnitudes more.
>
> Note: in both cases I use the correct respective calendar.
>
> What could be the reason as the only diff is the day counter?
> --
> View this message in context: http://old.nabble.com/Slow-impliedVolatility-and-NPV-calculation-when-using-Business252-dayCounter-tp34446063p34446063.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users