Learn R Programming

bnlearn (version 3.4)

relevant: Identify Relevant Nodes Without Learning the Bayesian network

Description

Identify all the nodes relevant to compute all the conditional probability distributions for a given set of nodes.

Usage

relevant(target, context, data, test, alpha, B, debug = FALSE)

Arguments

target
a vector of character strings, the labels of nodes whose conditional probability distributions are of interest.
context
a vector of character strings, the labels of nodes on which to condition the independence tests.
data
a data frame containing either numeric or factor columns.
test
a character string, the label of the conditional independence test to be used in the algorithm. If none is specified, the default test statistic is the mutual information for categorical variables, the Jonckheere-Terpstra test
alpha
a numeric value, the target nominal type I error rate. If none is specified, the default value is 0.05.
B
a positive integer, the number of permutations considered for each permutation test. It will be ignored with a warning if the conditional independence test specified by the test argument is not a permutation test.
debug
a boolean value. If TRUE a lot of debugging output is printed; otherwise the function is completely silent.

Value

  • relevant returns a vector of character strings, the labels of the relevant nodes.

References

Pena JM, Nilsson R, Bjorkegren J, Tegner J (2006). "Identifying the Relevant Nodes Without Learning the Model". In "Proceedings of the 22nd Conference on Uncertainty in Artificial Intelligence (UAI2006)", pp. 367-374.

Examples

Run this code
data(learning.test)
X = as.factor(sample(c("x1", "x2"), nrow(learning.test), replace = TRUE))
relevant("A", data = cbind(learning.test, X))
relevant("A", context = "B", data = learning.test,)

Run the code above in your browser using DataLab