Learn R Programming

MoEClust R Package

Gaussian Parsimonious Clustering Models

with Gating and Expert Network Covariates

and a Noise Component

Written by Keefe Murphy

Description

Fits MoEClust models introduced by Murphy and Murphy (2020) <doi:10.1007/s11634-019-00373-8>, i.e. fits finite Gaussian mixture of experts models with gating and/or expert network covariates supplied via formula interfaces using a range of parsimonious covariance parameterisations from the GPCM family via the EM/CEM algorithm. Visualisation of the results of such models using generalised pairs plots and the inclusion of an additional noise component is also facilitated.

The most important function in the MoEClust package is: MoE_clust, for fitting the model via EM/CEM with gating and/or expert network covariates, supplied via formula interfaces. MoE_compare is provided for conducting model selection between different results from MoE_clust using different covariate combinations &/or initialisation strategies, etc.

MoE_stepwise is provided for conducting a greedy forward stepwise search to identify the optimal model in terms of the number of components, GPCM covariance type, and the subsets of gating/expert network covariates.

MoE_control allows supplying additional arguments to MoE_clust and MoE_stepwise which govern, among other things, controls on the inclusion of an additional noise component and controls on the initialisation of the allocations for the EM/CEM algorithm.

A dedicated plotting function exists for visualising the results using generalised pairs plots, for examining the gating network, and/or log-likelihood, and/or clustering uncertainties, and/or graphing model selection criteria values. The generalised pairs plots (MoE_gpairs) visualise all pairwise relationships between clustered response variables and associated continuous, categorical, and/or ordinal covariates in the gating &/or expert networks, coloured according to the MAP classification, and also give the marginal distributions of each variable (incl. the covariates) along the diagonal.

An as.Mclust method is provided to coerce the output of class "MoEClust" from MoE_clust to the "Mclust" class, to facilitate use of plotting and other functions for the "Mclust" class within the mclust package. As per mclust, MoEClust also facilitates modelling with an additional noise component (with or without the mixing proportion for the noise component depending on covariates). Finally, a predict method is provided for predicting the fitted response and probability of cluster membership (and by extension the MAP classification) for new data, in the form of new covariates and new response data, or new covariates only.

Other functions also exist, e.g. MoE_crit, MoE_dens, MoE_estep, and aitken, which are all used within MoE_clust but are nonetheless made available for standalone use. The package also contains two data sets: ais and CO2data.

Installation

You can install the latest stable official release of the MoEClust package from CRAN:

install.packages("MoEClust")

or the development version from GitHub:

# If required install devtools:  
# install.packages('devtools')  
devtools::install_github('Keefe-Murphy/MoEClust')

In either case, you can then explore the package with:

library(MoEClust)  
help(MoE_clust) # Help on the main modelling function

For a more thorough intro, the vignette document is available as follows:

vignette("MoEClust", package="MoEClust")

However, if the package is installed from GitHub, the vignette is not automatically created. It can be accessed when installing from GitHub with the code:

devtools::install_github('Keefe-Murphy/MoEClust', build_vignettes = TRUE)

Alternatively, the vignette is available on the package's CRAN page.

References

Murphy, K. and Murphy, T. B. (2020). Gaussian parsimonious clustering models with covariates and a noise component. Advances in Data Analysis and Classification, 14(2): 293--325. <doi:10.1007/s11634-019-00373-8>.

Copy Link

Version

Install

install.packages('MoEClust')

Monthly Downloads

395

Version

1.6.0

License

GPL (>= 3)

Maintainer

Keefe Murphy

Last Published

March 5th, 2025

Functions in MoEClust (1.6.0)

MoE_AvePP

Average posterior probabilities of a fitted MoEClust model
CO2data

GNP and CO2 Data Set
MoE_Uncertainty

Plot Clustering Uncertainties
MoE_Similarity

Plot the Similarity Matrix of a MoEClust Mixture Model
MoE_control

Set control values for use with MoEClust
MoE_crit

MoEClust BIC, ICL, and AIC Model-Selection Criteria
FARI

Compute the Frobenius (adjusted) Rand index
MoE_clust

MoEClust: Gaussian Parsimonious Clustering Models with Covariates and a Noise Component
MoEClust-package

MoEClust: Gaussian Parsimonious Clustering Models with Covariates and a Noise Component
MoE_compare

Choose the best MoEClust model
MoE_news

Show the NEWS file
MoE_mahala

Mahalanobis Distance Outlier Detection for Multivariate Response
MoE_plotLogLik

Plot the Log-Likelihood of a MoEClust Mixture Model
MoE_estep

E-step for MoEClust Models
MoE_entropy

Entropy of a fitted MoEClust model
MoE_cstep

C-step for MoEClust Models
MoE_plotGate

Plot MoEClust Gating Network
MoE_plotCrit

Model Selection Criteria Plot for MoEClust Mixture Models
MoE_gpairs

Generalised Pairs Plots for MoEClust Mixture Models
MoE_dens

Density for MoEClust Mixture Models
expert_covar

Account for extra variability in covariance matrices with expert covariates
force_posiDiag

Force diagonal elements of a triangular matrix to be positive
drop_constants

Drop constant variables from a formula
drop_levels

Drop unused factor levels to predict from unseen data
aitken

Aitken Acceleration
MoE_stepwise

Stepwise model/variable selection for MoEClust models
ais

Australian Institute of Sport data
as.Mclust

Convert MoEClust objects to the Mclust class
quant_clust

Quantile-Based Clustering for Univariate Data
predict.MoE_gating

Predictions from MoEClust gating networks
predict.MoE_expert

Predictions from MoEClust expert networks
noise_vol

Approximate Hypervolume Estimate
predict.MoEClust

Predictions for MoEClust models
plot.MoEClust

Plot MoEClust Results