Skip to contents

Given draws from the predictive distribution, project these draws onto (a subset of) the covariates. This produces many predictive draws for the regression coefficients, which provides uncertainty quantification.

Usage

proj_posterior(post_y_pred, XX, sub_x = 1:ncol(XX), use_ols = TRUE)

Arguments

post_y_pred

S x n matrix of posterior predictive draws at the given XX covariate values

XX

n x p matrix of covariates

sub_x

vector of inclusion indicators for the p covariates; the remaining coefficients will be fixed at zero

use_ols

logical; if TRUE, use ordinary least squares regression (default); otherwise use logistic regression

Value

post_beta: the S x p matrix of draws from the projected predictive distribution of the regression coefficients.