Consider a collection of random variables \(X_1, \dots, X_q\) whose distribution is zero-mean multivariate Gaussian with covariance matrix Markov w.r.t. a Directed Acyclic Graph (DAG).
Assuming the underlying DAG is unknown (model uncertainty), a Bayesian method for posterior inference on the joint space of DAG structures and parameters can be implemented.
The proposed method assigns a prior on each DAG structure through independent Bernoulli distributions, \(Ber(w)\), on the 0-1 elements of the DAG adjacency matrix.
Conditionally on a given DAG, a prior on DAG parameters \((D,L)\) (representing a Cholesky-type reparameterization of the covariance matrix) is assigned through a compatible DAG-Wishart prior;
see also function rDAGWishart
for more details.
Posterior inference on the joint space of DAGs and DAG parameters is carried out through a Partial Analytic Structure (PAS) algorithm.
Two steps are iteratively performed for \(s = 1, 2, ...\) : (1) update of the DAG through a Metropolis Hastings (MH) scheme;
(2) sampling from the posterior distribution of the (updated DAG) parameters.
In step (1) the update of the (current) DAG is performed by drawing a new (direct successor) DAG from a suitable proposal distribution. The proposed DAG is obtained by applying a local move (insertion, deletion or edge reversal)
to the current DAG and is accepted with probability given by the MH acceptance rate.
The latter requires to evaluate the proposal distribution at both the current and proposed DAGs, which in turn involves the enumeration of
all DAGs that can be obtained from local moves from respectively the current and proposed DAG.
Because the ratio of the two proposals is approximately equal to one, and the approximation becomes as precise as \(q\) grows, a faster strategy implementing such an approximation is provided with
fast = TRUE
. The latter choice is especially recommended for moderate-to-large number of nodes \(q\).
Output of the algorithm is a collection of \(S\) DAG structures (represented as \((q,q)\) adjacency matrices) and DAG parameters \((D,L)\) approximately drawn from the joint posterior.
The various outputs are organized in \((q,q,S)\) arrays; see also the example below.
If the target is DAG learning only, a collapsed sampler implementing the only step (1) of the MCMC scheme can be obtained
by setting collapse = TRUE
. In this case, the algorithm outputs a collection of \(S\) DAG structures only.
See also functions get_edgeprobs
, get_MAPdag
, get_MPMdag
for posterior summaries of the MCMC output.
Print, summary and plot methods are available for this function. print
provides information about the MCMC output and the values of the input prior hyperparameters. summary
returns, besides the previous information, a \((q,q)\) matrix collecting the marginal posterior probabilities of edge inclusion. plot
returns the estimated Median Probability DAG Model (MPM), a \((q,q)\) heat map with estimated marginal posterior probabilities of edge inclusion, and a barplot summarizing the distribution of the size of DAGs visited by the MCMC.