Description Usage Arguments Examples
This function checks whether a certain direction of the edges is possible. It first check whether the direction alone causes any more v-structures. Then, it applies the MEC-Rules of the pcalg algorithm, and checks whether this causes any more v-structures. If both don't cause more v-structures, the direction is allowed.
1 | is_direction_possible(pdag, v_structures)
|
pdag |
|
v_structures |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (pdag, v_structures)
{
possible_direction <- TRUE
pdag_v <- number_v_nodes(pdag)
if (v_structures != pdag_v) {
possible_direction <- FALSE
}
if (possible_direction) {
pdag <- apply_mec_rules(pdag)
pdag_v <- number_v_nodes(pdag)
if (v_structures != pdag_v) {
possible_direction <- FALSE
}
}
return(possible_direction)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.