group_sparsity function

Group Sparsity Constraint

Group Sparsity Constraint

Constraint which restricts the number of covariates selected from a specific group.

group_sparsity(vars, k = 1L)

Arguments

  • vars: a vector specifying the indices or names of the covariates to which the group constraint shall be applied.
  • k: an integer giving the maximum number of covariates to be included in the model from the specified group.

Returns

A holistic generalized model constraint, object inheriting from class "hglmc".

Examples

dat <- rhglm(100, c(1, 2, 0, 4, 5, 0)) constraints <- group_sparsity(c("x1", "x2", "x5"), 1L) hglm(y ~ ., constraints = constraints, data = dat)

See Also

Other Constraint-Constructors: group_equal(), group_inout(), include(), k_max(), linear(), lower(), pairwise_sign_coherence(), rho_max(), sign_coherence(), upper()

  • Maintainer: Benjamin Schwendinger
  • License: GPL-3
  • Last published: 2024-12-20

Useful links