The `ggm_search` function performs a Bayesian graph search to identify the most probable graph structure (MAP solution) using the Metropolis-Hastings algorithm. It also computes an optional Bayesian Model Averaged (BMA) solution across the graph structures sampled during the search.
ggm_search(
x,
n = NULL,
method = "mc3",
prior_prob = 0.3,
iter = 5000,
stop_early = 1000,
bma_mean = TRUE,
seed = NULL,
progress = TRUE,
...
)
A list containing the MAP graph structure, BMA solution (if specified), and posterior probabilities of the sampled graphs.
Data, either raw data or covariance matrix
For x = covariance matrix, provide number of observations
mc3 defaults to MH sampling
Prior prbability of sparseness.
Number of iterations #@param burn_in Burn in. Defaults to iter/2
Default to 1000. Stop MH algorithm if proposals keep being rejected (stopping by default after 1000 rejections).
Compute Bayesian Model Averaged solution
Set seed. Current default is to set R's random seed.
Show progress bar, defaults to TRUE
Not currently in use
Donny Williams and Philippe Rast
This function is ideal for exploring the graph space and obtaining an initial estimate of the graph structure or adjacency matrix.
To refine the results or compute posterior distributions of graph parameters
(e.g., partial correlations), use the bma_posterior
function,
which builds on the output of `ggm_search` to account for parameter uncertainty.
bma_posterior