family.grpnet: Prepare 'family' Argument for grpnet

View source: R/family.grpnet.R

family.grpnetR Documentation

Prepare 'family' Argument for grpnet

Description

Takes in the family argument from grpnet and returns a list containing the information needed for fitting and/or tuning the model.

Usage

family.grpnet(object, theta = 1)

Arguments

object

two options: (1) an object of class "grpnet" or "cv.grpnet"; or (2) a character specifying the exponential family: "gaussian", "multigaussian", "svm1", "svm2", "logit", "binomial", "multinomial", "poisson", "negative.binomial", "Gamma", "inverse.gaussian"

theta

positive scalar that serves as an additional hyperparameter for various loss functions.

svm1: additional parameter that controls the smoothing rate for the hinge loss function (see Note below).

negative.binomial: size parameter such that the variance function is defined as V(\mu) = \mu + \mu^2/ \theta

Details

There is only one available link function for each family:
* gaussian (identity): \mu = \mathbf{X}^\top \boldsymbol\beta
* multigaussian (identity): \mu = \mathbf{X}^\top \boldsymbol\beta
* svm1/svm2 (identity): \mu = \mathbf{X}^\top \boldsymbol\beta
* binomial/logit (logit): \log(\frac{\pi}{1 - \pi}) = \mathbf{X}^\top \boldsymbol\beta
* multinomial (symmetric): \pi_\ell = \frac{\exp(\mathbf{X}^\top \boldsymbol\beta_\ell)}{\sum_{l = 1}^m \exp(\mathbf{X}^\top \boldsymbol\beta_l)}
* poisson (log): \log(\mu) = \mathbf{X}^\top \boldsymbol\beta
* negative.binomial (log): \log(\mu) = \mathbf{X}^\top \boldsymbol\beta
* Gamma (log): \log(\mu) = \mathbf{X}^\top \boldsymbol\beta
* inverse.gaussian (log): \log(\mu) = \mathbf{X}^\top \boldsymbol\beta

Value

List with components:

family

same as input object, i.e., character specifying the family

linkinv

function for computing inverse of link function

dev.resids

function for computing deviance residuals

Note

For gaussian family, this returns the full output produced by gaussian.

For svm1 family, the quadratically smoothed hinge loss is defined as

\mathrm{svm1}(z) = \left\{ \begin{array}{ll} 0 & z > 1 \\ (1 - z)^2 / (2 \theta) & 1 - \theta < z \leq 1 \\ 1 - z - \theta / 2 & z \leq 1 - \theta \\ \end{array} \right.

where z = Y \eta with Y \in \{-1,1\} denoting the response and \eta = \mathbf{X}^\top \boldsymbol\beta denoting the linear predictor. Note that the svm1 loss function approaches the support vector machine (i.e., hinge) loss function as \theta \rightarrow 0.

For svm2 family, the squared hinge loss is defined as

\mathrm{svm2}(z) = \left\{ \begin{array}{ll} 0 & z > 1 \\ (1 - z)^2 & z \leq 1 \\ \end{array} \right.

where z = Y \eta with Y \in \{-1,1\} denoting the response and \eta = \mathbf{X}^\top \boldsymbol\beta denoting the linear predictor. Note that the svm1 loss function approaches the support vector machine (i.e., hinge) loss function as \theta \rightarrow 0.

Author(s)

Nathaniel E. Helwig <helwig@umn.edu>

References

Helwig, N. E. (2025). Versatile descent algorithms for group regularization and variable selection in generalized linear models. Journal of Computational and Graphical Statistics, 34(1), 239-252. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/10618600.2024.2362232")}

See Also

visualize.loss for plotting loss functions

grpnet for fitting group elastic net regularization paths

cv.grpnet for k-fold cross-validation of lambda

Examples

family.grpnet("gaussian")

family.grpnet("multigaussian")

family.grpnet("svm1", theta = 0.1)

family.grpnet("svm2")

family.grpnet("logit")

family.grpnet("binomial")

family.grpnet("multinomial")

family.grpnet("poisson")

family.grpnet("negative.binomial", theta = 10)

family.grpnet("Gamma")

family.grpnet("inverse.gaussian")

grpnet documentation built on June 10, 2025, 5:13 p.m.

Related to family.grpnet in grpnet...