id summary reporter owner description type status milestone component version severity resolution keywords cc 3888 Generation of two-parameter Gamma variates Marco Guazzone No-Maintainer "Actually, the code used to generate random Gamma variates cannot be used to generate variates for two-parameters Gamma distributions, that is for Gamma distributions with both shape and scale parameters (e.g., see [http://en.wikipedia.org/wiki/Gamma_distribution] or [http://www.itl.nist.gov/div898/handbook/eda/section3/eda366b.htm]). In principle this should be possible by means of the ''scaling property'': '''Gamma(shape,scale) ~ scale*Gamma(shape,1)''' This would simply translate into {{{ boost::mt19937 rng; boost::gamma_distribution<> gamma(shape); // 1-parameter Gamma distribution boost::variate_generator< boost::mt19937&, boost::gamma_distribution<> > rvg(rng, gamma); double r = scale*rvg(); }}} However, when ''shape == 1'' the implementation uses the fact that '''Gamma(1) ~ Exp(1)'''. This is rigth when ''scale==1'' but not when ''scale != 1'' since the exact relation is '''Gamma(1,scale) ~ Exp(1/scale)''' " Bugs closed Boost 1.42.0 random Boost 1.41.0 Problem fixed