I'm attempting to perform two versions of Pearson's X2 test on a network.
Here is the code i'm running:
library(bnlearn)
library(Rgraphviz)
library(gRain)
library(graph)
library(grid)
library(snow)
dag <- empty.graph(names(alarm))
modelstring(dag) <- paste("[HIST|LVF][CVP|LVV][PCWP|LVV][HYP][LVV|HYP:LVF]",
"[LVF][STKV|HYP:LVF][ERLO][HRBP|ERLO:HR][HREK|ERCA:HR][ERCA][HRSA|ERCA:HR]",
"[ANES][APL][TPR|APL][ECO2|ACO2:VLNG][KINK][MINV|INT:VLNG][FIO2]",
"[PVS|FIO2:VALV][SAO2|PVS:SHNT][PAP|PMB][PMB][SHNT|INT:PMB][INT]",
"[PRSS|INT:KINK:VTUB][DISC][MVS][VMCH|MVS][VTUB|DISC:VMCH]",
"[VLNG|INT:KINK:VTUB][VALV|INT:VLNG][ACO2|VALV][CCHL|ACO2:ANES:SAO2:TPR]",
"[HR|CCHL][CO|HR:STKV][BP|CO:TPR]", sep = "")
alarm.gs <- gs(alarm, test = "x2")
alarm.mc <- gs(alarm, test = "mc-x2", B=10000)
The x2 test runs, but the mc-x2 test staals.
I hope someone will assist in solving it.