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 nmatrix of posterior predictive draws at the givenXXcovariate values- post_lpd
Sevaluations of the log-likelihood computed at each posterior draw of the parameters (optional)- XX
n x pmatrix of covariates at which to evaluate- yy
n-dimensional vector of response variables (optional)- indicators
L x pmatrix 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 nmatrix of posterior fitted values at the givenXXcovariate 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_smalllinear coefficients for the smallest acceptable modelbeta_hat_minlinear 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.