Description Usage Arguments Details Author(s) References See Also Examples
View source: R/cglasso_S3methods.R
‘The plot.cglasso
’ function produces plots to study the coefficient paths of fitted cglasso models.
1 2 3 4 5 
x 
an R object of class ‘ 
what 
a character or a formula specifying the required plot. If 
penalty 
optional character argument used to specify the tuning parameter needed to plot the conditional coefficient path. Allowed descriptors are ‘ 
given 
an optional vector of integers identifying the conditioning values of the second tuning parameter to be used for the coefficient profile plots of the parameters identified by the input ‘ 
GoF 
a valid goodnessoffit function, such as 
add.labels 
logical value. Should labels be added to the plot? 
matplot.arg1 
a named list with the graphical parameters used to plot the paths of the estimates identified by ‘ 
matplot.arg2 
a named list with the graphical parameters used to plot the paths of the remaining estimates. 
labels.arg 
a named list with the graphical parameters used to plot the labels. 
abline.arg 
a named list with the graphical parameters used to plot the line identifying the optimal tuning parameter value. 
mtext.arg 
a named list with the graphical parameters used to plot the text reported on the third axis. 
save.plot 
a logical variable or a string specifying the path of the directory where plots will be saved. Letting ‘ 
grdev 
the graphics device used to save the required histograms on external files. See ‘ 
grdev.arg 
additional parameters passed to the graphics device specified by ‘ 
digits 
number of digits used to print the value of the second tuning parameter identified by ‘ 
... 
further arguments passed to the chosen goodnessoffit function, such as ‘ 
The function plot.cglasso
produces the coefficient profile plot. The output depends both on the type of fitted model and on the setting of the three main arguments, what
, penalty
and given
. Below we give more details.
If the model fitting function cglasso
is used to fit an l1penalized censored Gaussian graphical model (see first part in Section Example), then the user can specify only the main argument ‘what
’, whereas ‘penalty
’ and ‘given
’ can be omitted. If ‘penalty
’ is specified, then it must be equal to “rho
”. The main argument ‘what
’ is used to specify the estimator that is plotted on the yaxis. In this case, it must be equal to one of the following descriptors:
“Theta
”: the path of the estimated partial correlation coefficients is returned;
“diag(Theta)
”: the path of the diagonal entries of the estimated precision matrix is returned;
“b0
”: the path of the estimated expected values of the response variables is returned;
If a l1penalized conditional censored Gaussian graphical model is fitted (see second part in Section Example), then all the main arguments can be used. In this case:
‘what
’ must be equal to one of the following descriptors:
“Theta
”: the path of the offdiagonal entries of the estimated precision matrix is returned;
“diag(Theta)
”: the path of the estimated partial correlation coefficients is returned;
“b0
”: the path of the estimated intercepts is returned;
“B
”: the path of the estimated regression coefficients is returned for each response variable;
‘penalty
’ is used to specify the tuning parameter that is reported on the xaxis and it must be equal to one of the following descriptors:
“rho
”: the tuning parameter used to penalize the precision matrix;
“lambda
”: the tuning parameter used to penalize the regression coefficient matrix;
‘given
’ is an optional vector of integers used to specify the values of the second tuning parameter. For instance, letting what = "Theta"
, penalty = "rho"
and given = 1
then plot.cglasso
returns the plot of the estimated partial correlation coefficients versus the rhovalues and given the first value of the used lambdavalues. If given
is left unspecified then a sequence of conditional profile plot is returned, a plot for each value of the second tuning parameter.
Optionally, the user can specify a conditional profile plot using a model formula with the following template:
‘what ~ penalty  given
’
For instance, the previous plot can be specified using the following model formula
‘Theta ~ rho  1
’
In this case, the arguments penalty
and given
must be left unspecified whereas what
is used for the model formula (see also examples below).
The optional argument GoF
can be used to identify the nonzero estimates by the output of a goodnessoffit function, such as AIC.cglasso
and BIC.cglasso
. In this case, a vertical red dashed line is used the identify the optimal value of the tuning parameter reported on the xaxis, whereas the path of the identified nonzero estimates is drawn using a solid black line; the remaining paths are drawn using gray dashed lines. This option is disabled if we let ‘GoF = NULL
’, when all the paths are drawn usign solid black lines.
Luigi Augugliaro (luigi.augugliaro@unipa.it)
Augugliaro, L., Abbruzzo, A., and Vinciotti, V. (2020a) <doi: 10.1093/biostatistics/kxy043>. l1Penalized censored Gaussian graphical model. Biostatistics 21, e1–e16.
Augugliaro, L., Sottile, G., and Vinciotti, V. (2020b) <doi: 10.1007/s11222020099457>. The conditional censored graphical lasso estimator. Statistics and Computing 30, 1273–1289.
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/s1122201092197>. Missing values: sparse inverse covariance estimation and an extension to sparse regression. Statistics and Computing 22, 219–235.
cglasso
, AIC.cglasso
and BIC.cglasso
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72  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 < 100L
p < 10L
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)
# coefficient profile plot of the offdiagonal entries of the precision matrix
plot(out, what = "Theta")
# the same as
#plot(out, what = "Theta", penalty = "rho")
# the output of a goodnessoffit function can be used to identify the
# nonzero estimates
plot(out, what = "Theta", GoF = BIC)
# letting 'GoF = NULL' the previous option is disabled
plot(out, what = "Theta", GoF = NULL)
# coefficient profile plot of the diagonal entries of the precision matrix
plot(out, what = "diag(Theta)")
# coefficient profile plot of the expected values of the response variables
plot(out, what = "b0")
################################################################################
# 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 < 100L
p < 10L
q < 5L
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)
# conditional profile plot of the estimater partial correlation coefficients versus
# the used values of the tunin parameter rho and given the first lambdavalue
plot(out, what = "Theta", penalty = "rho", given = 1L)
out$lambda[1L]
lambda.id < c(2, 4)
plot(out, what = "Theta", penalty = "rho", given = lambda.id)
out$lambda[lambda.id]
# in this case a sequence of ten conditional profile plots is returned, tha is a
# plot for each lambdavalue.
plot(out, what = "Theta", penalty = "rho")
# optionally, the user can specify the conditional profile plots using the model
# formula
plot(out, what = Theta ~ rho  lambda.id)
lambda.id
plot(out, what = Theta ~ rho)
# the output of a goodnessoffit function can be used to identify the
# nonzero estimates
plot(out, what = Theta ~ rho  10, GoF = BIC)
# letting 'GoF = NULL' the previous option is disabled
plot(out, what = Theta ~ rho  10, GoF = NULL)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.