mle {cglasso} | R Documentation |
The generic function ‘mle
’ fits the graphical model selected by glasso
, mglasso
or cglasso
.
mle(object, ...) ## S3 method for class 'glasso' mle(object, ..., maxit = 1.0e+04, thr = 1.0e-04, trace = 0L) ## S3 method for class 'mglasso' mle(object, ..., maxit_em = 1.0e+03, thr_em = 1.0e-4, maxit_bcd = 1.0e+4, thr_bcd = 1.0e-4, trace = 0L) ## S3 method for class 'cglasso' mle(object, ..., maxit_em = 1.0e+03, thr_em = 1.0e-4, maxit_bcd = 1.0e+4, thr_bcd = 1.0e-4, trace = 0L)
object |
an object of class ‘ |
maxit |
maximum number of iterations of the glasso algorithm. Default is |
thr |
threshold for the convergence of the glasso algorithm. Default is |
maxit_em |
maximum number of iterations of the EM algorithm. Default is |
thr_em |
threshold for the convergence of the EM algorithm. Default is |
maxit_bcd |
maximum number of iterations of the glasso algorithm. Default is |
thr_bcd |
threshold for the convergence of the glasso algorithm. Default is |
trace |
integer for printing out information as iterations proceed: |
... |
additional argument added for backward compatibility with the generic function ‘ |
The generic function ‘mle
’ computes the maximum likelihood estimates of the graphical model selected by the function glasso
, mglasso
or cglasso
.
If ‘object
’ has class ‘glasso
’, the method function ‘mle.glasso
’ computes the maximum likelihood estimates of the parameters of the Gaussian graphical models (ggm) associated to the sequence of glasso estimates. Formally, for a given value of the tuning parameter let \hat{|Tht}^rho be the glasso estimate of the precision matrix, then ‘mle.glasso
’ solves the following maximization problem:
max_{bar{Tht}} log det bar{Tht} - tr{S bar{Tht}},
where bar{Tht} = {tht_{hk}} and bar{tht}_{hk} = 0 if hat{tht}^rho_{hk} = 0 otherwise it is estimated.
If ‘object
’ has class ‘mglasso
’, the method function ‘mle.mglasso
’ computes the maximum likelihood estimates of the parameters of the Gaussian graphical models with missing-at-random data (mggm) associated to the sequence of mglasso estimates. Formally, for a given value of the tuning parameter let hat{Tht}^rho be the mglasso estimate of the precision matrix, then ‘mle.mglasso
’ computes the maximum likelihood estimate by the following EM-like algorithm:
Step | Description |
1. | let hat{Tht}^rho be the mglasso estimate of the precision matrix; |
2. | E-step |
use the moments of the conditional normal distribution to impute the missing values; | |
3. | M-step |
let X' the completed matrix and S' the corresponding empirical variance matrix, then: | |
let hat{mu}_h = sum_i x'_{ih} / n | |
estimate bar{Tht} maximixing the function: log det bar{Tht} - Tr{S'bar{Tht}} where bar{tht}_{hk} = 0 if hat{tht}^rho_{hk} = 0 | |
otherwise it is estimated; | |
4. | repeat steps 2. and 3. until a convergence criterion is met. |
If ‘object
’ has class ‘cglasso
’, the method function ‘mle.cglasso
’ computes the maximum likelihood estimates of the parameters of the censored Gaussian graphical models (cggm) associated to the sequence of cglasso estimates. Formally, for a given value of the tuning parameter let hat{Tht}^rho be the cglasso estimate of the precision matrix, then ‘mle.cglasso
’ computes the maximum likelihood estimate by the following EM-like algorithm:
Step | Description |
1. | let hat{Tht}^rho be the cglasso estimate of the precision matrix; |
2. | E-step |
use the moments of the truncated normal distribution to compute the current estimates of the | |
marginal means, denoted by bar{x}', and to complete the empirical covariance matrix S'; | |
3. | M-step |
let hat{mu} = bar{x}'; | |
estimate bar{Tht} maximixing the Q-function: log det bar{Tht} - Tr{S'bar{Tht}} where bar{tht}_{hk} = 0 if hat{tht}^rho_{hk} = 0 | |
otherwise it is estimated; | |
4. | repeat steps 2. and 3. until a convergence criterion is met. |
If ‘object
’ has class ‘glasso
’, then ‘mle
’ returns and object with S3 class ‘ggm
’, which inherits the class ‘glasso
’. An object with class ‘ggm
’ is a list containing the following components:
call |
the call that produced this object. |
X |
the matrix used to compute the covariance matrix. |
S |
the covariance matrix used to fit the ggm model. |
nrho |
the number of fitted ggm model. |
rho |
the p-dimensional vector reporting the values of the tuning parameter used to fit the glasso model. |
maxit |
the maximum number of iterations of the glasso algorithm. |
thr |
the threshold for the convergence of the glasso algorithm. |
Sgm |
an array of dimension p x p x nrho). |
Tht |
an array of dimension (p x p x nrho). |
Adj |
an array of dimension (p x p x nrho). |
df |
the p-dimensional vector reporting the number of non-zero partial correlation coefficients. |
R2 |
the p-dimensional vector reporting the values of the measure R2. See section Details, in |
ncomp |
the p-dimensional vector reporting the number of connected components (for internal purposes only). |
Ck |
the (p x nrho)-dimensional matrix encoding the connected components (for internal purposes only). |
pk |
the (p x nrho)-dimensional matrix reporting the number of vertices per connected component (for internal purposes only). |
nit |
the p-dimensional vector reporting the number of iterations. |
conv |
a description of the error that has occurred. |
trace |
the integer used for printing out information. |
If ‘object
’ has class ‘mglasso
’, then ‘mle
’ returns and object with S3 class ‘mggm
’, which inherits the class ‘mglasso
’. An object with class ‘mggm
’ is a list containing the following components:
call |
the call that produced this object. |
X |
the object with S3 class ‘ |
nrho |
the number of fitted cggm model. |
rho |
the p-dimensional vector reporting the values of the tuning parameter used to fit the cglasso model. |
maxit_em |
maximum number of iterations of the EM algorithm. |
thr_em |
threshold for the convergence of the EM algorithm. |
maxit_bcd |
maximum number of iterations of the glasso algorithm. |
thr_bcd |
threshold for the convergence of the glasso algorithm. |
Xipt |
an array of dimension n x p x nrho. |
S |
an array of dimension p x p x nrho. |
mu |
a matrix of dimension p x nrho. The kth column is the estimate of the expected values of the kth cggm model. |
Sgm |
an array of dimension p x p x nrho. |
Tht |
an array of dimension p x p x nrho. |
Adj |
an array of dimension p x p x nrho. |
df |
the p-dimensional vector reporting the number of non-zero partial correlation coefficients. |
R2 |
the p-dimensional vector reporting the values of the measure R2. See section Details, in |
ncomp |
the p-dimensional vector reporting the number of connected components (for internal purposes only). |
Ck |
the (p x nrho)-dimensional matrix encoding the connected components (for internal purposes only). |
pk |
the (p x nrho)-dimensional matrix reporting the number of vertices per connected component (for internal purposes only). |
nit |
the (nrho x 2)-dimensional matrix reporting the number of iterations. |
conv |
a description of the error that has occurred. |
subrout |
the name of the Fortran subroutine where the error has occurred (for internal debug only). |
trace |
the integer used for printing out information. |
If ‘object
’ has class ‘cglasso
’, then ‘mle
’ returns and object with S3 class ‘cggm
’, which inherits the class ‘cglasso
’. An object with class ‘cggm
’ is a list containing the following components:
call |
the call that produced this object. |
X |
the object with S3 class ‘ |
nrho |
the number of fitted cggm model. |
rho |
the p-dimensional vector reporting the values of the tuning parameter used to fit the cglasso model. |
maxit_em |
maximum number of iterations of the EM algorithm. |
thr_em |
threshold for the convergence of the EM algorithm. |
maxit_bcd |
maximum number of iterations of the glasso algorithm. |
thr_bcd |
threshold for the convergence of the glasso algorithm. |
Xipt |
an array of dimension n x p x nrho. |
S |
an array of dimension p x p x nrho. |
mu |
a matrix of dimension p x nrho. The kth column is the estimate of the expected values of the kth cggm model. |
Sgm |
an array of dimension p x p x nrho. |
Tht |
an array of dimension p x p x nrho. |
Adj |
an array of dimension p x p x nrho. |
df |
the p-dimensional vector reporting the number of non-zero partial correlation coefficients. |
R2 |
the p-dimensional vector reporting the values of the measure R2. See section Details, in |
ncomp |
the p-dimensional vector reporting the number of connected components (for internal purposes only). |
Ck |
the (p x nrho)-dimensional matrix encoding the connected components (for internal purposes only). |
pk |
the (p x nrho)-dimensional matrix reporting the number of vertices per connected component (for internal purposes only). |
nit |
the (nrho x 2)-dimensional matrix reporting the number of iterations. |
conv |
a description of the error that has occurred. |
subrout |
the name of the Fortran subroutine where the error has occurred (for internal debug only). |
trace |
the integer used for printing out information. |
Luigi Augugliaro (luigi.augugliaro@unipa.it)
Augugliaro, L., Abbruzzo, A., and Vinciotti, V. (2018). l1-Penalized gaussian graphical model. Biostatistics (to appear).
Stadler N., and Buhlmann P. (2012) <DOI:10.1007/s11222-010-9219-7>. Missing values: sparse inverse covariance estimation and an extension to sparse regression. Statistics and Computing 22, 219–235.
glasso
, mglasso
, cglasso
, to_graph
, and the method functions summary
, coef
, plot
, aic
, bic
and ebic
.
library("cglasso") set.seed(123) ################# # cglasso model # ################# n <- 100L p <- 5L mu <- rep.int(0L, times = p) X <- rdatacggm(n = n, mu = mu, probr = 0.05) out <- cglasso(X = X) out_mle <- mle(out) out_mle inherits(out_mle, "cglasso") class(out_mle) # inheriting method functions from 'cglasso': some examples coef(out_mle, nrho = 10L, print.info = TRUE) to_graph(out_mle, nrho = 10L, weighted = TRUE) out_aic <- aic(out_mle) out_aic plot(out_mle, typeplot = "graph", gof = out_aic) ################# # mglasso model # ################# R <- event(X) X <- as.matrix(X) X[R == 1L] <- NA out <- mglasso(X = X) out_mle <- mle(out) out_mle inherits(out_mle, "mglasso") class(out_mle) # inheriting method functions from 'mglasso': some examples coef(out_mle, nrho = 10L, print.info = TRUE) to_graph(out_mle, nrho = 10L, weighted = TRUE) out_aic <- aic(out_mle) out_aic plot(out_mle, typeplot = "graph", gof = out_aic) ################ # glasso model # ################ X <- MASS::mvrnorm(n = n, mu = mu, Sigma = diag(p)) out <- glasso(X) out_mle <- mle(out) out_mle inherits(out_mle, "glasso") class(out_mle) # inheriting method functions from 'glasso': some examples coef(out_mle, nrho = 10L, print.info = TRUE) to_graph(out_mle, nrho = 10L, weighted = TRUE) out_aic <- aic(out_mle) out_aic plot(out_mle, typeplot = "graph", gof = out_aic)