Function that visualizes the regularization paths of the nonredundant elements of a regularized precision matrix against the (range of the) penalty parameter.
ridgePathS(
S,
lambdaMin,
lambdaMax,
step,
type = "Alt",
target = default.target(S),
plotType = "pcor",
diag = FALSE,
vertical = FALSE,
value,
verbose = TRUE
)Sample covariance matrix.
A numeric giving the minimum value for the penalty
parameter.
A numeric giving the maximum value for the penalty
parameter.
An integer determining the number of steps in moving
through the grid [lambdaMin, lambdaMax].
A character indicating the type of ridge estimator to be
used. Must be one of: "Alt", "ArchI", "ArchII".
A target matrix (in precision terms) for Type I ridge
estimators.
A character indicating the type of element for which
a visualization of the regularization paths is desired. Must be one of:
"pcor", "cor", "cov", "prec".
A logical indicating if the diagonal elements should be
retained for visualization.
A logical indicating if output graph should come with
a vertical line at a pre-specified value for the penalty parameter.
A numeric indicating a pre-specified value for the
penalty parameter.
A logical indicating if information on progress should
be printed on screen.
Wessel N. van Wieringen, Carel F.W. Peeters <carel.peeters@wur.nl>
The function visualizes the regularization path of the individual elements
of a regularized precision matrix against the penalty parameter. The range
of the penalty parameter is given by [lambdaMin,lambdaMax].
The penalty parameter must be positive such that lambdaMin must be a
positive scalar. The maximum allowable value of lambdaMax depends on
the type of ridge estimator employed. For details on the type of ridge
estimator one may use (one of: "Alt", "ArchI", "ArchII") see
ridgeP.
Regularization paths may be visualized for (partial) correlations,
covariances and precision elements. The type of element for which a
visualization of the regularization paths is desired can be indicated by the
argument plotType. When vertical = TRUE a vertical line is
added at the constant value. This option can be used to assess
whereabouts the optimal penalty obtained by, e.g., the routines
optPenalty.LOOCV or optPenalty.aLOOCV, finds
itself along the regularization path.
ridgeP, covML,
optPenalty.LOOCV, optPenalty.aLOOCV,
default.target
## Obtain some (high-dimensional) data
p = 25
n = 10
set.seed(333)
X = matrix(rnorm(n*p), nrow = n, ncol = p)
colnames(X)[1:25] = letters[1:25]
Cx <- covML(X)
## Visualize regularization paths
ridgePathS(Cx, .001, 50, 200, plotType = "pcor")
Run the code above in your browser using DataLab