Last chance! 50% off unlimited learning
Sale ends in
‘mglasso
’ function is used to fit an l1-penalized Gaussian graphical model with missing-at-random data.
mglasso(X, weights, pendiag = FALSE, nrho = 50L, rho.min.ratio, rho,
maxR2, maxit_em = 1.0e+3, thr_em = 1.0e-4, maxit_bcd = 1.0e+4,
thr_bcd = 1.0e-4, trace = 0L)
the
an optional symmetric matrix of non-negative weights. This matrix can be used to specify the unpenalized partial correlation coefficients (‘weights[i, j] = 0
’) or the structural zeros in the precision matrix (‘weights[i, j] = +Inf
’). See below for an example. By default, mglasso model is fitted without weights.
flag used to specify if the diagonal elements of the concentration matrix are penalized (‘pendiag = TRUE
’) or unpenalized (‘pendiag = FALSE
’).
the integer specifying the number of tuning parameters used to fit the mglasso model. Default is ‘nrho = 50
’.
the smallest value for the tuning parameter rho.min.ratio
’ will lead to a saturated fitted model in the ‘
optional argument. A user supplied rho
sequence. WARNING: avoid supplying a single value for the tuning parameter; supply instead a decreasing sequence of
a value belonging to the interval maxR2
’. Default depends on the sample size ‘
maximum number of iterations of the EM algorithm. Default is 1.0E+3
.
threshold for the convergence of the EM algorithm. Default value is 1.0E-4
.
maximum number of iterations of the glasso algorithm. Default is 1.0E+4
.
threshold for the convergence of the glasso algorithm. Default is 1.0E-4
.
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.
mglasso
returns an object with S3 class “mglasso
”, i.e., a list containing the
following components:
the call that produced this object.
the original matrix used to fit the missglasso model.
the weights used to fit the missglasso model.
the flag specifying if the diagonal elements of the precisione matrix are penalized.
the number of fitted missglasso model.
the scale factor used to compute the smallest value of the tuning parameter.
the
the threshold value used to stop the regularization path.
the maximum number of iterations of the EM algorithm.
the threshold for the convergence of the EM algorithm.
the maximum number of iterations of the glasso algorithm.
the threshold for the convergence of the glasso algorithm.
an array of dimension Xipt[, , k]
is the matrix where the missing values are replaced with the conditional expected values computed in the E-step of the algorithm describted in section Details.
an array of dimension S[, , k]
is the matrix
a matrix of dimension rho[k]
.
an array of dimension Sgm[, , k]
is the estimate of the covariance matrix of the missglasso model fitted using rho[k]
.
an array of dimension Tht[, , k]
is the estimate of the precision matrix of the missglasso model fitted using rho[k]
.
an array of dimension Adj[, , k]
is the adjacency matrix associated to Tht[, , k]
, i.e. Adj[i, j, k]
Tht[i, j, k]
0
otherwise.
the
the
the
the
the
the
a description of the error that has occurred.
the name of the Fortran subroutine where the error has occurred (for internal debug only).
the integer used for printing out information.
The missglasso estimator (Stadler and other, 2012) is an extension of the classical graphical lasso (glasso) estimator (Yuan and other, 2007) developed to fit a sparse Gaussian graphical model under the assumption that data are missing-at-random.
mglasso
function fits the model using the following EM algorithm:
Step | Description |
1. | Let |
2. | E-step |
use the expected values of the conditional normal distribution to impute the missing data | |
let |
|
3. | M-step |
let |
|
compute |
In order to avoid the overfitting of the model, we use the following pseudo R-squared measure: maxR2
’.
Friedman, J.H., Hastie, T., and Tibshirani, R. (2008) <DOI:10.1093/biostatistics/kxm045>. Sparse inverse covariance estimation with the graphical lasso. Biostatistics 9, 432--441.
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.
Yuan, M., and Lin, Y. (2007) <DOI:10.1093/biomet/asm018>. Model selection and estimation in the Gaussian graphical model. Biometrika 94, 19--35.
glasso
, to_graph
, mle
and the method functions summary
, coef
, plot
, aic
, bic
, ebic
.
# NOT RUN {
library("cglasso")
set.seed(123)
p <- 5L
n <- 100L
mu <- rep(0L, p)
Tht <- diag(p)
diag(Tht[-1L, -p]) <- diag(Tht[-p, -1L]) <- 0.3
Sgm <- solve(Tht)
X <- MASS::mvrnorm(n = n, mu = mu, Sigma = Sgm)
X <- as.vector(X)
id.na <- sample.int(n = n * p, size = n * p * 0.05)
X[id.na] <- NA
dim(X) <- c(n, p)
out <- mglasso(X = X)
out
# in this example we use the argument 'weights' to specify
# the unpenalized partial correlation coefficients and the
# structural zeros in the precision matrix
w <- rep(1, p * p)
dim(w) <- c(p, p)
# specifing the unpenalized partial correlation coefficients
diag(w) <- diag(w[-1L, -p]) <- diag(w[-p, -1L]) <- 0
# specifing the structural zero
w[1L, 4L:5L] <- w[4L:5L, 1L] <- +Inf
w[2L, 5L] <- w[5L, 2L] <- +Inf
w
out <- mglasso(X = X, weights = w)
# checking structural zeros
out$Tht[, , out$nrho][w == +Inf]
# checking stationarity conditions of the MLE estimators
# (the unpenalized partial correlation coefficients)
(out$Sgm[, , out$nrho] - out$S[, , out$nrho])[w == 0]
# }
Run the code above in your browser using DataLab