Learn R Programming

cglasso (version 1.1.2)

aic: Akaike's An Information Criterion

Description

aic’ computes the ‘Akaike Information Criterion’ whereas ‘bic’ computes the ‘Bayesian Information Criterion’.

Usage

aic(object, k = 2)

bic(object)

Arguments

object

an object with class ‘glasso’, ‘ggm’, ‘mglasso’ or ‘mggm’ ‘cglasso’ or ‘cggm’.

k

the penalty per parameter to be used; the default k = 2 is the classical AIC.

Value

aic’ and ‘bic’ return an object with S3 class “gof”, i.e. a list containing the following components:

value_gof

the values of the measure of goodness-of-fit used to evaluate the fitted models.

rho

the values of the tuning parameter used to fit the model.

value

the values of the log-likelihood function or the Q-function.

df

the number of the estimated non-zero parameters, i.e. the number of non-zero partial correlations plus \(2p\).

n

the sample size.

p

the number of variables.

model

the name of the fitted models.

type

the measure of goodness-of-fit used to evaluate the fitted models.

Details

The measure of goodness-of-fit (gof) returned by the functions ‘aic’ and ‘bic’ depends on the class of the fitted model.

If ‘object’ has class ‘glasso’ or ‘ggm’, then ‘aic’ computes the following measure of goodness-of-fit: $$-2\,\mbox{log-likelihood} + k\,\mbox{df},$$ where \(k\) is the penalty per parameter and \(\mbox{df}\) represents the number of parameters in the fitted model. The values of the log-likelihood function are computed using the function loglik. The usual Akaike Information Criterion (AIC) is computed letting \(k = 2\) (default value of the function ‘aic’) whereas the ‘Bayesian Information Criterion’ (BIC) is computed letting \(k = \log(n)\), where \(n\) is the sample size.

If ‘object’ has class ‘mglasso’ or ‘mggm’ ‘cglasso’ or ‘cggm’, then ‘aic’ computes the following measure of goodness-of-fit: $$-2\,Q\mbox{-function} + k\,df,$$ in other words the log-likelihood is replaced with the \(Q\)-function maximized in the M-step of the EM-like algorithm describted in cglasso, mglasso and mle. This measure of goodness-of-fit was proposed in Ibrahim and others (2008) for statistical model with missing-data.

aic’ and ‘bic’ return an object with S3 class ‘gof’ for which are available the method functions ‘print.gof’ and ‘plot.gof’. These method functions are developed with the aim of helping the user in finding the optimal value of the tuning parameter, defined as the \(\rho\)-value minimizing the chosen measure of goodness-of-fit. For this reason, ‘print.gof’ shows also the ranking of the fitted models (the best model is pointed out with an arrow) whereas ‘plot.gof’ point out the optimal \(\rho\)-value by a vertical dashed line (see below for some examples).

References

Ibrahim, J.G., Zhu, H. and Tang, N. (2008). Model selection criteria for missing-data problems using the EM algorithm. Journal of the American Statistical Association 103, 1648--1658.

Sakamoto, Y., Ishiguro, M., and Kitagawa, G. (1986). Akaike Information Criterion Statistics. D. Reidel Publishing Company.

See Also

loglik, cglasso, mglasso, glasso, mle, ebic and the method funtions ‘plot’ and summary.

Examples

Run this code
# NOT RUN {
library("cglasso")
set.seed(123)

#################
# cglasso model #
#################
n <- 100L
p <- 5L
mu <- rep.int(0L, times = p)
X <- rdatacggm(n = n, mu = mu, probr = 0.05)
out <- cglasso(X = X)
out_aic <- aic(out)
out_aic
plot(out_aic)

out_bic <- bic(out)
out_bic
plot(out_bic)

##############
# cggm model #
##############
out_mle <- mle(out)
out_aic <- aic(out_mle)
out_aic
plot(out_aic)

out_bic <- bic(out_mle)
out_bic
plot(out_bic)

#################
# mglasso model #
#################
X <- rnorm(n * p)
na.id <- sample(n * p, size = n * p * 0.05, replace = TRUE)
X[na.id] <- NA
dim(X) <- c(n, p)
out <- mglasso(X)
out_aic <- aic(out)
out_aic
plot(out_aic)

out_bic <- bic(out)
out_bic
plot(out_bic)

##############
# mggm model #
##############
out_mle <- mle(out)
out_aic <- aic(out_mle)
out_aic
plot(out_aic)

out_bic <- bic(out_mle)
out_bic
plot(out_bic)

#################
# glasso model #
#################
X <- matrix(rnorm(n * p), nrow = n, ncol = p)
out <- glasso(X)
out_aic <- aic(out)
out_aic
plot(out_aic)

out_bic <- bic(out)
out_bic
plot(out_bic)

#############
# ggm model #
#############
out_mle <- mle(out)
out_aic <- aic(out_mle)
out_aic
plot(out_aic)

out_bic <- bic(out_mle)
out_bic
plot(out_bic)
# }

Run the code above in your browser using DataLab