Computes a sequence of minimizers (one for each lambda given in the lambda
argument) of
$$\mathrm{loss}(\beta) + \lambda \left( (1-\alpha) \sum_{J=1}^m \gamma_J \|\beta^{(J)}\|_2 + \alpha \sum_{i=1}^{n} \xi_i |\beta_i| \right)$$
where \(\mathrm{loss}\) is the loss/objective function specified by module_name
.
The parameters are organized in the parameter matrix \(\beta\) with dimension \(q\times p\).
The vector \(\beta^{(J)}\) denotes the \(J\) parameter group.
The group weights \(\gamma \in [0,\infty)^m\) and the parameter weights \(\xi = (\xi^{(1)},\dots, \xi^{(m)}) \in [0,\infty)^n\)
with \(\xi^{(1)}\in [0,\infty)^{n_1},\dots, \xi^{(m)} \in [0,\infty)^{n_m}\).
sgl_fit(module_name, PACKAGE, data, parameterGrouping = NULL,
groupWeights = NULL, parameterWeights = NULL, alpha, lambda,
d = 100, compute_lambda = length(lambda) == 1,
return_indices = NULL, algorithm.config = sgl.standard.config)
reference to objective specific C++ routines.
name of the calling package.
a list of data objects -- will be parsed to the specified module.
grouping of parameters, a vector of length \(p\). Each element of the vector specifying the group of the parameters in the corresponding column of \(\beta\).
the group weights, a vector of length length(unique(parameterGrouping))
(the number of groups).
a matrix of size \(q \times p\).
the \(\alpha\) value 0 for group lasso, 1 for lasso, between 0 and 1 gives a sparse group lasso penalty.
lambda.min relative to lambda.max (if compute_lambda = TRUE
) or the lambda sequence for the regularization path, a vector or a list of vectors (of the same length) with the lambda sequence for the subsamples.
length of lambda sequence (ignored if compute_lambda = FALSE
)
should the lambda sequence be computed
the indices of lambda values for which to return fitted parameters.
the algorithm configuration to be used.
the response, that is the y
object in data as created by create.sgldata
.
the fitted parameters -- a list of length length(return)
with each entry a matrix of size \(q\times (p+1)\) holding the fitted parameters.
the values of the loss function.
the values of the objective function (i.e. loss + penalty).
the lambda values used.