msamnet {msaenet} | R Documentation |
Multi-Step Adaptive MCP-Net
Description
Multi-Step Adaptive MCP-Net
Usage
msamnet(
x,
y,
family = c("gaussian", "binomial", "poisson", "cox"),
init = c("mnet", "ridge"),
gammas = 3,
alphas = seq(0.05, 0.95, 0.05),
tune = c("cv", "ebic", "bic", "aic"),
nfolds = 5L,
ebic.gamma = 1,
nsteps = 2L,
tune.nsteps = c("max", "ebic", "bic", "aic"),
ebic.gamma.nsteps = 1,
scale = 1,
eps = 1e-04,
max.iter = 10000L,
penalty.factor.init = rep(1, ncol(x)),
seed = 1001,
parallel = FALSE,
verbose = FALSE
)
Arguments
x |
Data matrix. |
y |
Response vector if |
family |
Model family, can be |
init |
Type of the penalty used in the initial
estimation step. Can be |
gammas |
Vector of candidate |
alphas |
Vector of candidate |
tune |
Parameter tuning method for each estimation step.
Possible options are |
nfolds |
Fold numbers of cross-validation when |
ebic.gamma |
Parameter for Extended BIC penalizing
size of the model space when |
nsteps |
Maximum number of adaptive estimation steps.
At least |
tune.nsteps |
Optimal step number selection method
(aggregate the optimal model from the each step and compare).
Options include |
ebic.gamma.nsteps |
Parameter for Extended BIC penalizing
size of the model space when |
scale |
Scaling factor for adaptive weights:
|
eps |
Convergence threshold to use in MCP-net. |
max.iter |
Maximum number of iterations to use in MCP-net. |
penalty.factor.init |
The multiplicative factor for the penalty
applied to each coefficient in the initial estimation step. This is
useful for incorporating prior information about variable weights,
for example, emphasizing specific clinical variables. To make certain
variables more likely to be selected, assign a smaller value.
Default is |
seed |
Random seed for cross-validation fold division. |
parallel |
Logical. Enable parallel parameter tuning or not,
default is |
verbose |
Should we print out the estimation progress? |
Value
List of model coefficients, ncvreg
model object,
and the optimal parameter set.
Author(s)
Nan Xiao <https://nanx.me>
Examples
dat <- msaenet.sim.gaussian(
n = 150, p = 500, rho = 0.6,
coef = rep(1, 5), snr = 2, p.train = 0.7,
seed = 1001
)
msamnet.fit <- msamnet(
dat$x.tr, dat$y.tr,
alphas = seq(0.3, 0.9, 0.3),
nsteps = 3L, seed = 1003
)
print(msamnet.fit)
msaenet.nzv(msamnet.fit)
msaenet.fp(msamnet.fit, 1:5)
msaenet.tp(msamnet.fit, 1:5)
msamnet.pred <- predict(msamnet.fit, dat$x.te)
msaenet.rmse(dat$y.te, msamnet.pred)
plot(msamnet.fit)