dpglasso

Share:

Description

Does block (one row/column at a time) coordinate-wise optimization on the primal of the Graphical Lasso problem:

min_X log det (X) + trace(X Sigma) + rho |X|_1

Usage

1
dpglasso(Sigma, X=NULL,invX=NULL,rho,outer.Maxiter=100,obj.seq=FALSE,outer.tol=10^-5)

Arguments

Sigma

(Required) the sample covariance matrix, symmetric PSD with dimensions p \times p.

X

is an initialization to the precision matrix X. It must be symmetric, PD with dimensions p \times p. Defaults to X= diag( 1/(rep(rho,p) + diag(Sigma)) )

invX

is an initialization to the covariance matrix. It must be symmetric with dimensions p \times p. It is not necessary for invX to be the inverse of X. Defaults to invX<- Sigma + diag(rep(rho,p))

rho

(Required) is the amount of regularization. It is a non-negative scalar.

outer.Maxiter

the maximum number of outer iterations (i.e. row/column updates) to be performed.

outer.Maxiter defaults to 100.

obj.seq

Logical variable taking values TRUE/FALSE. If obj.seq=TRUE dpglasso computes the objective value after every sweep across p rows/columns.

obj.seq defaults to FALSE

Note: Computing the objective values is O(p^3), and can take quite some time depending upon the size of the problem. Hence, it is not recommended to compute the objective values, during the course of the algorithm.

outer.tol

convergence criterion. outer.tol is a non-negative scalar. If relative difference in the frobenius norm of the precision matrices across two successive iterations is below outer.tol, algorithm dpglasso converges.

Details

dpglasso can also be used as a path algorithm ie solve problem (A) on a grid of rho values. In that case, the estimates of the precision matrix X and covariance matrix invX obtained by solving (A) for a certain rho, are to be supplied as warm-starts to solve problem (A) for a smaller value of rho. See the example below.

Value

X

precision matrix

invX

covariance matrix

time.counter.QP

This is a three dimensional vector, representing the total time taken to solve all the QPs; uses the R function proc.time()

Author(s)

Rahul Mazumder and Trevor Hastie

References

This algorithm DPGLASSO is described in the paper: “The Graphical Lasso: New Insights and Alternatives by Rahul Mazumder and Trevor Hastie" available at http://arxiv.org/abs/1111.5479

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
set.seed(2008)

# create data

n=10; p = 5; 
X<-array(rnorm(n*p),dim=c(n,p)); # data-matrix 
Sigma=cov(X); # sample covariance matrix

q<-max(abs(Sigma[row(Sigma)> col(Sigma)])); 
rho=q*0.7;
B<-dpglasso(Sigma,rho=rho,outer.Maxiter=20,outer.tol=10^-6); 
# uses the default initializations for the covariance and precision matrices


# now solve the problem for a smaller value of rho,
# using the previous solution as warm-start
rho.new=rho*.8;
B.new<-dpglasso(Sigma,X=B$X,invX=B$invX,
rho=rho.new,outer.Maxiter=20,outer.tol=10^-6);

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.