S2MVarSelection {VsusP}R Documentation

Variable selection using shrinkage priors :: S2MVarSelection

Description

S2MVarSelection function will take S2M: a list obtained from the 2Means.variables function and H: the estimated number of signals obtained from the optimal.H.b.i function. This will give out the important subset of variables for the Gaussian Linear model.

Usage

S2MVarSelection(Beta, H = 5)

Arguments

Beta

matrix consisting of N posterior samples of p variables that is known either to user or from Sequential2Means function

H

Estimated number of signals obtained from the optimal.b.i function of numeric data type

Value

a vector containing indices of important subset of variables of dimension H X 1.

References

Makalic, E. & Schmidt, D. F. High-Dimensional Bayesian Regularised Regression with the BayesReg Package arXiv:1611.06649, 2016

Li, H., & Pati, D. Variable selection using shrinkage priors Computational Statistics & Data Analysis, 107, 107-119.

Examples


n <- 10
p <- 5
X <- matrix(rnorm(n * p), n, p)
beta <- exp(rnorm(p))
Y <- as.vector(X %*% beta + rnorm(n, 0, 1))
df <- data.frame(X, Y)
# Fit a model using gaussian horseshoe+ for 200 samples
# # recommended n.samples is 5000 and burning is 2000
rv.hs <- bayesreg::bayesreg(Y ~ ., df, "gaussian", "horseshoe+", 110, 100)

Beta <- rv.hs$beta
H <- 3
impVariablesGLM <- S2MVarSelection(Beta, H)
impVariablesGLM


[Package VsusP version 1.0.0 Index]