powered by
Constraint which restricts the number of covariates selected from a specific group.
group_sparsity(vars, k = 1L)
A holistic generalized model constraint, object inheriting from class "hglmc".
"hglmc"
a vector specifying the indices or names of the covariates to which the group constraint shall be applied.
an integer giving the maximum number of covariates to be included in the model from the specified group.
Other Constraint-Constructors: group_equal(), group_inout(), include(), k_max(), linear(), lower(), pairwise_sign_coherence(), rho_max(), sign_coherence(), upper()
group_equal()
group_inout()
include()
k_max()
linear()
lower()
pairwise_sign_coherence()
rho_max()
sign_coherence()
upper()
dat <- rhglm(100, c(1, 2, 0, 4, 5, 0)) constraints <- group_sparsity(c("x1", "x2", "x5"), 1L) hglm(y ~ ., constraints = constraints, data = dat)
Run the code above in your browser using DataLab