Learn R Programming

PCBN (version 0.1.1)

is_cond_copula_specified: Checks if a given (conditional) copula has already been specified

Description

Checks if a given (conditional) copula has already been specified

Usage

is_cond_copula_specified(DAG, order_hash, w, v, cond)

Value

TRUE if the conditional copula \(C_{w, v | cond}\)

has been specified in the model

Arguments

DAG

Directed Acyclic Graph object corresponding to the model

order_hash

hashmap of orders of the parental sets

w

node in DAG

v

node in DAG

cond

vector of nodes in DAG. 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")

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

is_cond_copula_specified(DAG = DAG, order_hash = order_hash,
                    w = "U2", v = "U3", cond = c())
# returns FALSE because the copula c_{2,3} is not known

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

Run the code above in your browser using DataLab