This function trains linear logistic regression models with HMC in restricted Gibbs sampling.
It also makes predictions for test cases if X_ts
are provided.
htlr_fit( X_tr, y_tr, fsel = 1:ncol(X_tr), stdzx = TRUE, ptype = c("t", "ghs", "neg"), sigmab0 = 2000, alpha = 1, s = -10, eta = 0, iters_h = 1000, iters_rmc = 1000, thin = 1, leap_L = 50, leap_L_h = 5, leap_step = 0.3, hmc_sgmcut = 0.05, initial_state = "lasso", keep.warmup.hist = FALSE, silence = TRUE, rep.legacy = TRUE, alpha.rda = 0.2, lasso.lambda = seq(0.05, 0.01, by = -0.01), X_ts = NULL, predburn = NULL, predthin = 1 )
X_tr | Input matrix, of dimension nobs by nvars; each row is an observation vector. |
---|---|
y_tr | Vector of response variables. Must be coded as non-negative integers, e.g., 1,2,...,C for C classes, label 0 is also allowed. |
fsel | Subsets of features selected before fitting, such as by univariate screening. |
stdzx | Logical; if |
ptype | The prior to be applied to the model. Either "t" (student-t, default), "ghs" (horseshoe), or "neg" (normal-exponential-gamma). |
sigmab0 | The |
alpha | The degree freedom of t/ghs/neg prior for coefficients. |
s | The log scale of priors (logw) for coefficients. |
eta | The |
iters_h | A positive integer specifying the number of warmup (aka burnin). |
iters_rmc | A positive integer specifying the number of iterations after warmup. |
thin | A positive integer specifying the period for saving samples. |
leap_L | The length of leapfrog trajectory in sampling phase. |
leap_L_h | The length of leapfrog trajectory in burnin phase. |
leap_step | The stepsize adjustment multiplied to the second-order partial derivatives of log posterior. |
hmc_sgmcut | The coefficients smaller than this criteria will be fixed in each HMC updating step. |
initial_state | The initial state of Markov Chain; can be a previously
fitted
|
keep.warmup.hist | Warmup iterations are not recorded by default, set |
silence | Setting it to |
rep.legacy | Logical; if |
alpha.rda | A user supplied alpha value for |
lasso.lambda | - A user supplied lambda sequence for |
X_ts | Test data which predictions are to be made. |
predburn, predthin | For prediction base on |
A list of fitting results. If X_ts
is not provided, the list is an object
with S3 class htlr.fit
.
Longhai Li and Weixin Yao (2018). Fully Bayesian Logistic Regression with Hyper-Lasso Priors for High-dimensional Feature Selection. Journal of Statistical Computation and Simulation 2018, 88:14, 2827-2851.