Re: Why not boost random numbers?

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Why-not-boost-random-numbers-tp12868p12871.html

Dima and Christian,
        sorry for the delay.  The proposal is interesting---as Dima pointed
out, we'd better go with Boost distributions and random numbers in the
long run (especially, I would add, since they will be no longer only
part of Boost; they will also be included in the next C++ standard.)
However, my problem at this time is that we're finalizing the library
interfaces in order to release QuantLib 1.0 (we should be done in a
short while) and we'll freeze the interfaces afterwards.  Therefore,
it's unlikely that we'll change random-number generation entirely.

However, there's much that can be done, even within the constraints of
the frozen interfaces. For instance, there are cases such as that shown
by Dima:

On Thu, 2009-06-18 at 12:16 +0200, Dima wrote:

>         But I think a better Idea would be to replace the current
>         occurrence of the other classes. This wouldn't be too
>         much work, since usually the initialization of the cdf is done
>         once, eg.  
>        
>         CumulativeNormalDistribution f; // in the BlackCalculator
>        
>         Then, f is used throughout the class as a functor. So, if you
>         would replace f here with a boost
>         class, the merging is straightforward. Running the test_suite
>         will show if there's any difference
>         to current implementation.

Here, the distribution is not part of the interface, but rather just an
implementation detail---and can be replaced without problems.

In other places, the substitution wouldn't be that straightforward.  For
instance, replacing the InverseCumulativeDistribution class in the path
generation would most likely cause an interface change, and is thus out.
However, there's hope for that, too; the Monte Carlo classes are modular
enough that one can replace the path-generator classes entirely and plug
new ones (using boost) in the existing Monte Carlo engines.  The new
classes might then replace the old ones in version 2.0, whenever that
is.  (Note: even if we found out that our algorithms were more precise,
at that point I'd change them to conform to the boost interface anyway,
since that would be the standard interface.)

Thoughs so far?

Luigi


--

This gubblick contains many nonsklarkish English flutzpahs, but the
overall pluggandisp can be glorked from context.
-- David Moser



------------------------------------------------------------------------------
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev