There is a direct correspondence between the inverse covariance matrix and multiple regression (Kwan 2014; Stephens 1998) . This readily allows for converting the GGM paramters to regression coefficients. All data types are supported.
# S3 method for estimate coef(object, iter = NULL, progress = TRUE, ...)
object | An Object of class |
---|---|
iter | Number of iterations (posterior samples; defaults to the number in the object). |
progress | Logical. Should a progress bar be included (defaults to |
... | Currently ignored. |
An object of class coef
, containting two lists.
betas
A list of length p, each containing a p - 1 by iter
matrix of
posterior samples
object
An object of class estimate
(the fitted model).
Kwan CC (2014).
“A regression-based interpretation of the inverse of the sample covariance matrix.”
Spreadsheets in Education, 7(1), 4613.
Stephens G (1998).
“On the Inverse of the Covariance Matrix in Portfolio Analysis.”
The Journal of Finance, 53(5), 1821--1827.
# \donttest{ # note: iter = 250 for demonstrative purposes ######################### ### example 1: binary ### ######################### # data Y <- women_math[1:500, ] # fit model fit <- estimate(Y, type = "binary", iter = 250, progress = FALSE) # summarize the partial correlations reg <- coef(fit, progress = FALSE) # summary summ <- summary(reg) summ#> BGGM: Bayesian Gaussian Graphical Models #> --- #> Type: binary #> Formula: ~ 1 #> --- #> Call: #> estimate(Y = Y, type = "binary", iter = 250, progress = FALSE) #> --- #> Coefficients: #> #> 1: #> Node Post.mean Post.sd Cred.lb Cred.ub #> 2 0.161 0.112 -0.052 0.363 #> 3 0.726 0.159 0.398 0.996 #> 4 -0.048 0.077 -0.204 0.084 #> 5 0.077 0.084 -0.071 0.241 #> 6 -0.135 0.111 -0.354 0.086 #> #> 2: #> Node Post.mean Post.sd Cred.lb Cred.ub #> 1 0.148 0.106 -0.051 0.330 #> 3 -0.755 0.124 -0.984 -0.480 #> 4 0.084 0.086 -0.081 0.257 #> 5 -0.330 0.084 -0.521 -0.191 #> 6 0.047 0.076 -0.102 0.181 #> #> 3: #> Node Post.mean Post.sd Cred.lb Cred.ub #> 1 0.383 0.094 0.202 0.541 #> 2 -0.435 0.087 -0.603 -0.254 #> 4 0.136 0.072 0.009 0.288 #> 5 -0.241 0.079 -0.449 -0.097 #> 6 0.211 0.092 0.011 0.364 #> #> 4: #> Node Post.mean Post.sd Cred.lb Cred.ub #> 1 -0.063 0.103 -0.297 0.112 #> 2 0.112 0.115 -0.111 0.344 #> 3 0.319 0.161 0.020 0.640 #> 5 -0.258 0.098 -0.412 -0.047 #> 6 0.004 0.074 -0.139 0.134 #> #> 5: #> Node Post.mean Post.sd Cred.lb Cred.ub #> 1 0.087 0.095 -0.073 0.289 #> 2 -0.384 0.099 -0.625 -0.221 #> 3 -0.489 0.151 -0.781 -0.185 #> 4 -0.223 0.086 -0.360 -0.040 #> 6 -0.057 0.077 -0.195 0.080 #> #> 6: #> Node Post.mean Post.sd Cred.lb Cred.ub #> 1 -0.171 0.139 -0.433 0.104 #> 2 0.062 0.103 -0.166 0.251 #> 3 0.496 0.217 0.025 0.833 #> 4 0.006 0.075 -0.136 0.154 #> 5 -0.068 0.096 -0.279 0.090 #># }