computeRho: Compute posterior predictive distribution of 'rho.lambda'

Description Usage Arguments Value Note

View source: R/variable_selection_functions.R

Description

Using the (group) lasso solution path, compute the proportion of variability explained by the sparsified models (relative to the full model) for each MCMC simulation.

Usage

1
computeRho(beta_path, XX, post_beta, post_trace_sigma_2)

Arguments

beta_path

M x P x L array of regression coefficients beta along the solution path of length L

XX

N x P matrix of predictors

post_beta

Nsims x P x M array of posterior draws of beta

post_trace_sigma_2

Nsims x 1 vector of posterior draws of the trace of the (marginal) covariance (see below for details)

Value

A list containing rho_lam0 and rho_lam2, corrosponding to rho2 for the full model and the sparsified model (for each value of lambda in the solution path).

Note

post_trace_sigma_2 is the (posterior samples of) the trace of the error covariance matrix jointly across subjects i=1,...,n and observations j=1,...,m, after marginalizing out the random effects gamma_ik. This is given by nm x sigma_e^2 + sum_ik sigma_gamma_ik^2, where the second term is necessary only when random effects are included in the model AND integrated over in the predictive distribution.


drkowal/dfosr documentation built on May 7, 2020, 3:09 p.m.