5#ifndef STOCHTREE_ORDINAL_SAMPLER_H_
6#define STOCHTREE_ORDINAL_SAMPLER_H_
8#include <stochtree/data.h>
9#include <stochtree/ensemble.h>
10#include <stochtree/gamma_sampler.h>
11#include <stochtree/partition_tracker.h>
12#include <stochtree/tree.h>
19static double sample_truncated_exponential_low_high(
double u,
double rate,
double low,
double high) {
23static double sample_truncated_exponential_low(
double u,
double rate,
double low) {
24 return -std::log((1 -
u) * std::exp(-
rate *
low)) /
rate;
27static double sample_truncated_exponential_high(
double u,
double rate,
double high) {
31static double sample_exponential(
double u,
double rate) {
32 return -std::log1p(-
u) /
rate;
API for loading and accessing data used to sample tree ensembles The covariates / bases / weights use...
Definition data.h:272
Definition gamma_sampler.h:10
Sampler for ordinal model hyperparameters.
Definition ordinal_sampler.h:43
void UpdateCumulativeExpSums(ForestDataset &dataset)
Update cumulative exponential sums (seg)
void UpdateLatentVariables(ForestDataset &dataset, Eigen::VectorXd &outcome, std::mt19937 &gen)
Update truncated exponential latent variables (Z)
static double SampleTruncatedExponential(std::mt19937 &gen, double rate, double low=0.0, double high=1.0)
Sample from truncated exponential distribution.
void UpdateGammaParams(ForestDataset &dataset, Eigen::VectorXd &outcome, double alpha_gamma, double beta_gamma, double gamma_0, std::mt19937 &gen)
Update gamma cutpoint parameters.
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