Projected predictive distribution for regression coefficients in the random intercept model
Source:R/source_subsel.R
proj_posterior_randint.Rd
Given draws from the predictive distribution of the random intercept model, project these draws onto (a subset of) the covariates using Mahalanobis loss. This produces many predictive draws for the regression coefficients, which provides uncertainty quantification.
Usage
proj_posterior_randint(
post_y_pred,
XX,
sub_x = 1:ncol(XX),
post_sigma_e,
post_sigma_u,
post_y_pred_sum = NULL
)
Arguments
- post_y_pred
S x m 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- post_sigma_e
(
nsave
) draws from the posterior distribution of the observation error SD- post_sigma_u
(
nsave
) draws from the posterior distribution of the random intercept SD- post_y_pred_sum
(
nsave x n
) matrix of the posterior predictive draws summed over the replicates within each subject (optional)