Skip to content

Commit

Permalink
version 1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Tibshirani authored and cran-robot committed Oct 1, 2019
1 parent 88343f8 commit 6634337
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
@@ -1,14 +1,14 @@
Package: glasso
Title: Graphical Lasso: Estimation of Gaussian Graphical Models
Version: 1.10
Version: 1.11
Author: Jerome Friedman, Trevor Hastie and Rob Tibshirani
Description: Estimation of a sparse inverse covariance matrix using a lasso (L1)
penalty. Facilities are provided for estimates along a path of values
for the regularization parameter.
Maintainer: Rob Tibshirani <tibs@stat.stanford.edu>
License: GPL-2
URL: http://www-stat.stanford.edu/~tibs/glasso
Packaged: 2018-07-12 23:45:19 UTC; naras
Packaged: 2019-09-24 21:37:23 UTC; robtibshirani
Repository: CRAN
Date/Publication: 2018-07-13 04:40:06 UTC
Date/Publication: 2019-10-01 18:40:07 UTC
NeedsCompilation: yes
6 changes: 3 additions & 3 deletions MD5
@@ -1,8 +1,8 @@
9e100048db5c6fbde74725c20d32d8ab *DESCRIPTION
221127194e4b26a07e13985c40925a45 *DESCRIPTION
a98919657d182a30729381c29aa13061 *NAMESPACE
9b2f2da42cd1d66c4e3cd38427a0bf7a *R/glasso.R
4d3c6b4c4db738159f953e00df2394f7 *R/glasso.R
c1a3c7a42d3c130ba02f4827f056ac9a *R/glassopath.R
a92a091ed68d9cf0d5ee056b4ead20fb *man/glasso.Rd
eda53f6f766738b1f564751d5d299160 *man/glasso.Rd
e624eb3357a4d5c9dd0f2c5c734c7116 *man/glassopath.Rd
eec797dc32427aee0efb399871b455b4 *src/glasso.f
22909b3dcaec3bcf1cd20d2fe6134966 *src/glasso_init.c
8 changes: 5 additions & 3 deletions R/glasso.R
@@ -1,8 +1,8 @@
glasso=function(s, rho, zero=NULL, thr=1.0e-4,maxit=1e4, approx=FALSE, penalize.diagonal=TRUE,start=c("cold","warm"), w.init=NULL,wi.init=NULL, trace=FALSE){
n=nrow(s)
glasso=function(s, rho,nobs=NULL, zero=NULL, thr=1.0e-4,maxit=1e4, approx=FALSE, penalize.diagonal=TRUE,start=c("cold","warm"), w.init=NULL,wi.init=NULL, trace=FALSE){
# on return, cflag=1 means the procedure did not converge, =0 means it did

BIG=10e9
n=nrow(s)

if(!is.matrix(rho) & length(rho)!=1 & length(rho)!=nrow(s))
{stop("Wrong number of elements in rho")}
Expand Down Expand Up @@ -86,5 +86,7 @@ val= -log(d)+sum(diag(s%*%Sigmahati))+sum(abs(rho*temp))
return(val)
}
crit=critfun(xx,s,rho,penalize.diagonal)
return(list(w=ww,wi=xx,loglik=-(n/2)*crit,errflag=junk$ierr,approx=approx, del=junk$del, niter=junk$niter))
loglik=NA
if(!is.null(nobs)) loglik=-(nobs/2)*crit
return(list(w=ww,wi=xx,loglik=loglik,errflag=junk$ierr,approx=approx, del=junk$del, niter=junk$niter))
}
4 changes: 3 additions & 1 deletion man/glasso.Rd
Expand Up @@ -5,13 +5,15 @@
Estimates a sparse inverse covariance matrix using a lasso (L1) penalty
}
\usage{
glasso(s, rho, zero=NULL, thr=1.0e-4, maxit=1e4, approx=FALSE,
glasso(s, rho, nobs=NULL, zero=NULL, thr=1.0e-4, maxit=1e4, approx=FALSE,
penalize.diagonal=TRUE, start=c("cold","warm"),
w.init=NULL,wi.init=NULL, trace=FALSE)
}
\arguments{
\item{s}{Covariance matrix:p by p matrix (symmetric)}
\item{rho}{(Non-negative) regularization parameter for lasso. rho=0 means no regularization. Can be a scalar (usual) or a symmetric p by p matrix, or a vector of length p. In the latter case, the penalty matrix has jkth element sqrt(rho[j]*rho[k]).}
\item{nobs}{Number of observations used in computation of the covariance matrix s. This quantity is need to compute the value of log-likelihood.
If not specified, loglik will be returned as NA.}
\item{zero}{(Optional) indices of entries of inverse covariance to be constrained to be zero. The input should be a matrix with two columns, each row indicating
the indices of elements to be constrained to be zero. The solution must be symmetric, so you need only specify one of (j,k) and (k,j). An entry in the zero matrix
overrides any entry in the rho matrix for a given element.}
Expand Down

0 comments on commit 6634337

Please sign in to comment.