Learn R Programming

PCBN (version 0.1.1)

find_cond_copula_specified: Find among parents of a node, the one that has a conditional copula specified

Description

Find among parents of a node, the one that has a conditional copula specified

Usage

find_cond_copula_specified(DAG, order_hash, v, cond)

Value

a list with

  • a node w such that the conditional copula \(C_{w, v | cond[-v]}\) has been specified in the model.

    If no such node can be found, an error message is raised.

  • the set cond[-v]

Arguments

DAG

Directed Acyclic Graph object corresponding to the model

order_hash

hashmap of orders of the parental sets

v

node in DAG

cond

vector of nodes in DAG. This must not be empty. It is assumed that conditionally independent nodes have already been removed by the function remove_CondInd. It is assumed to have been already sorted.

Examples

Run this code

DAG = create_empty_DAG(3)
DAG = bnlearn::set.arc(DAG, 'U1', 'U3')
DAG = bnlearn::set.arc(DAG, 'U2', 'U3')

order_hash = r2r::hashmap()
order_hash[['U3']] = c("U1", "U2")

find_cond_copula_specified(DAG = DAG, order_hash = order_hash,
                           v = "U3", cond = c("U1"))
# returns "U1" because the copula c_{1,3} is known

find_cond_copula_specified(DAG = DAG, order_hash = order_hash,
                           v = "U3", cond = c("U1", "U2"))
# returns "U2" because the copula c_{2,3|1} is known


Run the code above in your browser using DataLab