Description Usage Arguments Value Note References Examples
There is a direct correspondence between the inverse covariance matrix and multiple regression \insertCitestephens1998,kwan2014regressionGGMncv. This readily allows for converting the off diagonal elements to regression coefficients, resulting in noncovex penalization for multiple regression modeling.
1 2 |
object |
An Object of class |
... |
Currently ignored. |
A matrix of regression coefficients.
The coefficients can be accessed via coefs[1,]
,
which provides the estimates for predicting the first node.
Further, the estimates are essentially computed with both the outcome and predictors scaled to have mean 0 and standard deviation 1.
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | # data
Y <- GGMncv::ptsd[,1:5]
# correlations
S <- cor(Y)
# fit model
fit <- ggmncv(R = S, n = nrow(Y), progress = FALSE)
# regression
coefs <- coef(fit)
coefs
# no regularization, resulting in OLS
# data
# note: scaled for lm()
Y <- scale(GGMncv::ptsd[,1:5])
# correlations
S <- cor(Y)
# fit model
# note: non reg
fit <- ggmncv(R = S, n = nrow(Y), progress = FALSE, lambda = 0)
# regression
coefs <- coef(fit)
# fit lm
fit_lm <- lm(Y[,1] ~ 0 + Y[,-1])
# ggmncv
coefs[1,]
# lm
as.numeric(coef(fit_lm))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.