Learn R Programming

BGGM (version 1.0.0)

explore: GGMs with Exploratory Bayesian Hypothesis Testing

Description

Learn the conditional (in)dependence structure with the Bayes factor computed from the matrix-F prior distribution. It is possible to test for only positive or negative edges, as well as two sided hypothesis testing (which is the customary approach). Further there is also an exhaustive option that provides the posterior probability of the null, greater than zero, and less than zero.

Usage

explore(Y, prior_sd = 0.25, iter = 5000, cores = 2, ...)

Arguments

Y

data matrix (n by p).

prior_sd

hypothesized standard deviation of the prior distribution.

iter

number of posterior samples.

cores

number of cores for parallel computing. The default is 2, but this can be changed.

...

currently not used

Value

list of class explore:

  • parcors_mat partial correlation matrix

  • parcors_sd partial correlation standard deviations

  • samples list of prior and posterior samples

    • fisher_z_post Fisher z transformed posterior distributions (partial correlations)

    • pcor_post partial correlation posterior distributions (not transformed)

    • inv_cov_post inverse covariance matrix posterior distribution

    • pcor_prior partial correlation prior distribution

    • fisher_z_prior Fisher z transformed prior distributions (partial correlations)

  • delta hyperparameter of matrix-F prior distribution (corresponds to prior_sd)

  • iter number of posterior and prior samples

  • dat data matrix

  • call match.call()

  • p number of variables

  • cores number of cores

  • edge number of estimated edges

Examples

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

# sample posterior
fit <- explore(Y, iter = 500)

# select E
E <- select(fit, BF_cut = 3)

# summarize
summary(E)

# non-zero edges
E$partials_non_zero

# adjacency matrix
E$Adj_10

# null adjacency matrix
E$Adj_01
# }

Run the code above in your browser using DataLab