Learn R Programming

BGGM (version 1.0.0)

coef.estimate: Precision Matrix to Multiple Regression

Description

There is a direct correspondence between the covariance matrix and multiple regression. In the case of GGMs, it is possible to estimate the edge set with multiple regression (i.e., neighborhood selection). In *BGGM*, the precision matrix is first sampled from, and then each draws is converted to the corresponding coefficients and error variances. This results in a posterior distribution. This function can be used to perform Bayesian multiple regression.

Usage

# S3 method for estimate
coef(object, node = 1, cred = 0.95, iter = 500, ...)

Arguments

object

object of class estimate (analytic = F)

node

which node to summarize (i.e., the outcome)

cred

credible interval used in the summary output

iter

number of samples used in the conversion.

...

e.g., digits

Value

list of class coef.estimate:

list inv_2_beta:

  • betas posterior samples for the regression coefficients

  • sigma posterior samples for sigma (residual sd)

  • call match.call()

data frame summary_inv_2_beta:

  • summary of regression coefficients

call match.call()

Examples

Run this code
# NOT RUN {
# p = 10
Y <- BGGM::bfi[,1:10]

# sample posterior
fit <- estimate(Y, iter = 5000)

# precision to regression
coefficients(fit, node = 1, cred = 0.95)
# }

Run the code above in your browser using DataLab