| cglasso | R Documentation |
‘cglasso’ fits the conditional graphical lasso model to datasets with censored and/or missing values.
cglasso(formula, data, subset, contrasts = NULL, diagonal = FALSE,
weights.B = NULL, weights.Tht = NULL, nlambda, lambda.min.ratio,
lambda, nrho, rho.min.ratio, rho, maxit.em = 1.0E+4, thr.em = 1.0E-3,
maxit.bcd = 1.0E+5, thr.bcd = 1.0E-4, trace = 0L)
formula |
an object of class ‘ |
data |
an R object of S3 class ‘ |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
contrasts |
an optional list. See the |
diagonal |
logical. Should diagonal entries of the concentration matrix be penalized? Default is ‘ |
weights.B |
an optional |
weights.Tht |
an optional symmetric matrix of non-negative weights used to penalize the partial regression coefficients. This matrix can be used to specify the unpenalized partial correlation coefficients (‘ |
nlambda |
integer. The number of |
lambda.min.ratio |
the smallest |
lambda |
an optional user-supplied decreasing sequence of |
nrho |
integer. The number of |
rho.min.ratio |
the smallest |
rho |
an optional user supplied decreasing sequence of |
maxit.em |
maximum number of iterations of the EM algorithm. Default is |
thr.em |
threshold for the convergence of the EM algorithm. Default value 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 information out as iterations proceed: |
cglasso is the main model-fitting function and can be used to fit a broad range of extensions of the glasso estimator (Friedman and other, 2008). It is specifically proposed to study datasets with censored and/or missing response values. To help the user, the cglasso function has been designed to automatically select the most suitable extension by using the information stored in the ‘datacggm’ object passed through Z.
Below we sum up the available extenions:
if only left/right-censored are observed in the response matrix Y (without missing values) and no predictor matrix is stored in Z, then cglasso computes the censored glasso estimator (Augugliaro and other, 2020a);
if only left/right-censored are observed in the response matrix Y (without missing values) and and a predictor matrix X is stored in Z, then cglasso computes the conditional censored glasso estimator (Augugliaro and other, 2020b);
if only missing values are stored in the response matrix Y (without censored values), then cglasso computes the missglasso estimator (Stadler and other, 2012);
starting with version 2.0.0, cglasso can also handle datasets with both missing and censored response values.
See section ‘Examples’ for some example.
The model-fitting function cglasso returns an R object of S3 class ‘cglasso’ for which there are available a set of accessor functions, a set of functions designed to evaluate the goodness-of-fit of the fitted models and, finally, a set of functions developed to analyze the selected network. The function ShowStructure can be used to show the structure of the package.
The accessor functions coef.cglasso, fitted.cglasso, residuals.cglasso, predict.cglasso and impute can be used to extract various useful features of the object fitted by cglasso.
For an R object returned by cglasso, the functions AIC.cglasso and BIC.cglasso can be used to evaluate the goodness-of-fit of the fitted models. Usually, these functions are used together with the function summary.cglasso, which gives more information about the sequence of fitted models. The plotting function plot.GoF can be used to graphically identify the optimal pair of the tuning parameters.
Given a pair of the tuning paremeters, the functions to_graph and plot.cglasso2igraph can be used to analyze and show the selected network. Finally, the function cggm can be used to produce post-hoc maximum likelihood refitting of the selected graphical model.
cglasso returns an object of S3 class “cglasso”, i.e., a named list containing the
following components:
call |
the call that produced this object. |
Yipt |
an array of dimension ‘ |
B |
an array of dimension ‘ |
mu |
an array of dimension ‘ |
R |
an array of dimension ‘ |
S |
an array of dimension ‘ |
Sgm |
an array of dimension ‘ |
Tht |
an array of dimension ‘ |
dfB |
a matrix of dimension ‘ |
dfTht |
a matrix of dimension ‘ |
InfoStructure |
a named list whose elements contain information about the estimated networks. Only for internal purpose. |
nit |
an array of dimension ‘ |
Z |
the ‘ |
diagonal |
the flag used to specify if the diagonal entries of the precision matrix are penalized. |
weights.B |
the matrix of non-negative weights used for the regression coefficients. |
weights.Tht |
the matrix of non-negative weights used for the precision matrix. |
nlambda |
the number of |
lambda.min.ratio |
the value used to compute the smallest |
lambda |
the sequence of |
nrho |
the number of |
rho.min.ratio |
the value used to compute the smallest |
rho |
the sequence of |
model |
a description of the fitted 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. |
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 information on screen. |
nobs |
the sample size |
nresp |
the number of response variables used to fit the model. |
npred |
the number of predictors used to fit the model. |
Luigi Augugliaro (luigi.augugliaro@unipa.it)
Augugliaro L., Sottile G., Wit E.C., and Vinciotti V. (2023) <\Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v105.i01")}>. cglasso: An R Package for Conditional Graphical Lasso Inference with Censored and Missing Values. Journal of Statistical Software 105(1), 1–58.
Augugliaro, L., Abbruzzo, A., and Vinciotti, V. (2020a) <\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/biostatistics/kxy043")}>.
\ell_1-Penalized censored Gaussian graphical model.
Biostatistics 21, e1–e16.
Augugliaro, L., Sottile, G., and Vinciotti, V. (2020b) <\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s11222-020-09945-7")}>. The conditional censored graphical lasso estimator. Statistics and Computing 30, 1273–1289.
Friedman, J.H., Hastie, T., and Tibshirani, R. (2008) <\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/biostatistics/kxm045")}>. Sparse inverse covariance estimation with the graphical lasso. Biostatistics 9, 432–441.
Stadler, N. and Buhlmann, P. (2012) <\Sexpr[results=rd]{tools:::Rd_expr_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.
datacggm, coef.cglasso, fitted.cglasso, residuals.cglasso, predict.cglasso, impute, AIC.cglasso, BIC.cglasso, summary.cglasso, select_cglasso, plot.GoF, to_graph, plot.cglasso2igraph, cggm and ShowStructure.
set.seed(123)
# Model 1: censored glasso estimator (Augugliaro \emph{and other}, 2020a)
# Y ~ N(0, Sigma) and probability of left/right censored values equal to 0.05
n <- 1000L
p <- 3L
rho <- 0.3
Sigma <- outer(1L:p, 1L:p, function(i, j) rho^abs(i - j))
Z <- rcggm(n = n, Sigma = Sigma, probl = 0.05, probr = 0.05)
out <- cglasso(. ~ ., data = Z)
out
# Model 2: conditional censored glasso estimator (Augugliaro \emph{and other}, 2020b)
# Y ~ N(b0 + XB, Sigma) and probability of left/right censored values equal to 0.05
n <- 1000L
p <- 3L
q <- 2L
b0 <- runif(p)
B <- matrix(runif(q * p), nrow = q, ncol = p)
X <- matrix(rnorm(n * q), nrow = n, ncol = q)
rho <- 0.3
Sigma <- outer(1L:p, 1L:p, function(i, j) rho^abs(i - j))
Z <- rcggm(n = n, b0 = b0, X = X, B = B, Sigma = Sigma, probl = 0.05, probr = 0.05)
out <- cglasso(. ~ ., data = Z)
out
# Model 3: missglasso estimator (Stadler \emph{and other}, 2012)
# Y ~ N(b0 + XB, Sigma) and probability of missing-at-random values equal to 0.05
n <- 1000L
p <- 3L
q <- 2L
b0 <- runif(p)
B <- matrix(runif(q * p), nrow = q, ncol = p)
X <- matrix(rnorm(n * q), nrow = n, ncol = q)
rho <- 0.3
Sigma <- outer(1L:p, 1L:p, function(i, j) rho^abs(i - j))
Z <- rcggm(n = n, b0 = b0, X = X, B = B, Sigma = Sigma, probna = 0.05)
out <- cglasso(. ~ ., data = Z)
out
# Model 4: mixed estimator
# Y ~ N(b0 + XB, Sigma) and
# 1. probability of left/right censored values equal to 0.05
# 2. probability of missing-at-random values equal to 0.05
n <- 1000L
p <- 3L
q <- 2L
b0 <- runif(p)
B <- matrix(runif(q * p), nrow = q, ncol = p)
X <- matrix(rnorm(n * q), nrow = n, ncol = q)
rho <- 0.3
Sigma <- outer(1L:p, 1L:p, function(i, j) rho^abs(i - j))
Z <- rcggm(n = n, X = X, b0 = b0, B = B, Sigma = Sigma, probl = 0.05, probr = 0.05,
probna = 0.05)
out <- cglasso(. ~ ., data = Z)
out
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.