propose_DAG {BCDAG} | R Documentation |
This function implements a proposal distribution for the MCMC scheme of learn_DAG
.
Given an input DAG
, it first builds the set of all DAGs which can be obtained by applying a local move
(insertion, deletion or reversal of one edge) to DAG
,
that is the set of direct successors of DAG
;
next, it randomly draws one candidate (proposed) DAG from the so-obtained set.
Finally, the set of direct successors of the proposed DAG is constructed.
The function returns: the proposed DAG, the type of operator applied to DAG
to obtain the proposed DAG
(with value 1 if insertion, 2 if deletion, 3 if reversal),
the nodes involved in the local move, the number of direct successors of DAG
and of the proposed DAG.
If fast = TRUE
the two numbers of direct successors are approximated by the number of possible operators that can be applied to the DAGs
(equal for the two graphs)
propose_DAG(DAG, fast)
DAG |
Adjacency matrix of the current DAG |
fast |
boolean, if |
A list containing the (q,q)
adjacency matrix of the proposed DAG, the type of applied operator (with values in {1,2,3}
), the numerical labels of the nodes involved in the move, the integer number of direct successors of DAG
and of the proposed DAG