rDAGWishart {BCDAG}  R Documentation 
This function implements a direct sampling from a compatible DAGWishart distribution with parameters a
and U
.
rDAGWishart(n, DAG, a, U)
n 
number of samples 
DAG 

a 
common shape hyperparameter of the compatible DAGWishart, 
U 
position hyperparameter of the compatible DAGWishart, a 
Assume the joint distribution of random variables X_1, \dots, X_q
is zeromean Gaussian with covariance matrix Markov w.r.t. a Directed Acyclic Graph (DAG).
The allied Structural Equation Model (SEM) representation of a Gaussian DAGmodel 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 DAGWishart 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).
A list of two elements: a qxqxn
array collecting n
sampled matrices L
and a qxqxn
array collecting n
sampled matrices D
Federico Castelletti and Alessandro Mascaro
F. Castelletti and A. Mascaro (2021). Structural learning and estimation of joint causal effects among networkdependent variables. Statistical Methods and Applications, Advance publication.
X. Cao, K. Khare and M. Ghosh (2019). Posterior graph selection and estimation consistency for highdimensional Bayesian DAG models. The Annals of Statistics 47 319348.
S. Peluso and G. Consonni (2020). Compatible priors for model selection of highdimensional Gaussian DAGs. Electronic Journal of Statistics 14(2) 4110  4132.
# 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 DAGWishart distribution with parameters a = q and U = diag(1,q)
outDL = rDAGWishart(n = 5, DAG = DAG, a = q, U = diag(1, q))
outDL