View source: R/nested_structure.R
nested_structure | R Documentation |
Automatically generate objects used to describe the structure of the nested group lasso penalty. The output is then used by sox()
and sox_cv()
.
nested_structure(group_list)
group_list |
A list containing the indices of the group members. |
A list of objects describing the group structure.
groups |
Required by |
own_variables |
Required by |
N_own_variables |
Required by |
group_weights |
Required by |
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.