5#ifndef STOCHTREE_REGRESSION_H_
6#define STOCHTREE_REGRESSION_H_
9#include <stochtree/distributions.h>
10#include <stochtree/normal_sampler.h>
30 for (
int i = 0;
i < n;
i++) {
63 for (
int i = 0;
i < n;
i++) {
109 for (
int i = 0;
i < n;
i++) {
147 Eigen::MatrixXd
XtX =
X.transpose() *
X;
148 Eigen::VectorXd
Xty =
X.transpose() *
y;
153 Eigen::MatrixXd
L =
chol.matrixL();
154 Eigen::VectorXd
z(p);
155 for (
int i = 0;
i < p;
i++) {
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
static double sample_univariate_gaussian_regression_coefficient(double *y, double *x, double error_variance, double prior_variance, int n, std::mt19937 &gen)
Sample a regression coefficient from the posterior distribution of a univariate Gaussian regression m...
Definition linear_regression.h:27
double sample_standard_normal(double mean, double sd, std::mt19937 &gen)
Definition distributions.h:94
static void sample_general_bivariate_gaussian_regression_coefficients(double *output, double *y, double *x1, double *x2, double error_variance, double prior_variance_11, double prior_variance_12, double prior_variance_22, int n, std::mt19937 &gen)
Sample regression coefficients from the posterior distribution of a bivariate Gaussian regression mod...
Definition linear_regression.h:53
static Eigen::VectorXd sample_general_gaussian_regression_coefficients(const Eigen::Ref< const Eigen::VectorXd > &y, const Eigen::Ref< const Eigen::MatrixXd > &X, double error_variance, const Eigen::Ref< const Eigen::MatrixXd > &prior_variance, int n, std::mt19937 &gen)
Sample regression coefficients from the posterior distribution of a bivariate Gaussian regression mod...
Definition linear_regression.h:144
static void sample_diagonal_bivariate_gaussian_regression_coefficients(double *output, double *y, double *x1, double *x2, double error_variance, double prior_variance_11, double prior_variance_22, int n, std::mt19937 &gen)
Sample regression coefficients from the posterior distribution of a bivariate Gaussian regression mod...
Definition linear_regression.h:101