ridgePathS: Visualize the regularization path

ridgePathSR Documentation

Visualize the regularization path

Description

Function that visualizes the regularization paths of the nonredundant elements of a regularized precision matrix against the (range of the) penalty parameter.

Usage

ridgePathS(
  S,
  lambdaMin,
  lambdaMax,
  step,
  type = "Alt",
  target = default.target(S),
  plotType = "pcor",
  diag = FALSE,
  vertical = FALSE,
  value,
  verbose = TRUE
)

Arguments

S

Sample covariance matrix.

lambdaMin

A numeric giving the minimum value for the penalty parameter.

lambdaMax

A numeric giving the maximum value for the penalty parameter.

step

An integer determining the number of steps in moving through the grid [lambdaMin, lambdaMax].

type

A character indicating the type of ridge estimator to be used. Must be one of: "Alt", "ArchI", "ArchII".

target

A target matrix (in precision terms) for Type I ridge estimators.

plotType

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".

diag

A logical indicating if the diagonal elements should be retained for visualization.

vertical

A logical indicating if output graph should come with a vertical line at a pre-specified value for the penalty parameter.

value

A numeric indicating a pre-specified value for the penalty parameter.

verbose

A logical indicating if information on progress should be printed on screen.

Details

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.

Author(s)

Wessel N. van Wieringen, Carel F.W. Peeters <carel.peeters@wur.nl>

See Also

ridgeP, covML, optPenalty.LOOCV, optPenalty.aLOOCV, default.target

Examples


## 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")


rags2ridges documentation built on Oct. 14, 2023, 5:06 p.m.