libqueso / queso

QUESO is a C++ library for doing uncertainty quantification. QUESO stands for Quantification of Uncertainty for Estimation, Simulation and Optimization.
Other
57 stars 40 forks source link

Restructuring pdf/cdf/mgf #220

Open SylvainPlessis opened 10 years ago

SylvainPlessis commented 10 years ago

The way QUESO handles distributions is not extremely practical and not standard throughout the library. It certainly should be remanufactured, with a kind of wrapper around gsl or boost distributions. I'll be happy to do it if there is a consensus on how things should look. I was thinking along the lines of Antioch's kinetics models, with a class for each distribution that can handle boost or gsl (template, overload, other? I favor template, but there's no constrain) that derives from a base class. The RV vector can then load the required distribution using pointer and static_cast.

This is still an early stage of though, any idea is much welcome.

RhysU commented 10 years ago

I'd personally follow Boost's lead as much as possible since that more or less hit as standard in C++11.

pbauman commented 10 years ago

@SylvainPlessis, I don't understand what you mean by "handles distributions". Please clarify.

SylvainPlessis commented 10 years ago

I might have been a little bit too vague on that :)

I mostly mean the way QUESO deals with sampling and calculating a pdf value, (_Gsl/TeuchosVector::cwSetdistribution() and distributionJointPdf::actualValue()_), I don't know for the moments or the cdf, I have not looked at them.

The classes GslVector and TeuchosVector are the ones actually doing the sampling. For instance, a uniform distribution is sampled by Gsl/TeuchosVector::cwSetUniform(), not by a _Uniform_something__ class. The actualValue() method also differs, the GaussianJointPdf::actualValue() calculates it explicitely while the GammaJointPdf::actualValue() relies on either gsl or boost to do it.

So I'd be in favor of a rewriting of the sampling scheme, letting each distribution sample on its own and rely exclusively on gsl or boost to calculate anything (or at least comment and explain why the gsl/boost method is not used if it's done in QUESO).