pdsoft.cv {PDSCE} | R Documentation |
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 = TRUE)
Arguments
x |
A data matrix with |
lam.vec |
An optional vector of candidate lasso-type penalty tuning parameter values.
The default for |
standard |
Logical: |
init |
The type of initialization used for the estimate computed at the maximum element in |
tau |
The logarithmic barrier parameter. The default is |
nsplits |
The number of random splits to use for the tuning parameter selection. |
n.tr |
Optional number of cases to use in the training set. The default is the nearest
integer to |
tolin |
Convergence tolerance for the inner loop of the algorithm that solves the lasso regression. |
tolout |
Convergence tolerance for the outer loop of the algorithm. |
maxitin |
Maximum number of inner-loop iterations allowed |
maxitout |
Maximum number of outer-loop iterations allowed |
quiet |
Logical: |
Details
See Rothman (2012) for the objective function and more information.
Value
A list with
sigma |
covariance estimate at the selected tuning parameter |
omega |
inverse covariance estimate at the selected tuning parameter |
best.lam |
the selected value of the tuning parameter |
cv.err |
a vector of the validation errors, one for each element in |
lam.vec |
the vector of candidate tuning parameter values |
n.tr |
the number of cases used for the training set |
Note
It is always the case that omega
is positive definite. If tolin
and tolout
are too large,
or maxitin
and maxitout
are too small, then sigma
may be indefinite.
Author(s)
Adam J. Rothman
References
Rothman, A. J. (2012). Positive definite estimators of large covariance matrices. Biometrika 99(3): 733-740
See Also
Examples
set.seed(1)
n=50
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