Learn R Programming

porridge (version 0.3.3)

ridgePgen: Ridge estimation of the inverse covariance matrix with element-wise penalization and shrinkage.

Description

Function that evaluates the generalized ridge estimator of the inverse covariance matrix with element-wise penalization and shrinkage.

Usage

ridgePgen(S, lambda, target, nInit=100, minSuccDiff=10^(-10))

Value

The function returns a regularized inverse covariance matrix.

Arguments

S

Sample covariance matrix.

lambda

A symmetric matrix with element-wise positive penalty parameters.

target

A semi-positive definite target matrix towards which the estimate is shrunken.

nInit

A numeric specifying the number of iteration.

minSuccDiff

A numeric: minimum distance between two succesive estimates to be achieved.

Author

W.N. van Wieringen.

Details

This function generalizes the ridgeP-function in the sense that, besides element-wise shrinkage, it allows for element-wise penalization in the estimation of the precision matrix of a zero-mean multivariate normal distribution. Hence, it assumes that the data stem from \(\mathcal{N}(\mathbf{0}_p, \boldsymbol{\Omega}^{-1})\). The estimator maximizes the following penalized loglikelihood: $$ \log( | \boldsymbol{\Omega} |) - \mbox{tr} ( \boldsymbol{\Omega} \mathbf{S} ) - \| \boldsymbol{\Lambda} \circ (\boldsymbol{\Omega} - \mathbf{T}) \|_F^2, $$ where \(\mathbf{S}\) the sample covariance matrix, \(\boldsymbol{\Lambda}\) a symmetric, positive matrix of penalty parameters, the \(\circ\)-operator represents the Hadamard or element-wise multipication, and \(\mathbf{T}\) the precision matrix' shrinkage target. For more details see van Wieringen (2019).

References

van Wieringen, W.N. (2019), "The generalized ridge estimator of the inverse covariance matrix", Journal of Computational and Graphical Statistics, 28(4), 932-942.

See Also

ridgeP.

Examples

Run this code
# set dimension and sample size
p <- 10
n <- 10

# penalty parameter matrix
lambda       <- matrix(1, p, p)
diag(lambda) <- 0.1

# generate precision matrix
Omega       <- matrix(0.4, p, p)
diag(Omega) <- 1
Sigma       <- solve(Omega)

# data 
Y <- mvtnorm::rmvnorm(n, mean=rep(0,p), sigma=Sigma)
S <- cov(Y)

# unpenalized diagonal estimate
Phat <- ridgePgen(S, lambda, 0*S)

Run the code above in your browser using DataLab