Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/rags2ridgesFused.R
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.
1 2 3  default.penalty(G, df,
type = c("Complete", "CartesianEqual",
"CartesianUnequal", "TensorProd"))

G 
A 
df 
A 
type 
A character giving the type of fused penalty graph to construct.
Should be 
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.
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
.
Anders E. Bilgrau, Carel F.W. Peeters <[email protected]>, Wessel N. van Wieringen
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 HighDimensional 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 oneway 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")

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.