Learn R Programming

pchc (version 0.4)

The MMHC Bayesian network learning algorithm: The MMHC Bayesian network learning algorithm

Description

The MMHC Bayesian network learning algorithm.

Usage

mmhc(x, method = "pearson", max_k = 3, alpha = 0.05, robust = FALSE, ini.stat = NULL,
R = NULL, restart = 10, score = "bic-g", blacklist = NULL, whitelist = NULL)

Arguments

x

A numerical matrix with the variables. If you have a data.frame (i.e. categorical data) turn them into a matrix using data.frame.to_matrix. Note, that for the categorical case data, the numbers must start from 0. No missing data are allowed.

method

If you have continuous data, this "pearson". If you have categorical data though, this must be "cat". In this case, make sure the minimum value of each variable is zero. The function "g2Test" in the R package Rfast and the relevant functions work that way.

max_k

The maximum conditioning set to use in the conditional indepedence test (see Details). Integer, default value is 3

alpha

The significance level for assessing the p-values.

robust

Do you want outliers to be removed prior to applying the PCHC algorithm? If yes, set this to TRUE to utilise the MCD.

ini.stat

If the initial test statistics (univariate associations) are available, pass them through this parameter.

R

If the correlation matrix is available, pass it here.

restart

An integer, the number of random restarts.

score

A character string, the label of the network score to be used in the algorithm. If none is specified, the default score is the Bayesian Information Criterion for both discrete and continuous data sets. The available score for continuous variables are: "bic-g" (default), "loglik-g", "aic-g", "bic-g" or "bge". The available score categorical variables are: "bde", "loglik" or "bic".

blacklist

A data frame with two columns (optionally labeled "from" and "to"), containing a set of arcs not to be included in the graph.

whitelist

A data frame with two columns (optionally labeled "from" and "to"), containing a set of arcs to be included in the graph.

Value

A list including:

ini

A list including the output of the mmhc.skel function.

dag

A "bn" class output. A list including the outcome of the Hill-Climbing phase. See the package "bnlearn" for more details.

scoring

The score value.

runtime

The duration of the algorithm.

Details

The MMHC algorithm is implemented without performing the backward elimination during the skeleton identification phase.

References

Tsamardinos I., Brown E.L. and Aliferis F.C. (2006). The max-min hill-climbing Bayesian network structure learning algorithm. Machine Learning 65(1): 31-78.

Tsagris M. (2021). A new scalable Bayesian network learning algorithm with applications to economics. Computational Economics (Accepted for publication).

See Also

fedhc, pchc, mmhc.skel

Examples

Run this code
# NOT RUN {
# simulate a dataset with continuous data
x <- matrix( rnorm(400 * 30, 1, 10), nrow = 400 )
a <- mmhc(x)
# }

Run the code above in your browser using DataLab