nested_structure {sox} | R Documentation |
Automatically generate objects used to describe the structure of the nested group lasso penalty.
Description
Automatically generate objects used to describe the structure of the nested group lasso penalty. The output is then used by sox()
and sox_cv()
.
Usage
nested_structure(group_list)
Arguments
group_list |
A list containing the indices of the group members. |
Value
A list of objects describing the group structure.
groups |
Required by |
own_variables |
Required by |
N_own_variables |
Required by |
group_weights |
Required by |
Examples
# p = 9 Variables:
## 1: A1
## 2: A2
## 3: C1
## 4: C2
## 5: B
## 6: A1B
## 7: A2B
## 8: C1B
## 9: C2B
# G = 12 Nested groups (misspecified, for the demonstration of the software only.)
## g1: A1, A2, C1, C2, B, A1B, A2B, C1B, C2B
## g2: A1B, A2B, A1B, A2B
## g3: C1, C2, C1B, C2B
## g4: 1
## g5: 2
## ...
## G12: 9
nested.groups <- list(1:9,
c(1, 2, 6, 7),
c(3, 4, 8, 9),
1, 2, 3, 4, 5, 6, 7, 8, 9)
pars.nested <- nested_structure(nested.groups)
str(pars.nested)