A general function to estimate Gaussian graphical models using regularization penalties. All non-convex penalties are implemented using the Local Linear Approximation (LLA: Fan & Li, 2001)
network.regularization(
data,
n = NULL,
corr = c("auto", "cor_auto", "cosine", "pearson", "spearman"),
na.data = c("pairwise", "listwise"),
penalty = c("atan", "bridge", "l1", "l2", "lomax", "mcp", "scad", "weibull"),
gamma = NULL,
lambda = NULL,
nlambda = 50,
lambda.min.ratio = 0.01,
penalize.diagonal = TRUE,
optimize.lambda = FALSE,
ic = c("AIC", "AICc", "BIC", "EBIC"),
ebic.gamma = 0.5,
fast = TRUE,
verbose = FALSE,
...
)A network matrix
Matrix or data frame. Should consist only of variables to be used in the analysis
Numeric (length = 1).
Sample size must be provided if data provided is a correlation matrix
Character (length = 1).
Method to compute correlations.
Defaults to "auto".
Available options:
"auto" --- Automatically computes appropriate correlations for
the data using Pearson's for continuous, polychoric for ordinal,
tetrachoric for binary, and polyserial/biserial for ordinal/binary with
continuous. To change the number of categories that are considered
ordinal, use ordinal.categories
(see polychoric.matrix for more details)
"cor_auto" --- Uses cor_auto to compute correlations.
Arguments can be passed along to the function
"cosine" --- Uses cosine to compute cosine similarity
"pearson" --- Pearson's correlation is computed for all
variables regardless of categories
"spearman" --- Spearman's rank-order correlation is computed
for all variables regardless of categories
For other similarity measures, compute them first and input them
into data with the sample size (n)
Character (length = 1).
How should missing data be handled?
Defaults to "pairwise".
Available options:
"pairwise" --- Computes correlation for all available cases between
two variables
"listwise" --- Computes correlation for all complete cases in the dataset
Character (length = 1). Available options:
"atan" --- Arctangent (Wang & Zhu, 2016)
$$\lambda \cdot (\gamma + 2 \pi) \cdot \arctan(\frac{|x|}{\gamma})$$
"bridge" --- Bridge (Fu, 1998)
$$\lambda \cdot |x|^\gamma$$
"l1" --- LASSO (Tibshirani, 1996)
$$\lambda \cdot |x|$$
"l2" --- Ridge (Hoerl & Kennard, 1970)
$$\lambda \cdot x^2$$
"lomax" --- Lomax (Lomax, 1951)
$$\lambda \cdot (1 - (\frac{1}{(|x| + 1)^\gamma}))$$
"mcp" --- Minimax Concave Penalty (Zhang, 2010)
$$
P(x; \lambda, \gamma) =
\begin{cases}
\lambda |x| - \frac{x^2}{2\gamma} & \text{if } |x| \leq \gamma\lambda \\
\frac{\gamma \lambda^2}{2} & \text{if } |x| > \gamma\lambda
\end{cases}
$$
"scad" --- Smoothly Clipped Absolute Deviation (Fan & Li, 2001)
$$
P(x; \lambda, \gamma) =
\begin{cases}
\lambda |x| & \text{if } |x| \leq \lambda \\
-\frac{|x|^2 - 2\gamma\lambda|x| + \lambda^2}{2(\gamma - 1)} & \text{if } \lambda < |x| \leq \gamma\lambda \\
\frac{(\gamma + 1)\lambda^2}{2} & \text{if } |x| > \gamma\lambda
\end{cases}
$$
Numeric (length = 1). Adjusts the shape of the penalty. Defaults:
"atan" = 0.01
"bridge" = 1
"lomax" = 4
"mcp" = 3
"scad" = 3.7
Numeric (length = 1). Adjusts the initial penalty provided to the non-convex penalty function
Numeric (length = 1).
Number of lambda values to test.
Defaults to 100
Numeric (length = 1).
Ratio of lowest lambda value compared to maximal lambda.
Defaults to 0.01
Boolean (length = 1).
Should the diagonal be penalized?
Defaults to FALSE
Boolean (length = 1).
Whether optimization of lambda should be performed.
Defaults to FALSE or grid search over lambda.
If TRUE, then optimize is used
to find the optimal lambda
Character (length = 1). What information criterion should be used for model selection? Available options include:
"AIC" --- Akaike's information criterion: \(-2L + 2E\)
"AICc" --- AIC corrected: \(AIC + \frac{2E^2 + 2E}{n - E - 1}\)
"BIC" --- Bayesian information criterion: \(-2L + E \cdot \log{(n)}\)
"EBIC" --- Extended BIC: \(BIC + 4E \cdot \gamma \cdot \log{(E)}\)
Term definitions:
\(n\) --- sample size
\(p\) --- number of variables
\(E\) --- edges
\(S\) --- empirical correlation matrix
\(K\) --- estimated inverse covariance matrix (network)
\(L = \frac{n}{2} \cdot \log \text{det} K - \sum_{i=1}^p (SK)_{ii}\)
Defaults to "BIC"
Numeric (length = 1)
Value to set gamma parameter in EBIC (see above).
Defaults to 0.50
Only used if ic = "EBIC"
Boolean (length = 1).
Whether the glassoFast version should be used
to estimate the GLASSO.
Defaults to TRUE.
The fast results may differ by less than floating point of the original
GLASSO implemented by glasso and should not impact reproducibility much (set to FALSE if concerned)
Boolean (length = 1).
Whether messages and (insignificant) warnings should be output.
Defaults to FALSE (silent calls).
Set to TRUE to see all messages and warnings for every function call
Additional arguments to be passed on to auto.correlate
Alexander P. Christensen <alexpaulchristensen at gmail.com> and Hudson Golino <hfg9s at virginia.edu>
SCAD penalty and Local Linear Approximation
Fan, J., & Li, R. (2001).
Variable selection via nonconcave penalized likelihood and its oracle properties.
Journal of the American Statistical Association, 96(456), 1348--1360.
Bridge penalty
Fu, W. J. (1998). Penalized regressions: The bridge versus the lasso.
Journal of Computational and Graphical Statistics, 7(3), 397--416.
L2 penalty
Hoerl, A. E., & Kennard, R. W. (1970).
Ridge regression: Biased estimation for nonorthogonal problems.
Technometrics, 12(1), 55--67.
Lomax penalty
Lomax, K. S. (1954).
Business failures: Another example of the analysis of failure data.
Journal of the American Statistical Association, 49(268), 847--852.
L1 penalty
Tibshirani, R. (1996).
Regression shrinkage and selection via the lasso.
Journal of the Royal Statistical Society: Series B (Methodological), 58(1), 267--288.
Atan penalty
Wang, Y., & Zhu, L. (2016).
Variable selection and parameter estimation with the Atan regularization method.
Journal of Probability and Statistics, 2016, 1--12.
Original simulation in psychometric networks
Williams, D. R. (2020).
Beyond lasso: A survey of nonconvex regularization in Gaussian graphical models.
PsyArXiv.
MCP penalty
Zhang, C.-H. (2010).
Nearly unbiased variable selection under minimax concave penalty.
Annals of Statistics, 38(2), 894--942.
# Obtain data
wmt <- wmt2[,7:24]
# Obtain network
l1_network <- network.regularization(data = wmt)
Run the code above in your browser using DataLab