Learn R Programming

CovTools (version 0.2.1)

PreEst.auto: Estimating Precision Matrix with automatic parameter tuning

Description

This code compiles several estimation methods for precision matrix, which is an inverse of covariance matrix, including penalized likelihood method with L1 penalty(Yuan07, Banerjee06) or Bayesian approaches incorporating banded structure assumptions(Banerjee14,Lee17). At this moment, the only automation is necessary for the method "Yuan07" for multiple trials with different \(\lambda\) values.

Usage

PreEst.auto(X, method = c("Banerjee06", "Banerjee14", "Lee17", "Yuan07"),
  opt = list(Banerjee06.confidence = 0.95, Banerjee14.upperK =
  floor(ncol(X)/2), Banerjee14.delta = 10, Banerjee14.logpi = function(k) {    
  -k^4 }, Banerjee14.loss = c("Stein", "Squared"), Lee17.upperK =
  floor(ncol(X)/2), Lee17.logpi = function(k) {     -k^4 }, Yuan07.lambdagrid =
  seq(from = 0.01, to = 2, length.out = 10)), parallel = FALSE)

Arguments

X

an (n-by-p) matrix where each row is an observation from the first dataset.

method

a name of estimation method.

opt

a list containing following parameters,

Banerjee06.confidence

level of confidence in \((0,1)\).

Banerjee14.upperK

upper bound for bandwidth.

Banerjee14.delta

a number larger than 2.

Banerjee14.logpi

log of prior distribution for bandwidth k.

Banerjee14.loss

loss type; either "Stein" or "Squared" type.

Lee17.upperK

upper bound for bandwidth.

Lee17.logpi

log of prior distribution for bandwidth k.

Yuan07.lambdagrid

a vector of regularization parameters.

parallel

a logical; TRUE for using half the cores available, FALSE otherwise.

Value

a named list containing:

C

a (p-by-p) estimated precision matrix.

BIC

a vector of BIC scores for the method Yuan07, only.

References

[Banerjee06] Banerjee et al (2006) Convex optimization techniques for fitting sparse Gaussian graphical models. ICML'06:89-96.

[Banerjee14] Banerjee, S. and Ghosal, S. (2014) Posterior convergence rates for estimating large precision matrices using graphical models. Electronic Journal of Statistics, Vol.8:2111-2137.

[Lee17] Lee, K. and Lee, J. (2017) Estimating Large Precision Matrices via Modified Cholesky Decomposition. arXiv:1707.01143.

[Yuan07] Yuan, M. and Lin, Y. (2007) Model selection and estimation in the Gaussian graphical model. Biometrika, Vol.94(1):19-35.

Examples

Run this code
# NOT RUN {
## generate data from multivariate normal with Identity precision.
data = mvtnorm::rmvnorm(100, sigma=diag(10))

## run estimation
out1 = PreEst.auto(data, method="Banerjee06")
out2 = PreEst.auto(data, method="Lee17")

## Visualize
par(mfrow=c(1,3))
image(pracma::flipud(diag(10)),main="Original Covariance")
image(pracma::flipud(out1$C), main="Banerjee06")
image(pracma::flipud(out2$C), main="Lee17")

# }

Run the code above in your browser using DataLab