Learn R Programming

PCBN (version 0.1.1)

new_PCBN: Initializes PCBN class

Description

Initializes PCBN class

Usage

new_PCBN(DAG, order_hash, copula_mat, verbose = 0)

Value

the new PCBN

Arguments

DAG

the corresponding DAG (a `bn` object)

order_hash

a hashmap of character vectors Each character vector corresponds to the order of the parents for the given node.

copula_mat

a list with at least two components:

  • fam the matrix of families

  • tau the matrix of Kendall's tau

They both should be matrices of size d * d, where d is the number of nodes in the graph DAG.

verbose

If 0, no message is printed. If 1 (recommended), information is printed during the checking of the PCBN.

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")

fam = matrix(c(0, 0, 1,
               0, 0, 1,
               0, 0, 0), byrow = TRUE, ncol = 3)
tau = 0.2 * fam

my_PCBN = new_PCBN(
  DAG, order_hash,
  copula_mat = list(tau = tau, fam = fam))

Run the code above in your browser using DataLab