| ppc | R Documentation |
Function for executing the partitioned PC (pPC) algorithm, including the option to use the p-value adjacency thresholding (PATH) algorithm.
ppc( x, undirected = FALSE, alpha = NULL, max.sx = NULL, maxp = NULL, path = 1, min_alpha = 1e-05, hgi = FALSE, max_wthn_sx = max.sx, max_btwn_sx = max.sx, max_btwn_nbr = ncol(x) - 2, sort_pval = TRUE, max_groups = 20, true_bn = NULL, cluster = NULL, whitelist = NULL, blacklist = NULL, debug = FALSE )
x, undirected, alpha, max.sx, maxp, path, min_alpha, hgi, max_wthn_sx, max_btwn_sx, max_btwn_nbr, sort_pval, max_groups, true_bn, cluster, whitelist, blacklist, debug |
see |
A Bayesian network as an object of class bn.
Jireh Huang (jirehhuang@ucla.edu) #' @references Huang, J., & Zhou, Q. (2022). Partitioned hybrid learning of Bayesian network structures. Machine Learning. https://doi.org/10.1007/s10994-022-06145-4
bnsl, phgs
## Read Bayesian network object
true_bn <- bnrepository("child")
## Generate data and relevel for simplicity
set.seed(1)
x <- bnlearn::rbn(true_bn, n = 1e4)
x <- as.data.frame(sapply(x, function(x) as.factor(as.integer(x) - 1L)),
stringsAsFactors = TRUE)
## pPC with PATH
bn1 <- ppc(x = x, alpha = 1e-2, max.sx = 3, maxp = 8, path = 10,
min_alpha = 1e-5, sort_pval = TRUE, max_groups = 20,
debug = TRUE)
## PC(-stable) with PATH
bn2 <- ppc(x = x, alpha = 1e-2, max.sx = 3, maxp = 8, path = 10,
min_alpha = 1e-5, sort_pval = TRUE, max_groups = 1,
debug = TRUE)
## pPC with PATH and HGI (no greedy search)
bn3 <- ppc(x = x, alpha = 1e-2, max.sx = 3, maxp = 8, path = 10,
min_alpha = 1e-5, hgi = TRUE, sort_pval = TRUE,
max_groups = 20, debug = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.