group_sparsity {holiglm}R Documentation

Group Sparsity Constraint

Description

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

Usage

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.

Value

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

See Also

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

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)

[Package holiglm version 1.0.0 Index]