MC3 {bayesloglin}R Documentation

Implementation of the MC3 algorithm

Description

The MC3 algorithm is used to find the log-linear models with the highest posterior probability. The function is capable of searching the space of decomposable, graphical, and hierarchical models.

Usage

MC3 (init = NULL, alpha = 1, iterations = 5000, replicates = 1, data, 
            mode = c("Hierarchical", "Graphical", "Decomposable")) 

Arguments

init

A starting list of models for the MOSS algorithm. If not NULL, this list should consist of R formulas.

alpha

The value of the hyperparameter alpha.

iterations

Number of iterations of the MC3 algorithm

replicates

The number of instances the MC3 algorithm will be run. The top models are culled from the results of all the replicates.

data

A data frame containing the contingency table. All cells must be included in data and the last column must be the cell counts. The number of variables in the contingency table must be at least 3.

mode

The scope of the loglinear model search. The search can be over the space of decomposable, graphical, or hierarchical models.

Value

A data frame with the top models found and their log posterior probability up to a constant.

Author(s)

Matthew Friedlander

References

see vignette

Examples

data(czech)
s1 <- MC3 (init = NULL, alpha = 1, iterations = 5, 
            replicates = 1, data = czech, 
            mode = "Decomposable")
s2 <- MC3 (init = NULL, alpha = 1, iterations = 5, 
            replicates = 1, data = czech, 
            mode = "Graphical")
s3 <- MC3 (init = NULL, alpha = 1, iterations = 5, 
            replicates = 1, data = czech, 
            mode = "Hierarchical")

[Package bayesloglin version 1.0.1 Index]