rDAGWishart {BCDAG}R Documentation

Random samples from a compatible DAG-Wishart distribution

Description

This function implements a direct sampling from a compatible DAG-Wishart distribution with parameters a and U.

Usage

rDAGWishart(n, DAG, a, U)

Arguments

n

number of samples

DAG

(q, q) adjacency matrix of the DAG

a

common shape hyperparameter of the compatible DAG-Wishart, a > q - 1

U

position hyperparameter of the compatible DAG-Wishart, a (q, q) s.p.d. matrix

Details

Assume the joint distribution of random variables X_1, \dots, X_q is zero-mean Gaussian with covariance matrix Markov w.r.t. a Directed Acyclic Graph (DAG). The allied Structural Equation Model (SEM) representation of a Gaussian DAG-model allows to express the covariance matrix as a function of the (Cholesky) parameters (D,L), collecting the regression coefficients and conditional variances of the SEM.

The DAG-Wishart distribution (Cao et. al, 2019) with shape hyperparameter a = (a_1, ..., a_q) and position hyperparameter U (a s.p.d. (q,q) matrix) provides a conjugate prior for parameters (D,L). In addition, to guarantee compatibility among Markov equivalent DAGs (same marginal likelihood), the default choice (here implemented) a_j = a + |pa(j)| - q + 1 (a > q - 1), with |pa(j)| the number of parents of node j in the DAG, was introduced by Peluso and Consonni (2020).

Value

A list of two elements: a (q,q,n) array collecting n sampled matrices L and a (q,q,n) array collecting n sampled matrices D

Author(s)

Federico Castelletti and Alessandro Mascaro

References

F. Castelletti and A. Mascaro (2021). Structural learning and estimation of joint causal effects among network-dependent variables. Statistical Methods and Applications, Advance publication.

X. Cao, K. Khare and M. Ghosh (2019). Posterior graph selection and estimation consistency for high-dimensional Bayesian DAG models. The Annals of Statistics 47 319-348.

S. Peluso and G. Consonni (2020). Compatible priors for model selection of high-dimensional Gaussian DAGs. Electronic Journal of Statistics 14(2) 4110 - 4132.

Examples

# Randomly generate a DAG on q = 8 nodes with probability of edge inclusion w = 0.2
q = 8
w = 0.2
set.seed(123)
DAG = rDAG(q = q, w = w)
# Draw from a compatible DAG-Wishart distribution with parameters a = q and U = diag(1,q)
outDL = rDAGWishart(n = 5, DAG = DAG, a = q, U = diag(1, q))
outDL

[Package BCDAG version 1.1.1 Index]