Learn R Programming

PCBN (version 0.1.1)

find_interfering_v_from_B_sets: Find all interfering v-structures for a given collection of B-sets

Description

Find all interfering v-structures for a given collection of B-sets

Usage

find_interfering_v_from_B_sets(B_sets)

Value

NULL if there is no interfering v-structures. Else, it returns a data.frame with 4 columns

  • A: a list of children of v

  • B: a list of children of v, disjoint from A

  • parents.A.but.not.parents.B: a list of common parents of nodes of A, that are not parents of nodes of B

  • parents.B.but.not.parents.A: a list of common parents of nodes of B, that are not parents of nodes of A

Each line correspond to 1 interfering v-structure.

Arguments

B_sets

a boolean matrix with (2 + length(children)) columns and length(parents) rows. They are assumed to be sorted in increasing order of row sums, i.e. by increasing order of set cardinality. Typically, this will be the output of find_B_sets_v for some node v.

Examples

Run this code
DAG = create_empty_DAG(7)
DAG = bnlearn::set.arc(DAG, 'U1', 'U5')
DAG = bnlearn::set.arc(DAG, 'U2', 'U5')
DAG = bnlearn::set.arc(DAG, 'U3', 'U5')
DAG = bnlearn::set.arc(DAG, 'U4', 'U5')

DAG = bnlearn::set.arc(DAG, 'U1', 'U6')
DAG = bnlearn::set.arc(DAG, 'U5', 'U6')
DAG = bnlearn::set.arc(DAG, 'U2', 'U7')
DAG = bnlearn::set.arc(DAG, 'U5', 'U7')

B_sets = find_B_sets_v(DAG, v = 'U5')
find_interfering_v_from_B_sets(B_sets)

# Adding the missing arc
DAG = bnlearn::set.arc(DAG, 'U1', 'U7')
# Now no interfering v-structure
B_sets = find_B_sets_v(DAG, v = 'U5')
find_interfering_v_from_B_sets(B_sets)

Run the code above in your browser using DataLab