Learn R Programming

IMIFA R Package

Infinite Mixture of Infinite Factor Analysers

(and related models)

Written by Keefe Murphy

Description

The IMIFA package provides flexible Bayesian estimation of Infinite Mixtures of Infinite Factor Analysers and related models, for nonparametric model-based clustering of high-dimensional data, introduced by Murphy et al. (2020) <doi:10.1214/19-BA1179>. The IMIFA model assumes factor analytic covariance structures within mixture components and simultaneously achieves dimension reduction and clustering without recourse to model selection criteria to choose the number of clusters or cluster-specific latent factors, mostly via efficient Gibbs updates. Model-specific diagnostic tools are also provided, as well as many options for plotting results, conducting posterior inference on parameters of interest, posterior predictive checking, and quantifying uncertainty.

The package also contains three data sets: olive, USPSdigits, and coffee.

Installation

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

install.packages("IMIFA")

or the development version from GitHub:

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

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

library(IMIFA)
help(mcmc_IMIFA) # Help on the main modelling function

Generally, mcmc_IMIFA() is used for running the model and creating a raw results object, on which get_IMIFA_results() is then called to prepare these results for posterior inference. The output of the second call be visualised in many ways using plot.Results_IMIFA().

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

vignette("IMIFA", package="IMIFA")

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/IMIFA', build_vignettes = TRUE)

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

References

Murphy, K., Viroli, C., and Gormley, I. C. (2020). Infinite mixtures of infinite factor analysers. Bayesian Analysis, 15(3): 937--863. <doi:10.1214/19-BA1179>.

Copy Link

Version

Install

install.packages('IMIFA')

Monthly Downloads

417

Version

2.2.0

License

GPL (>= 3)

Maintainer

Keefe Murphy

Last Published

December 12th, 2023

Functions in IMIFA (2.2.0)

heat_legend

Add a colour key legend to heatmap plots
is.cols

Check for Valid Colours
ltrgamma

Left Truncated Gamma Distributions
gumbel_max

Simulate Cluster Labels from Unnormalised Log-Probabilities using the Gumbel-Max Trick
is.posi_def

Check Positive-(Semi)definiteness of a matrix
mat2cols

Convert a numeric matrix to colours
bnpControl

Control settings for the Bayesian Nonparametric priors for infinite mixture models (or shrinkage priors for overfitted mixtures)
mcmc_IMIFA

Adaptive Gibbs Sampler for Nonparametric Model-based Clustering using models from the IMIFA family
get_IMIFA_results

Extract results, conduct posterior inference and compute performance metrics for MCMC samples of models from the IMIFA family
coffee

Chemical composition of Arabica and Robusta coffee samples
olive

Fatty acid composition of Italian olive oils
psi_hyper

Find sensible inverse gamma hyperparameters for variance/uniqueness parameters
plot_cols

Plots a matrix of colours
scores_MAP

Decompose factor scores by cluster
mixfaControl

Control settings for the IMIFA family of factor analytic mixtures
rDirichlet

Simulate Mixing Proportions from a Dirichlet Distribution
mgpControl

Control settings for the MGP prior and AGS for infinite factor models
post_conf_mat

Posterior Confusion Matrix
plot.Results_IMIFA

Plotting output and parameters of inferential interest for IMIFA and related models
pareto_scale

Pareto Scaling
show_IMIFA_digit

Plot the posterior mean image
show_digit

Show image of grayscale grid
shift_GA

Moment Matching Parameters of Shifted Gamma Distributions
sim_IMIFA

Simulate Data from a Mixture of Factor Analysers Structure
storeControl

Set storage values for use with the IMIFA family of models
Zsimilarity

Summarise MCMC samples of clustering labels with a similarity matrix and find the 'average' clustering
IMIFA-package

IMIFA: Infinite Mixtures of Infinite Factor Analysers and Related Models
Ledermann

Ledermann Bound
USPSdigits

USPS handwritten digits
G_priorDensity

Plot Pitman-Yor / Dirichlet Process Priors
Procrustes

Procrustes Transformation
MGP_check

Check the validity of Multiplicative Gamma Process (MGP) hyperparameters
PGMM_dfree

Estimate the Number of Free Parameters in Finite Factor Analytic Mixture Models (PGMM)
G_moments

1st & 2nd Moments of the Pitman-Yor / Dirichlet Processes
IMIFA_news

Show the NEWS file