QFun {cglasso} | R Documentation |
Extract Q-Function
Description
‘QFun
’ extracts the values of the Q-function from an R object inheriting class ‘cglasso
’.
Usage
QFun(object, mle, verbose = FALSE, ...)
Arguments
object |
an R object inheriting class ‘ |
mle |
logical. Should Q-values be computed using the maximum likelihood estimates? Default depends on the class of the argument |
verbose |
logical for printing out a progress bar on the R console. Default is |
... |
further arguments passed to |
Details
‘QFun
’ returns the value of the Q-function, i.e., the value of the function maximised in the M-step of the EM algorithm. The Q-function is defined as follows:
\frac{n}{2}\left\{\log det\Theta - tr(S\Theta) - p\log(2\pi)\right\},
where S
is the ‘working’ empirical covariance matrix computed during the E-step.
QFun
is used as a workhorse function to compute the measures of goodness-of-fit returned by the functions AIC.cglasso
and BIC.cglasso
.
The function ‘print.QFun
’ is used the improve the readability of the results.
Value
‘QFun
’ returns an R object of S3 class “QFun
”, i.e., a named list containing the following components:
value |
a matrix with the values of the Q-function. |
df |
a matrix with the number of estimated non-zero parameters. |
dfB |
a matrix with the number of estimated non-zero regression coefficients. |
dfTht |
a matrix with the number of estimated non-zero partial correlation coefficients. |
n |
the sample size. |
p |
the number of response variables. |
q |
the number of columns of the design matrix |
lambda |
the |
nlambda |
the number of |
rho |
the |
nrho |
the number of |
model |
a description of the fitted model passed through the argument |
Author(s)
Luigi Augugliaro (luigi.augugliaro@unipa.it)
See Also
AIC.cglasso
, BIC.cglasso
, cglasso
, cggm
, summary.cglasso
, select_cglasso
and to_graph
.
Examples
set.seed(123)
# 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 <- 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(1:p, 1: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)
QFun(out)
out.mle <- cggm(out, lambda.id = 3L, rho.id = 3L)
QFun(out.mle)