default.penalty: Construct commonly used penalty matrices In CFWP/rags2ridges: Ridge Estimation of Precision Matrices from High-Dimensional Data

Description

Function that constructs default or commonly use penalty matrices according to a (factorial) study design. The constructed penalty matrix can be used directly in `optPenalty.fused.auto` or serve as basis for modification.

Usage

 ```1 2 3``` ``` default.penalty(G, df, type = c("Complete", "CartesianEqual", "CartesianUnequal", "TensorProd")) ```

Arguments

 `G` A `numeric` giving the number of classes. Can also be a `list` of length `G` such as the usual argument `Slist` from other rags2ridges functions. Can be omitted if `df` is given. `df` A `data.frame` with `G` rows and factors in the columns. Note, the columns has to be of type `factor`. Can be omitted when `G` is given and `type == "Complete"`. The factors can be ordered. `type` A character giving the type of fused penalty graph to construct. Should be `'Complete'` (default), `'CartesianEqual'`, or `'CartesianUnequal'` or `'TensorProd'` or an unique abbreviation hereof. See details.

Details

The `type` gives a number of common choices for the penalty matrix:

• `'Complete'` is the complete penalty graph with equal penalties.

• `'CartesianEqual'` corresponds to a penalizing along each "direction" of factors with a common penalty. The choice is named Cartesian as it is the Cartesian graph product of the complete penalty graphs for the individual factors.

• `'CartesianUnequal'` corresponds to a penalizing each direction of factors with individual penalties.

• `'TensorProd'` correspond to penalizing the "diagonals" only. It is equivalent to the graph tensor products of the complete graphs for each individual factor.

Value

Returns a `G` by `G` character matrix which specify the class of penalty graphs to be used. The output is suitable as input for the penalty matrix used in `optPenalty.fused.auto`.

Author(s)

Anders E. Bilgrau, Carel F.W. Peeters <[email protected]>, Wessel N. van Wieringen

References

Bilgrau, A.E., Peeters, C.F.W., Eriksen, P.S., Boegsted, M., and van Wieringen, W.N. (2015). Targeted Fused Ridge Estimation of Inverse Covariance Matrices from Multiple High-Dimensional Data Classes, arXiv:1509.07982v1 [stat.ME].

`ridgeP.fused`, `optPenalty.fused`, `default.target`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24``` ``` # Handling one-way designs default.penalty(2) default.penalty(4) Slist <- vector("list", 6) default.penalty(Slist) # The function uses only the length of the list df0 <- expand.grid(Factor = c("lvl1", "lvl2")) default.penalty(df0) # A more elaborate example df1 <- expand.grid(DS = c("DS1", "DS2", "DS3"), ER = c("ER+", "ER-")) # Usage (various interface demonstrations) default.penalty(6, df1, type = "Complete") default.penalty(6, type = "CartesianEqual") # GIVES WARNING default.penalty(6, df1, type = "CartesianEqual") default.penalty(Slist, df1, type = "CartesianEqual") default.penalty(6, df1, type = "CartesianUnequal") default.penalty(df1) # A 2 by 2 by 2 design df2 <- expand.grid(A = c("A1", "A2"), B = c("B1", "B2"), C = c("C1", "C3")) default.penalty(df2) default.penalty(df2, type = "CartesianEqual") default.penalty(df2, type = "CartesianUnequal") ```