StochTree 0.5.0.9000
Loading...
Searching...
No Matches
probit.h
1
5#ifndef STOCHTREE_PROBIT_H_
6#define STOCHTREE_PROBIT_H_
7
8#include <stochtree/distributions.h>
9
10namespace StochTree {
11
12static void sample_probit_latent_outcome(std::mt19937& gen, double* outcome, double* conditional_mean, double* partial_residual, double y_bar, int n) {
13 double uniform_draw_std;
14 double uniform_draw_trunc;
15 double quantile;
16 double cond_mean;
17 double latent_outcome;
18 for (int i = 0; i < n; i++) {
19 cond_mean = conditional_mean[i] + y_bar;
22 if (outcome[i] == 1.0) {
25 } else {
28 }
30 }
31}
32
33} // namespace StochTree
34
35#endif // STOCHTREE_PROBIT_H_
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 norm_cdf(double x)
Definition distributions.h:19
double standard_uniform_draw_53bit(std::mt19937 &gen)
Definition distributions.h:37
double norm_inv_cdf(double p)
Definition distributions.h:26