| known.graph | R Documentation |
Refits a network with unregularized partial correlations based on some known graph (perhaps estimated with a regularization method) following Hastie, Tibshirani, and Friedman (2008)
known.graph(S, A, method = c("glasso", "HTF"), tol = 0.000001, max.iter = 100)
S |
Matrix. Covariance or correlation matrix |
A |
Adjacency matrix.
Unweighted network structure where |
method |
Character (length = 1).
Whether to use the |
tol |
Numeric (length = 1).
Tolerance for convergence. The algorithm stops when the maximum
absolute change in covariance matrix elements between iterations
is less than |
max.iter |
Numeric (length = 100). Maximum number of iterations to achieve tolerance before stopping |
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 |
Hudson Golino <hfg9s at virginia.edu> and Alexander P. Christensen <alexpaulchristensen@gmail.com>,
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.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.