Refits a network with unregularized partial correlations based on some known graph (perhaps estimated with a regularization method) following Hastie, Tibshirani, and Friedman (2008)
Usage
known.graph(S, A, method = c("glasso", "HTF"), tol = 0.000001, max.iter = 100)Arguments
- S
Matrix. Covariance or correlation matrix
- A
Adjacency matrix. Unweighted network structure where
1is an edge present and0is an edge absent- method
Character (length = 1). Whether to use the
glassomethod without penalization or the HTF (Haste, Tibshirani, & Friedman, 2008) method. Defaults to"glasso", which tends to be more robust- tol
Numeric (length = 1). Tolerance for convergence. The algorithm stops when the maximum absolute change in covariance matrix elements between iterations is less than
tol. Defaults to1e-06- max.iter
Numeric (length = 100). Maximum number of iterations to achieve tolerance before stopping
Value
Returns a list containing:
- network
Estimated network
- W
Estimated covariance matrix
- Theta
Estimated inverse covariance matrix
- iterations
Number of iterations to converge (or maximum if it did not)
- converged
Whether the algorithm converged
References
HTF Implementation on p. 631–634
Hastie, T., Tibshirani, R., & Friedman, J. (2008).
The elements of statistical learning: Data mining, inference, and prediction (2nd ed.).
New York, NY: Springer.
Author
Hudson Golino <hfg9s at virginia.edu> and Alexander P. Christensen <alexpaulchristensen@gmail.com>,
Examples
# Obtain data
wmt <- depression[,24:44]
# Obtain correlation matrix
wmt_R <- auto.correlate(wmt)
# Estimate network
wmt_network <- network.estimation(wmt_R, n = nrow(wmt))
# Obtain adjacency
wmt_A <- wmt_network
wmt_A[] <- ifelse(wmt_A != 0, 1, 0)
# Obtain unregularized estimate
wmt_unreg <- known.graph(S = wmt_R, A = wmt_A)