S5_additive {BayesS5} | R Documentation |
Simplified shotgun stochastic search algorithm with screening (S5) for additive models
Description
This is the Simplified Shotgun Stochastic Search with Screening (S5) for high-dimensonal Bayesian variable selection under nonparameteric additive models, which is considered in "Nonlocal Functional Priors for Nonparametric Hypothesis Testing and High-dimensional Model Selection" by Shin and Bhattacharya (2020+). This function utilizes the inverse moment nonlocal functional prior, and see Shin and Bhattacharya (2020+) for details.
Usage
S5_additive(X, y, K=5, model, tuning = 0.5*nrow(X), tem, ITER = 20, S = 30, C0 = 5,
verbose = TRUE)
Arguments
X |
the covariate matrix (a standardization is recommneded for nonlocal priors). |
y |
a response variable. |
K |
the degree of freedom for the B-spline basis |
model |
a model prior; Uniform or Bernoulli_Uniform. The default is Bernoulli_Uniform |
tuning |
a tuning parameter for the objective function (tau for the inverse moment prior). The default is 0.5*n. |
tem |
a temperature schedule. The default is seq(0.4,1,length.out=20)^-2. |
ITER |
the number of iterations in each temperature; default is 20. |
S |
a screening size of variables; default is 30. |
C0 |
a number of repetition of the S5 algorithm C0 times,default is 2. When the total number of variables is huge and real data sets are considered, using a large number of C0 is recommended, e.g., C0=5. |
verbose |
if TRUE, the function prints the currnet status of the S5 in each temperature; the default is TRUE. |
Details
Using the S5 (Shin et al., 2018), you will get all the models searched by S5 algorithm, and their corresponding log (unnormalized) posterior probabilities, and also this function can receive searched model for g-prior,piMoM,and peMoM.
Unlike "S5" function that requires an extra step to get more information of the computation procedure, this function provides full information of the results.
Value
GAM |
the binary vaiables of searched models by S5 |
OBJ |
the corresponding log (unnormalized) posterior probability |
phi |
the matrix of B-spline basis functions |
Knots |
the boundaries of knots used in generating the B-spline matrix |
K |
the degree of freedom of the B-spline basis. |
post |
the corresponding (normalized) posterior model probabilities |
marg.prob |
the marginal inclusion probabilities |
ind.MAP |
the selected variables from the MAP model |
ind.marg |
the selected variables whose marginal inclusion probability is larger than 0.5 |
hppm.prob |
the posterior probability of the MAP model |
tuning |
the tuning parameter used in the model selection |
Author(s)
Shin Minsuk and Ruoxuan Tian
References
Shin, M. and Bhattacharya, A.(2020) Nonlocal Functional Priors for Nonparametric Hypothesis Testing and High-dimensional Model Selection.
Shin, M., Bhattacharya, A., Johnson V. E. (2018) A Scalable Bayesian Variable Selection Using Nonlocal Prior Densities in Ultrahigh-dimensional Settings, under revision in Statistica Sinica.
See Also
Examples
p0 = 500
n0 = 200
X = matrix(runif(n0*p0,-2,2),n0,p0)
mu = X[,1]^2 + 2*sin(X[,2]*2) + 2*cos(X[,3]*2) + X[,4]
y = mu + rnorm(n0)
X = scale(X)
y = as.vector(y)
#fit_additive = S5_additive(X,y, tuning = 0.1*ncol(X))
#print(fit_additive$ind.hppm) # the MAP model
#print(fit_additive$hppm.prob) # the posterior probability of the hppm
#plot(fit_additive$marg.prob,ylim=c(0,1),ylab="marginal inclusion probability")
# the marginal inclusion probability