ssnet_fit | R Documentation |
Fit the Spike-and-Slab Elastic Net GLM with Intrinsic Autoregressive Prior
ssnet_fit(
x,
y,
family = c("gaussian", "binomial", "multinomial", "poisson", "cox"),
offset = NULL,
epsilon = 1e-04,
alpha = 0.95,
type.multinomial = "grouped",
maxit = 50,
init = rep(0, ncol(x)),
init.theta = 0.5,
ss = c(0.04, 0.5),
Warning = FALSE,
group = NULL,
iar.prior = FALSE,
adjmat = NULL,
iar.data = NULL,
tau.prior = "none",
tau.manual = NULL,
stan_manual = NULL,
opt.algorithm = "LBFGS",
p.bound = c(0.01, 0.99),
plot.pj = FALSE,
im.res = NULL,
print.iter = FALSE
)
x |
Design, or input, matrix, of dimension nobs x nvars; each row is
an observation vector. It is recommended that |
y |
Scalar response variable. Quantitative for
|
family |
Response type (see above). |
offset |
A vector of length |
epsilon |
A positive convergence tolerance; the iterations converge
when |
alpha |
A scalar value between 0 and 1 determining the compromise
between the Ridge and Lasso models. When |
type.multinomial |
If |
maxit |
An integer giving the maximal number of EM iterations. |
init |
A vector of initial values for all coefficients (not for
intercept). If not given, it will be internally produced. If
|
init.theta |
A single value between 0 and 1 to initialize inclusion probabilities. When parameter groups is 2 or more, can be a vector of initial values for parameter inclusion probabilities. Default is 0.5 for all parameters. Currently, it is not supported to have parameter-specific initializations for inclusion probabilities. This may change in forthcoming updates. |
ss |
A vector of two positive scale values for the spike-and-slab mixture double-exponential prior, allowing for different scales for different predictors, leading to different amount of shrinkage. Smaller scale values give stronger shrinkage. While the smaller of the two input values will be treated as the spike scale, it is recommended to specify the spike scale as the first element of the vector. |
Warning |
Logical. If |
group |
A numeric vector, or an integer, or a list indicating the
groups of predictors. If |
iar.prior |
Logical. When |
adjmat |
A data.frame or matrix containing a "sparse" representation of the neighbor relationships. The first column should contain a numerical index for a given location. Each index will be repeated in this column for every neighbor it has. The indices for the location's neighbors are then specified in the second column. Any additional columns are ignored. |
iar.data |
A list of output from |
tau.prior |
One of |
tau.manual |
When |
stan_manual |
A |
opt.algorithm |
One of |
p.bound |
A vector defining the lower and upper boundaries for the
probabilities of inclusion in the model, respectively. Defaults to
|
plot.pj |
When |
im.res |
A 2-element vector where the first argument is the number of
"rows" and the second argument is the number of "columns" in each subject's
"image". Default is |
print.iter |
Logical. When |
The fitted model for the spike-and-slab elastic net. An object of
class c("elnet", "glmnet"
.
Currently, the ssnet()
im.res
can only handle 2D data.
Future versions may allow images to be 3D. However, the function will work
given any appropriately specified neighborhood matrix, whatever the
original dimension. Use Cox models with caution as we have not yet
validated their extension.
While the type.multinomial option is included, it is only valid for traditional elastic net models. Thus far we have only extended the spike-and-slab models for grouped selection.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.