Description Usage Arguments Details Value See Also
View source: R/lassoGaussian.R
lassoGaussian
runs cross-validated regularized regressions for a single species
and returns important coefficients
1 2 3 4 | lassoGaussian(response, covariates, cutoff, n_reps)
lassoAbund_comm(outcome_data, binary_data, outcome_indices, covariates,
cutoff, n_reps, n_cores)
|
response |
A |
covariates |
A |
cutoff |
Positive numeric value representing the proportion of models in which
a predictor must be retained in order to be treated as meaningful. If the predictor is
retained in fewer than |
n_reps |
Positive |
outcome_data |
A |
binary_data |
A |
outcome_indices |
A sequence of positive integers representing the column indices in
|
n_cores |
Positive integer stating the number of processing cores to split the job across.
Default is |
Regularized regressions are performed to identify meaningful predictors of
the species' scaled abundance using cv.glmnet
. These models
use coordinated gradient descent, applied to training sets of the data, to identify
regression parameters. These parameters are predicted on the remaining subset of the data
(the test set) to assess model fit. The process is repeated until a best-fitting model
is identified (minimising the loss function, which is cross-validated deviance in this case).
By replicating the process n_reps
times, we account for uncertainty in the fold
generating process and can more confidently identify meaningful predictors (i.e. those that
are retained in at least cutoff
proportion of n_reps
models)
lassoGaussian
returns a single vector
of coefficients for
predictors in covariates
.
lassoAbund_comm
binds these coefficient vectors into a
dataframe
with rownames matching species names in outcome_data
. It then
returns a list
containing coefficients and scaling factors, which are used
in predictive functions
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.