Given output from a Bayesian model and a candidate of
subsets, compute the *acceptable family* of subsets that
match or nearly match the predictive accuracy of the "best" subset.
The acceptable family may be computed for any set of covariate values
XX
; if XX = X
are the in-sample points, then
cross-validation is used to assess out-of-sample predictive performance.
Usage
accept_family(
post_y_pred,
post_lpd = NULL,
XX,
yy = NULL,
indicators,
eps_level = 0.05,
eta_level = 0,
post_y_hat = NULL,
K = 10,
sir_frac = 0.5,
plot = TRUE
)
Arguments
- post_y_pred
S x n
matrix of posterior predictive draws at the givenXX
covariate values- post_lpd
S
evaluations of the log-likelihood computed at each posterior draw of the parameters (optional)- XX
n x p
matrix of covariates at which to evaluate- yy
n
-dimensional vector of response variables (optional)- indicators
L x p
matrix of inclusion indicators (booleans) where each row denotes a candidate subset- eps_level
probability required to match the predictive performance of the "best" model (up to
eta_level
)- eta_level
allowable margin ( and the "best" model
- post_y_hat
S x n
matrix of posterior fitted values at the givenXX
covariate values (optional)- K
number of cross-validation folds (optional)
- sir_frac
fraction of the posterior samples to use for SIR (optional)
- plot
logical; if TRUE, include a plot to summarize the predictive performance across candidate subsets
Value
a list containing the following elements:
all_accept
: indices (i.e., rows ofindicators
) that correspond to the acceptable subsetsbeta_hat_small
linear coefficients for the smallest acceptable modelbeta_hat_min
linear coefficients for the "best" acceptable modelell_small
: index (i.e., row ofindicators
) of the smallest acceptable modelell_min
: index (i.e., row ofindicators
) of the "best" acceptable model
Details
When XX = X
is the observed covariate values,
then post_lpd
and yy
must be provided. These
are used to compute the cross-validated predictive and empirical
squared errors; the predictive version relies on a sampling importance-resampling
procedure.
When XX
corresponds to a new set of covariate values, then set post_lpd = NULL
and yy = NULL
(these are the default values).
Additional details on the predictive and empirical comparisons are
in pp_loss
and pp_loss_out
.