Variable Selection Using Shrinkage Priors

Select variables from shrinkage-prior posterior coefficient draws using sequential two-means clustering from Li and Pati (2017) . Estimate a signal count at each tuning threshold and rank coefficients by posterior median absolute magnitude. Accept supplied coefficient draws or fit Gaussian shrinkage regression through 'bayesreg' or native ridge, horseshoe and spike-and-slab samplers. Retain chain identities for diagnostics, prediction and posterior plots. Also provide the signal adaptive variable selector of Ray and Bhattacharya (2018) , decoupled shrinkage and selection with the adaptive-L1 approximation of Hahn and Carvalho (2015) , optional exact two-cluster fitting, basic two-means selection, exact-zero spike-and-slab inclusion summaries and tuning sensitivity summaries.


VsusP

VsusP selects variables from Bayesian shrinkage-regression draws. Sequential two-means (S2M), from Li and Pati (2017), estimates a signal count and selects coefficients by their posterior median absolute magnitude. The package also provides Gaussian fitting, posterior summaries, prediction and diagnostic plots.

R-CMD-check Test coverage checks

Installation

CRAN release:

install.packages("VsusP")

The examples below use the GitHub version:

install.packages("remotes") # Run once if needed.
remotes::install_github("nilson01/VsusP-variable-selection-using-shrinkage-priors")
library(VsusP)

Select variables from posterior draws

Put draws in rows and coefficients in columns; exclude the intercept.

Beta <- rbind(c(.01, .02, .03, .3, .31, 10, 11),
              c(-.01, -.02, -.03, -.3, -.31, -10, -11))
colnames(Beta) <- paste0("x", seq_len(ncol(Beta)))
set.seed(1)
path <- Sequential2MeansBeta(Beta, lower = .1, upper = .5, l = 2)
path$H.b.i
#> [1] 4 2
OptimalHbi(path$b.i, path$H.b.i)

selected <- S2MVarSelection(Beta, H = path$H.b.i[2])
colnames(Beta)[selected]
#> [1] "x7" "x6"

Here the second threshold is used for illustration. OptimalHbi() plots the counts; it does not choose a threshold. Inspect sensitivity to the threshold, predictor units and posterior sampling before interpreting a selection.

Fit and predict

X <- cbind(x1 = c(-2, -1, 0, 1, 2, 0), x2 = c(0, 1, -1, 0, 1, -1))
y <- c(-3, -1, 0, 1, 3, .5)
fit <- FitRidge(X, y, draws = 1000, chains = 2, seed = 8)
summary(fit)
predict(fit, X[1:2, , drop = FALSE])
PlotCoefficients(fit)

Posterior coefficient means and 95% equal-tail intervals

predict() gives pointwise intervals for the conditional mean. Set include.noise = TRUE to obtain posterior predictive intervals for observations. PosteriorDraws(fit) pools chains for selection; the fitted object retains separate chains for diagnostics. See ?FitGaussian for priors and centering.

Methods

Purpose Functions
Fit Gaussian regression FitRidge(), FitHorseshoe(), FitSpikeSlab()
Fit through bayesreg and apply S2M Sequential2Means()
Summarize and predict summary(), coef(), predict(), PosteriorDraws()
Check and plot chains ChainDiagnostics(), PlotTrace(), PlotAutocorrelation()
Summarize exact-zero inclusions SpikeSlabSelection(), PlotInclusion()
Compare selection thresholds S2MSensitivity(), plot()
Apply basic two-means selection TwoMeansBeta()
Construct a sparse predictor SAVS(), DSS()

ChainDiagnostics() requires the suggested posterior package. Native fits center inputs without scaling them; their priors differ from bayesreg defaults. Check chain diagnostics and sampling sensitivity for iterative fits. Short examples do not establish convergence.

By default, S2M retains at least one signal. SAVS and penalized DSS can return an empty selection. Clustering counts are not posterior inclusion probabilities; use exact-zero spike-and-slab draws for inclusion summaries. These methods do not provide automatic false-positive control. See the guide for boundary conventions, scaling effects and DSS tuning.

Documentation

References

Li, H. and Pati, D. (2017). Variable selection using shrinkage priors. Computational Statistics & Data Analysis, 107, 107–119. doi:10.1016/j.csda.2016.10.008.

Ray, P. and Bhattacharya, A. (2018). Signal Adaptive Variable Selector for the Horseshoe Prior. arXiv:1810.09004.

Hahn, P. R. and Carvalho, C. M. (2015). Decoupling Shrinkage and Selection in Bayesian Linear Models: A Posterior Summary Perspective. Journal of the American Statistical Association, 110(509), 435–448. doi:10.1080/01621459.2014.993077.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("VsusP")

1.1.0 by Nilson Chapagain, 2 days ago


https://github.com/nilson01/VsusP-variable-selection-using-shrinkage-priors


Report a bug at https://github.com/nilson01/VsusP-variable-selection-using-shrinkage-priors/issues


Browse source code at https://github.com/cran/VsusP


Authors: Nilson Chapagain [aut, cre] (ORCID: , Debdeep Pati [aut]


Documentation:   PDF Manual  


GPL (>= 3) license


Imports bayesreg, graphics, stats, utils

Suggests posterior, covr, MASS, knitr, rmarkdown, tinytex, testthat


See at CRAN