Description Usage Arguments Value Author(s) Examples
Multi-Step Adaptive SCAD-Net
1 2 3 4 5 6 7 | msasnet(x, y, family = c("gaussian", "binomial", "poisson", "cox"),
init = c("snet", "ridge"), gammas = 3.7, 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)
|
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 threshhold to use in SCAD-net. |
max.iter |
Maximum number of iterations to use in SCAD-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 FALSE. To enable parallel tuning, load the
|
verbose |
Should we print out the estimation progress? |
List of model coefficients, ncvreg
model object,
and the optimal parameter set.
Nan Xiao <https://nanx.me>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | dat <- msaenet.sim.gaussian(
n = 150, p = 500, rho = 0.6,
coef = rep(1, 5), snr = 2, p.train = 0.7,
seed = 1001
)
msasnet.fit <- msasnet(
dat$x.tr, dat$y.tr,
alphas = seq(0.3, 0.9, 0.3),
nsteps = 3L, seed = 1003
)
print(msasnet.fit)
msaenet.nzv(msasnet.fit)
msaenet.fp(msasnet.fit, 1:5)
msaenet.tp(msasnet.fit, 1:5)
msasnet.pred <- predict(msasnet.fit, dat$x.te)
msaenet.rmse(dat$y.te, msasnet.pred)
plot(msasnet.fit)
|
Warning messages:
1: ncvreg() is intended for pathwise optimization, not for single values of lambda.
1. You are strongly encouraged to fit a path and extract the solution at the lambda value of interest, rather than use ncvreg() in this way.
2. In particular, if you are using the MCP or SCAD penalties, be aware that you greatly increase your risk of converging to an inferior local maximum if you do not fit an entire path.
3. You may wish to look at the ncvfit() function, which is intended for non-path (i.e., single-lambda) optimization and allows the user to supply initial values.
2: ncvreg() is intended for pathwise optimization, not for single values of lambda.
1. You are strongly encouraged to fit a path and extract the solution at the lambda value of interest, rather than use ncvreg() in this way.
2. In particular, if you are using the MCP or SCAD penalties, be aware that you greatly increase your risk of converging to an inferior local maximum if you do not fit an entire path.
3. You may wish to look at the ncvfit() function, which is intended for non-path (i.e., single-lambda) optimization and allows the user to supply initial values.
3: ncvreg() is intended for pathwise optimization, not for single values of lambda.
1. You are strongly encouraged to fit a path and extract the solution at the lambda value of interest, rather than use ncvreg() in this way.
2. In particular, if you are using the MCP or SCAD penalties, be aware that you greatly increase your risk of converging to an inferior local maximum if you do not fit an entire path.
3. You may wish to look at the ncvfit() function, which is intended for non-path (i.e., single-lambda) optimization and allows the user to supply initial values.
4: ncvreg() is intended for pathwise optimization, not for single values of lambda.
1. You are strongly encouraged to fit a path and extract the solution at the lambda value of interest, rather than use ncvreg() in this way.
2. In particular, if you are using the MCP or SCAD penalties, be aware that you greatly increase your risk of converging to an inferior local maximum if you do not fit an entire path.
3. You may wish to look at the ncvfit() function, which is intended for non-path (i.e., single-lambda) optimization and allows the user to supply initial values.
Call: msasnet(x = dat$x.tr, y = dat$y.tr, alphas = seq(0.3, 0.9, 0.3),
nsteps = 3L, seed = 1003)
Df Lambda Gamma Alpha
1 2 0.4417076 3.7 0.9
[1] 2 4
[1] 0
[1] 2
[1] 2.724263
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.