Projected predictive distribution for regression coefficients
Source:R/source_subsel.R
proj_posterior.Rd
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 givenXX
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