An auxilary function calculating the group attribution index for each predictor (or response) variable. It generates the required input PQ.grps matrix when calling the MSGlasso function.

Share:

Description

An auxilary function calculating the group attribution index for each predictor (or response) variable. It generates the required input PQ.grps matrix when calling the MSGlasso function.

Usage

1
FindingPQGrps(P, Q, G, R, gmax, G.Starts, G.Ends, R.Starts, R.Ends)

Arguments

P

a positive interger indicating number of predictor variables

Q

a positive interger indicating number of response variables

G

a positive interger indicating number of predictor groups

R

a positive interger indicating number of response groups

gmax

a positive interger indicating the max number of different groups a single variable (either a predictor or response variable) belongs to.

G.Starts

a vector of starting coordinates for the predictor groups.

G.Ends

a vector of ending coordinates for the predictor groups.

R.Starts

a vector of starting coordinates for the response groups.

R.Ends

a vector of ending coordinates for the response groups.

Details

Generates the required input PQgrps matrix when calling the main MSGlasso function, when user provide the starting and ending coordinates for each of the predictor and response groups. The PQgrps is a matrix of (p+q) by (gmax+1), with each row starting with group indicators that row variable belongs to, and followed by 999's till the row is filled.

Value

A list with one components:

PQgrps

the PQgrps matrix generated

Author(s)

Yanming Li, Bin Nan, Ji Zhu

References

Y. Li, B. Nan and J. Zhu (2015) Multivariate sparse group lasso for the multivariate multiple linear regression with an arbitrary group structure. Biometrics. DOI: 10.1111/biom.12292

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
###########################################################################
## generating the PQ.grps matrix for an overlapping group structure
###########################################################################

P <- 200
Q <- 200
G <- 10
R <- 10
gmax <- 1

GarrStarts <-c(0,20,40,60,80,100,120,140,160,180)
GarrEnds <-c(19,39,59,79,99,119,139,159,179,199)
RarrStarts <-c(0,20,40,60,80,100,120,140,160,180)
RarrEnds <-c(19,39,59,79,99,119,139,159,179,199)

tmp <- FindingPQGrps(P, Q, G, R, gmax, GarrStarts, GarrEnds, RarrStarts, RarrEnds)
PQ.grps <- tmp$PQgrps