Learn R Programming

PDSCE (version 1.0)

pdsoft.cv: Tuning parameter selection and computation for the positive definite and sparse covariance matrix estimator

Description

Computes and selects the tuning parameter for the sparse and positive definite covariance matrix estimator proposed by Rothman (2012).

Usage

pdsoft.cv(x, lam.vec = NULL, standard = TRUE, 
          init = c("diag", "soft", "dense"), tau = 1e-04, 
          nsplits = 10, n.tr = NULL, tolin = 1e-08, tolout = 1e-08, 
          maxitin = 10000, maxitout = 1000, quiet = FALSE)

Arguments

Value

A list withsigmacovariance estimate at the selected tuning parameteromegainverse covariance estimate at the selected tuning parameterbest.lamthe selected value of the tuning parametercv.erra vector of the validation errors, one for each element in lam.veclam.vecthe vector of candidate tuning parameter valuesn.trthe number of cases used for the training set

Details

See pdsoft for more information.

References

Rothman, A. J. (2012). Positive definite estimators of large covariance matrices. Biometrika 99(3): 733-740

See Also

pdsoft

Examples

Run this code
set.seed(1)
n=10
p=20
true.cov=diag(p)
true.cov[cbind(1:(p-1), 2:p)]=0.4
true.cov[cbind(2:p, 1:(p-1))]=0.4
eo=eigen(true.cov, symmetric=TRUE)
z=matrix(rnorm(n*p), nrow=n, ncol=p)
x=z%*% tcrossprod(eo$vec*rep(eo$val^(0.5), each=p),eo$vec)
output=pdsoft.cv(x=x)
plot(output$lam.vec, output$cv.err)
output$best.lam
output$sigma

Run the code above in your browser using DataLab