StochTree 0.5.0.9000
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
static void GFRSampleOneIter(TreeEnsemble &active_forest, ForestTracker &tracker, ForestContainer &forests, LeafModel &leaf_model, ForestDataset &dataset, ColumnVector &residual, TreePrior &tree_prior, std::mt19937 &gen, std::vector< double > &variable_weights, std::vector< int > &sweep_update_indices, double global_variance, std::vector< FeatureType > &feature_types, int cutpoint_grid_size, bool keep_forest, bool pre_initialized, bool backfitting, int num_features_subsample, int num_threads, LeafSuffStatConstructorArgs &... leaf_suff_stat_args)
Definition tree_sampler.h:816
A collection of random number generation utilities.
Definition bart.h:15
double sample_gamma(std::mt19937 &gen, double shape, double scale)
Definition distributions.h:193