pdsoft | R Documentation |
Computes the sparse and positive definite covariance matrix estimator proposed by Rothman (2012).
pdsoft(s, lam, tau = 1e-04, init = c("soft", "diag", "dense", "user"), s0 = NULL, i0 = NULL, standard = TRUE, tolin = 1e-08, tolout = 1e-08, maxitin = 10000, maxitout = 1000, quiet = TRUE)
s |
A realization of the p by p sample covariance matrix. More generally, any symmetric p by p matrix with positive diagonal entries. |
lam |
The tuning parameter λ on the penalty λ ∑_{i\neq j} |σ_{ij}|. Could be either a scalar or a p by p symmetric matrix with an irrelevant diagonal. When a matrix is used, the penalty has the form ∑_{i\neq j} λ_{ij} |σ_{ij}|. |
tau |
The logarithmic barrier parameter. The default is |
init |
The type of initialization. The default option |
s0 |
Optional user supplied starting point for Σ^{(0)}; see Rothman (2012) |
i0 |
Optional user supplied starting point for Ω^{(0)}; see Rothman (2012) |
standard |
Logical: |
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: |
See Rothman (2012) for the objective function and more information.
A list with
sigma |
covariance estimate |
omega |
inverse covariance estimate |
theta |
correlation matrix estimate, will be |
theta.inv |
inverse correlation matrix estimate, will be |
So long as s
is symmetric with positive diagonal entries and
init
is not set to "user"
(or init
is set to "user"
and i0
as a positive definite matrix),
then omega
is positive definite. If tolin
and tolout
are too large,
or maxitin
and maxitout
are too small, then sigma
may be indefinite.
Adam J. Rothman
Rothman, A. J. (2012). Positive definite estimators of large covariance matrices. Biometrika 99(3): 733-740
pdsoft.cv
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) s=cov(x)*(n-1)/n output=pdsoft(s=s, lam=0.3) output$sigma
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.