Judging from the documentation boost seems to offer quantile functions (inverse cdf functions) for both normal and gamma distributions, but its not clear for me how can I actually use them. Could someone paste an example please?
The quantile calculation is implemented as a free function. Here's an example:
#include <boost/math/distributions/normal.hpp>
boost::math::normal dist(0.0, 1.0);
// 95% of distribution is below q:
double q = quantile(dist, 0.95);
You can also get the complement (quantile from the right) using:
// 95% of distribution is above qc:
double qc = quantile(complement(dist, 0.05));
There are some similar worked examples here:
Edit: don't need namespaces on the free functions thanks to ADL