cggm {cglasso} | R Documentation |
Post-Hoc Maximum Likelihood Refitting of a Conditional Graphical Lasso
Description
‘cggm
’ is used to perform post-hoc maximum likelihood refitting of a selected conditional graphical lasso model with censored and/or missing values.
Usage
cggm(object, GoF = AIC, lambda.id, rho.id, tp.min = 1.0E-6, ntp = 100L,
maxit.em = 1.0E+4, thr.em = 1.0E-3, maxit.bcd = 1.0E+5, thr.bcd = 1.0E-4,
trace = 0L, ...)
Arguments
object |
an R object of S3 class ‘ |
GoF |
a valid goodness-of-fit function, such as |
lambda.id |
an optional integer used to identify a |
rho.id |
an optional integer used to identify a |
tp.min |
the smallest |
ntp |
integer; number 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: |
... |
the penalty parameter passed to the goodness-of-fit function (argument ‘ |
Details
The model-fitting function cggm
is used to obtain the maximum likelihood estimates of a censored Gaussian graphical model whose structure was found by penalised cglasso inference. That is, given a fitted cglasso model, identified along the path via a goodness-of-fit function (passed by GoF
) or via the optional arguments lambda.id
and rho.id
), cggm
computes the maximum likelihood estimates of the parameters with zero constraints associated to the given structure.
Maximum likelihood estimates are computed using cglasso
as workhorse function, that is, cggm
fits a sequence of cglasso models, with length equal to ntp
, reducing \lambda
and \rho
until they are equal to the value ‘min(tp.min, lambda.min, rho.min)
’, where lambda.min
and rho.min
are the smallest \lambda
- and \rho
-values stored in object
. Maximum likelihood estimates are obtained from the last fitted cglasso model.
The model-fitting function cggm
returns an R object inheriting the S3 class ‘cglasso
’, for which all printing and plotting functions, designed for a cglasso
object, can be used (see section ‘See Also
’). Function ShowStructure
can be used to show the structure of the package.
NOTE: if the user tries a problem when the sample size is not large enough, then increase the number of fitted cglasso models (argument ntp
).
Value
cggm
returns an object of S3 class “cggm
”, i.e., a list containing the
following components:
call |
the call that produced this object. |
Yipt |
an array storing the ‘working response matrix’. |
B |
the maximum likelihood estimate of the regression coefficient matrix. |
mu |
the fitted expected values. |
R |
the ‘working residuals’ matrix. |
S |
the ‘working empirical covariance matrix’. |
Sgm |
the maximum likelihood estimate of the covariance matrix. |
Tht |
the maximum likelihood estimate of the precision matrix. |
dfB |
the number of estimated non-zero regression coefficients. Only for internal purpose. |
dfTht |
the number of estimated non-zero (off-diagonal) partial correlation coefficients. Only for internal purpose. |
InfoStructure |
a named list whose elements are used to store the information about the estimated networks. Only for internal purpose. |
nit |
the number of EM steps. |
Z |
the ‘ |
nlambda |
Only for internal purpose. |
lambda |
the |
nrho |
Only for internal purpose. |
rho |
the |
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. |
Author(s)
Luigi Augugliaro (luigi.augugliaro@unipa.it)
See Also
cglasso
, coef.cglasso
, fitted.cglasso
, residuals.cglasso
, predict.cggm
, impute
, AIC.cglasso
, BIC.cglasso
, summary.cglasso
, to_graph
, plot.cglasso2igraph
and ShowStructure
.
Examples
set.seed(123)
# Y ~ N(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 <- 100L
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.5, probna = 0.05)
out <- cglasso(. ~ ., data = Z)
# MLE of the censored Gaussian graphical model identified by 'BIC'
out.mle <- cggm(out, GoF = BIC)
out.mle
# accessor functions
coef(out.mle, drop = TRUE)
fitted(out.mle, drop = TRUE)
residuals(out.mle, type = "working", drop = TRUE)
impute(out.mle, type = "both")
# goodness-of-fit functions
AIC(out.mle)
BIC(out.mle)
summary(out.mle)
# network analysis
out.graph <- plot(out.mle)
out.graph