Projected predictive distribution for regression coefficients in the random intercept model
Source:R/source_subsel.R
proj_posterior_randint.RdGiven 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 nmatrix of posterior predictive draws at the givenXXcovariate values- XX
n x pmatrix of covariates- sub_x
vector of inclusion indicators for the
pcovariates; 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)