# ridgePsign: Ridge estimation for high-dimensional precision matrices with... In CFWP/rags2ridges: Ridge Estimation of Precision Matrices from High-Dimensional Data

## Description

Function that calculates the ridge estimators for high-dimensional precision matrices with known sign of the off-diagonal precision elements.

## Usage

 ```1 2``` ```ridgePsign(S, lambda, sign, target = default.target(S), type = "Alt", method = "nlm", verbose = TRUE, ...) ```

## Arguments

 `S` Sample covariance `matrix`. `lambda` A `numeric` representing the value of the penalty parameter. `sign` A character indicating the required sign of the off-diagonal elements of ridge precision estimate. Must be either: "pos" (positive) and "neg" (negative). `target` A target `matrix` (in precision terms) for the ridge precision estimator. `type` A `character` indicating the type of ridge estimator to be used. Must be one of: "Alt", "ArchI", "ArchII". `method` A `character` : which optimization function should be used: `"nlm"` (default) or `"optim"` which refer to `nlminb` or `constrOptim`, respectively. `verbose` `Logical` indicator: should intermediate output be printed on the screen? `...` Additional arguments passed on to either `nlminb` or `constrOptim`.

## Details

Modified version of the `ridgePchordal`-function, now the ridge precision matrix estimate has off-diagonal elements equalling zero or of the specified sign. The estimate is found by solving a constrained estimation problem. This is done numerically and employs the `nlminb` and `constrOptim` procedure of R. These procedures are initiated by the ridge ML precision estimate and its off-diagonal elements with the excluded sign set to (effectively) zero.

## Value

The function returns a regularized precision `matrix` with off-diagonal elements of specified signed or zero.

## Author(s)

W.N. van Wieringen.

`ridgeP`, `ridgePchordal`
 ```1 2 3 4 5 6 7 8``` ```# obtain some data p <- 8 n <- 100 set.seed(333) Y <- matrix(rnorm(n*p), nrow = n, ncol = p) # obtain regularized precision matrix with off-diagonal elements of specified signed ridgePsign(covML(Y), lambda=0.1, sign="pos") ```