Learn R Programming

DESP (version 0.2-2)

desp: Robust estimation of a sparse precision matrix

Description

This function computes robust estimates of the precision matrix $Omega$ and of the expectation $mu$ corresponding to the data matrix X by solving a convex optimization problem. It implements the algorithms proposed by Balmand and Dalalyan (2015a, 2015b).

Usage

desp(X,lambda=0,gamma=0,settings=NULL)

Arguments

X
The data matrix.
lambda
The penalization parameter that encourages robustness.
gamma
The penalization parameter that promotes sparsity.
settings
A list including all the parameters needed for the estimation.

Value

desp returns an object with S3 class "desp" containing the estimated parameters, with components:

References

Balmand, S. and Dalalyan, A. S. (2015a): On estimation of the diagonal elements of a sparse precision matrix, Posted as http://arxiv.org/abs/1504.04696.

Balmand, S. and Dalalyan, A. S. (2015b): Convex programming approach to robust estimation of a multivariate Gaussian model, Posted as http://arxiv.org/abs/1512.04734.

See Also

sqR_Lasso

Examples

Run this code
## set the dimension and the sample size
p <- 50
n <- 40
## define the true precision matrix
Omega <- 2*diag(p)
Omega[1,1] <- p 
Omega[1,2:p] <- 2/sqrt(2)
Omega[2:p,1] <- 2/sqrt(2)
## generate the distribution
set.seed(1)
X <- MASS::mvrnorm(n, rep.int(0,p), MASS::ginv(Omega))
## define the settings
settings <- list("diagElem"="AD", "OLS"=FALSE)
## estimate the parameters of the distribution
params <- desp(X,lambda=0,gamma=sqrt(2*log(p)),settings=settings)
## error of estimation measured by Frobenius norm
sqrt(sum((Omega - params$Omega)^2))
## increase the sample size and generate the distribution again
n <- 1000
X <- MASS::mvrnorm(n, rep.int(0,p), MASS::ginv(Omega))
## estimate the parameters of the distribution
params <- desp(X,lambda=0,gamma=sqrt(2*log(p)),settings=settings)
## error of estimation measured by Frobenius norm
sqrt(sum((Omega - params$Omega)^2))

Run the code above in your browser using DataLab