GridLMMnet | R Documentation |
Finds LASSO or Elastic Net solutions for a multiple regression problem with correlated errors.
GridLMMnet(
formula,
data,
X,
X_ID = "ID",
weights = NULL,
centerX = TRUE,
scaleX = TRUE,
relmat = NULL,
normalize_relmat = TRUE,
h2_step = 0.1,
h2_start = NULL,
alpha = 1,
lambdaType = "s2e",
scoreType = "LL",
nlambda = 100,
lambda.min.ratio = ifelse(nobs < nvars, 0.01, 1e-04),
lambda = NULL,
penalty.factor = NULL,
nfolds = NULL,
foldid = NULL,
RE_setup = NULL,
V_setup = NULL,
save_V_folder = NULL,
diagonalize = T,
mc.cores = parallel::detectCores(),
clusterType = "mclapply",
verbose = T,
...
)
formula |
A two-sided linear formula as used in |
data |
A data frame containing the variables named in |
X |
Variables in model that well be penalized with the elastic net penalty. Covariates specified in |
X_ID |
Column of |
weights |
An optional vector of observation-specific weights. |
centerX |
TRUE/FALSE for each. Applied to the |
scaleX |
TRUE/FALSE for each. Applied to the |
relmat |
Either:
1) A list of matrices that are proportional to the (within) covariance structures of the group level effects.
2) A list of lists with elements ( |
normalize_relmat |
should ZKZt matrices be normalized so that mean(diag) == 1? Default (true) |
h2_step |
Step size of the grid |
h2_start |
Optional. Matrix with each row a vector of |
alpha |
The elasticnet mixing parameter, with
|
nlambda |
The number of |
lambda.min.ratio |
Smallest value for |
lambda |
A user supplied |
penalty.factor |
Separate penalty factors can be applied to each
coefficient. This is a number that multiplies |
foldid |
vector of integers that divide the data into a set of non-overlapping folds for cross-validation. |
V_setup |
Optional. A list produced by a GridLMM function containing the pre-processed V decompositions for each grid vertex, or the information necessary to create this. Generally saved from a previous run of GridLMM on the same data. |
save_V_folder |
Optional. A character vector giving a folder to save pre-processed V decomposition files for future / repeated use. If null, V decompositions are stored in memory |
diagonalize |
If TRUE and the model includes only a single random effect, the "GEMMA" trick will be used to diagonalize V. This is done by calculating the SVD of K, which can be slow for large samples. |
mc.cores |
Number of processor cores used for parallel evaluations. Note that this uses 'mclapply', so the memory requires grow rapidly with |
verbose |
Should progress be printed to the screen? |
... |
Finds the full LASSO or Elastic Net solution path by running glmnet
at each grid vertex.
If foldid
is provided, cross-validation scores will be calculated.
If foldid
and nfold
are null, an object with S3 class "glmnet","*" , where "*" is "elnet". See glmnet
.
Otherwise, an object with S3 class "cv.glmnet". See cv.glmnet
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.