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 sox() and sox_cv() to describe the relationship between the G overlapping groups. A G * G integer matrix whose (i,j) entry is 1 if and only if i\neq j and g_i is a child group (subset) of g_j, and is 0 otherwise.

own_variables

Required by sox() and sox_cv() to describe the relationship between the G overlapping groups and the p variables. The entries are the smallest variable indices in the groups (to achieve this, group is sorted. For any two groups i and j, if i is the parent group of j, then i is before j and vice versa, otherwise, the one with the smallest variable index is before the other.

N_own_variables

Required by sox() and sox_cv() to describe the relationship between the G overlapping groups and the p variables. An integer vector of length G indicating the number of variables that are in each group but not in any of its child groups.

group_weights

Required by sox() and sox_cv() to specify the group-specific penalty weights. The weight is generated in a way such that, the penalty weights of all the groups that contain a given variable sum to 1 for all variables.

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)
                

[Package sox version 1.1 Index]