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))
mydata = PCBN_sim(my_PCBN, N = 5)
e = default_envir()
ls(e)
C_13 = BiCopCondFit(data = mydata, DAG = DAG, v = "U1", w = "U3",
cond_set = c(), familyset = 1, order_hash = order_hash,
e = e, method = "mle")
C_23_1 = BiCopCondFit(data = mydata, DAG = DAG, v = "U2", w = "U3",
cond_set = "U1", familyset = 1, order_hash = order_hash,
e = e, method = "itau")
U_2_13 = ComputeCondMargin(data = mydata, DAG = DAG,
v = "U2", cond_set = c("U1", "U3"),
familyset = 1, order_hash = order_hash, e = e,
method = "mle")
Run the code above in your browser using DataLab