QFun | R Documentation |
‘QFun
’ extracts the values of the Q-function from an R object inheriting class ‘cglasso
’.
QFun(object, mle, verbose = FALSE, ...)
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 |
‘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:
n/2 {log det Tht - tr(S Tht) - p log(2 pi)},
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.
‘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 lambda-values used to fit the model. |
nlambda |
the number of lambda-values. |
rho |
the rho-values used to fit the model. |
nrho |
the number of rho-values. |
model |
a description of the fitted model passed through the argument |
Luigi Augugliaro (luigi.augugliaro@unipa.it)
AIC.cglasso
, BIC.cglasso
, cglasso
, cggm
, summary.cglasso
, select.cglasso
and to_graph
.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.