StochTree 0.3.1
Loading...
Searching...
No Matches
gamma_sampler.h
1
2#ifndef STOCHTREE_GAMMA_SAMPLER_H_
3#define STOCHTREE_GAMMA_SAMPLER_H_
4
5#include <stochtree/distributions.h>
6#include <random>
7
8namespace StochTree {
9
11 public:
12 GammaSampler() {}
13 ~GammaSampler() {}
14 double Sample(double a, double b, std::mt19937& gen, bool rate_param = true) {
15 double scale = rate_param ? 1./b : b;
16 return sample_gamma(gen, a, scale);
17 }
18};
19
20} // namespace StochTree
21
22#endif // STOCHTREE_GAMMA_SAMPLER_H_
Definition gamma_sampler.h:10
A collection of random number generation utilities.
Definition category_tracker.h:36
double sample_gamma(std::mt19937 &gen, double shape, double scale)
Definition distributions.h:175