mle {cglasso}R Documentation

Maximum Likelihood Estimation

Description

The generic function ‘mle’ fits the graphical model selected by glasso, mglasso or cglasso.

Usage

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)

Arguments

object

an object of class ‘glasso’, ‘mglasso’ or ‘cglasso’.

maxit

maximum number of iterations of the glasso algorithm. Default is 1.0E+4.

thr

threshold for the convergence of the glasso algorithm. Default is 1.0E-4.

maxit_em

maximum number of iterations of the EM algorithm. Default is 1.0E+03.

thr_em

threshold for the convergence of the EM algorithm. Default is 1.0E-4.

maxit_bcd

maximum number of iterations of the glasso algorithm. Default is 1.0E+4.

thr_bcd

threshold for the convergence of the glasso algorithm. Default is 1.0E-4.

trace

integer for printing out information as iterations proceed: trace = 0 no information is printed out on video; trace = 1 basic information is printed out on video; trace = 2 detailed information is printed out on video.

...

additional argument added for backward compatibility with the generic function ‘mle’.

Details

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.

Value

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). Sgm[, , k] is the estimate of the covariance matrix of the kth ggm model.

Tht

an array of dimension (p x p x nrho). Tht[, , k] is the estimate of the precision matrix of the kth ggm model.

Adj

an array of dimension (p x p x nrho). Adj[, , k] is the adjacency matrix associated to Tht[, , k], i.e. Adj[i, j, k] = 1 iff Tht[i, j, k] != 0 and 0 otherwise.

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 glasso.

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 ‘datacggm’ used to fit the cggm model.

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. Xipt[, , k] is the matrix where the censored vaules are replaced using the conditional expected vaules computed in the E-step of the algorithm describted in section Details.

S

an array of dimension p x p x nrho. S[, , k] is the matrix S' used to fit the cggm model (see the section Details).

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. Sgm[, , k] is the estimate of the covariance matrix of the kth cggm model.

Tht

an array of dimension p x p x nrho. Tht[, , k] is the estimate of the precision matrix of the kth cggm model.

Adj

an array of dimension p x p x nrho. Adj[, , k] is the adjacency matrix associated to Tht[, , k], i.e. Adj[i, j, k] = 1 iff Tht[i, j, k] != 0 and 0 otherwise.

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 cglasso.

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 ‘datacggm’ used to fit the cggm model.

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. Xipt[, , k] is the matrix where the censored vaules are replaced using the conditional expected vaules computed in the E-step of the algorithm describted in section Details.

S

an array of dimension p x p x nrho. S[, , k] is the matrix S' used to fit the cggm model (see the section Details).

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. Sgm[, , k] is the estimate of the covariance matrix of the kth cggm model.

Tht

an array of dimension p x p x nrho. Tht[, , k] is the estimate of the precision matrix of the kth cggm model.

Adj

an array of dimension p x p x nrho. Adj[, , k] is the adjacency matrix associated to Tht[, , k], i.e. Adj[i, j, k] = 1 iff Tht[i, j, k] != 0 and 0 otherwise.

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 cglasso.

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.

Author(s)

Luigi Augugliaro (luigi.augugliaro@unipa.it)

References

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.

See Also

glasso, mglasso, cglasso, to_graph, and the method functions summary, coef, plot, aic, bic and ebic.

Examples

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)

[Package cglasso version 1.1.1 Index]