Re: Why not boost random numbers?

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



Hi Christian, thanks for you interest.

Let's open this for a discussion? My first step would be to merge the boost distributions to QuantLib.

------------------
Advantages:
------------------

First of all, they have many more distributions, such as non central ones and weibull, triangular.
Then, I personally like the following syntax:

#include <boost/math/distributions.hpp>
using namespace boost::math;

normal_distribution<> nd;

cout << cdf(nd,0.2)            << endl;
cout << pdf(nd,0.0)            << endl;
cout << quantile(nd,0.1)     << endl;

for cdf, pdf and inverse cdf.

----------------------
Disadvantages:
----------------------

Basically I'm not sure if the implementation there suits our needs. I can immagine that boost
provides basic math classes, which are good enough for the standard user, but I'm not sure
if they are good enough for a library that relies a lot on this things and consequently needs
a high quality implementation. But again, I think its better to go with boost in the long run
as it will be improved on a regular basis by the community.


What would a possible merger look like? Either keep current classes such as "InverseCumulativeNormal"
and merge boost in the actual implementation, e.g. initialize a boost distribution in constructor and call
it, instead of the current one.

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.

What do you think?
         






















2009/6/18 Pfrang, Christian <[hidden email]>


Hi all,

I've been following the posts on boost and quantlib and I wanted to let you know that I'd be interested in contributing to the boostification of quantlib.

My background is in Applied Math (I'm a graduate student in Stochastic Processes/ Dynamical Systems), but I'm an open source newbie and I would need some guidance as to what would be a useful and doable starting point.

If anyone of you is interested/ has some time to give me an idea what you think could/ should be done that would be great!

Best and thank you,

Christian


-----Original Message-----
From: Ferdinando Ametrano [mailto:[hidden email]]
Sent: Mon 6/8/2009 11:18 AM
To: Dima
Cc: QuantLib developers
Subject: Re: [Quantlib-dev] Why not boost random numbers?

On Sun, Jun 7, 2009 at 8:09 PM, Dima<[hidden email]> wrote:
> Boost has a random number library too and I was wondering, why this has
> never been considered and why own classes have been set up which were
> not based on the boost library.

If I remember right Luigi took a look at boost random number and
concluded it was not an half-hour switch.
Beside it's not just matter of abandoning the QuantLib random number
framework, but also porting to the boost framework some generator
which is not available in boost (and which might remain in QuantLib or
could be contributed back to boost)

Anyway you're right that a further "boostification" of the QuantLib
library would be a plus. Not only random numbers, but also math and
stats come to my mind, and there's probably more

As usual any contribution in this direction would be welcome

ciao -- Nando

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev








------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev