Description Usage Arguments Value Author(s) References See Also Examples
Fits a Joint Graphical Lasso model. The lambda 1 and lambda 2 parameters are identified through k-fold crossvalidation. The cost function for the k-fold crossvalidation procedure is the average predictive negative loglikelihood, as defined in Guo et al. (2011, p.5)
1 |
dat |
A dataset that includes the variables on which the gaussian graphical models should be computed, plus an additional factor |
splt |
Character string. The name of the variable in dat that defines different classes |
ncand |
Integer. number of values for lambda 1 and for lambda 2 |
l2max |
Numeric. Maximum value of the lasso parameter lambda2 |
seed |
seed parameter that ensures the exact reproducibility of the results obtained through the k-fold crossvalidation. If Missing the seed is not set (this is good for bootstrapping and similar things) |
k |
number of splits for the k-fold crossvalidation |
ncores |
Number of cores to use. The function is optimized for parallel computing in Windows, parallel computing may not work on other systems. |
aicfun |
|
... |
Other parameters for |
jgl |
The output of |
lambda1 |
the value of lambda 1 that minimizes the output of aicfun |
l1theormax |
the minimal value of lambda 1 that would result in at least one completely disconnected network (all missing edges). Values of lambda 1 > l1theormax are not considered |
l2theormax |
for each candidate value of lambda 1, the minimal value of lambda 2 that would make the networks in the different classes all equal to each other. For each lambda 1, values of lambda 2 > l2theormax are not considered |
aic |
The Akaike Information Criterion (or the output of another function passed to |
Giulio Costantini
Danaher, P., Wang, P., & Witten, D. M. (2014). The joint graphical lasso for inverse covariance estimation across multiple classes. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 76(2), 373-397. http://doi.org/10.1111/rssb.12033 Guo, J., Levina, E., Michailidis, G., & Zhu, J. (2011). Joint estimation of multiple graphical models. Biometrika, 98(1), 1-15. http://doi.org/10.1093/biomet/asq060
JGL
, JGL_AIC_sequentialsearch
, JGL_AIC_widesearch
, JGL_AIC_surfaceplot
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 | ## Not run:
N <- 1000 # sample size
sigma1 <- matrix(c(1, .5, 0, 0,
.5, 1, .2, 0,
0, .2, 1, 0,
0, 0, 0, 1), ncol = 4)
sigma2 <- matrix(c(1, .5, .4, .4,
.5, 1, .2, 0,
.4, .2, 1, 0,
.4, 0, 0, 1), ncol = 4)
dat <- list()
dat[[1]] <- MASS::mvrnorm(n = N, mu = rep(0, ncol(sigma1)), Sigma = sigma1)
dat[[2]] <- MASS::mvrnorm(n = N, mu = rep(0, ncol(sigma2)), Sigma = sigma2)
lapply(dat, function(x) corpcor::cor2pcor(cor(x)))
dat <- data.frame(rbind(dat[[1]], dat[[2]]))
dat$splt <- c(rep(1, N), rep(2, N))
splt <- "splt"
x <- JGL_cv(dat = dat, splt = splt, ncand = 20, l2max = 1, seed = 1, k = 10, ncores = 7, aicfun = AIC)
x
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.