| Title: | Parsimonious Ultrametric Gaussian Mixture Models |
|---|---|
| Description: | Parsimonious Ultrametric Gaussian Mixture Models via grouped coordinate ascent (equivalent to EM) algorithm characterized by the inspection of hierarchical relationships among variables via parsimonious extended ultrametric covariance structures. The methodologies are described in Cavicchia, Vichi, Zaccaria (2024) <doi:10.1007/s11222-024-10405-9>, (2022) <doi:10.1007/s11634-021-00488-x> and (2020) <doi:10.1007/s11634-020-00400-z>. |
| Authors: | Giorgia Zaccaria [aut, cre] (ORCID: <https://orcid.org/0000-0001-9119-9104>), Carlo Cavicchia [aut] (ORCID: <https://orcid.org/0000-0003-1816-3521>), Lorenzo Balzotti [aut] (ORCID: <https://orcid.org/0000-0001-6191-9801>), Alexa A. Sochaniwsky [aut] (ORCID: <https://orcid.org/0009-0005-8043-5091>), Paul D. McNicholas [aut] (ORCID: <https://orcid.org/0000-0002-2482-523X>) |
| Maintainer: | Giorgia Zaccaria <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.2 |
| Built: | 2026-06-09 07:07:00 UTC |
| Source: | https://github.com/giorgiazaccaria/pugmm |
The harbour metals data set contains several metal concentration measurements on 60 seaweed samples. Each sample is either of the Padina or Sargassum species and the samples were collected across five cites in Port Jackson (Australia).
data(Harbour_metals)data(Harbour_metals)
A data frame with 60 observations and 7 variables, which are described as follows.
Sample sites (Balls Head, Berrys Bay, Felix Bay, Hermit Bay, Neutral Bay)
Seaweed species (Padina, Sargassum)
Unique labels for replicate samples
Cadmium (g/g)
Chromium (g/g)
Copper (g/g)
Manganese (g/g)
Nickel (g/g)
Lead (g/g)
Zinc (g/g)
Dataset downloaded from Environmental Computing https://environmentalcomputing.net/datasets/Harbour_metals.csv.
Roberts, D.A., Johnston, E.L., Poore, A.G. (2008). Biomonitors and the assessment of ecological impacts: distribution of herbivorous epifauna in contaminated macroalgal beds. Environmental Pollution, 156(2), 489-503.
data(Harbour_metals)data(Harbour_metals)
The data set contains five measurements made on 342 penguins which are classified into three species.
data(penguins)data(penguins)
A data frame with 342 observations and 5 variables, which are described as follows.
Penguin species (Chinstrap, Adélie, or Gentoo)
Culmen length (mm)
Culmen depth (mm)
Flipper length (mm)
Body mass (g)
Data were collected and made available by Dr. Kristen Gorman and the Palmer Station, Antarctica LTER, a member of the Long Term Ecological Research Network. The categorical variables 'island' and 'sex' have been removed from the original dataset, as well as the incomplete observations on the five variables reported herein.
Dataset downloaded from Kaggle https://www.kaggle.com/code/parulpandey/penguin-dataset-the-new-iris.
Gorman, K.B., Williams T.D., Fraser W.R. (2014). Ecological sexual dimorphism and environmental variability within a community of Antarctic penguins (genus Pygoscelis). PLoS ONE, 9(3), e90081.
data(penguins)data(penguins)
pugmm objectPlots for Parsimonious Ultrametric Gaussian Mixture Models results, such as BIC and path diagrams.
## S3 method for class 'pugmm' plot(x, what = NULL, nrow = NULL, ncol = NULL, cluster_names = NULL, ...)## S3 method for class 'pugmm' plot(x, what = NULL, nrow = NULL, ncol = NULL, cluster_names = NULL, ...)
x |
Output from |
what |
A string specifying the type of graph requested. Available choices are:
|
nrow |
Number of rows in the graphical window. A new graphical window is opened every 6 plots, i.e., components of |
ncol |
Number of columns in the graphical window. A new graphical window is opened every 6 plots, i.e., components of |
cluster_names |
String of dimension |
... |
Other graphics parameters. |
No return value since this is a plot method.
data(penguins) x <- scale(penguins[, 2:5]) pugmm.penguins <- pugmm(x, 3, 1) plot.pugmm(pugmm.penguins, what = c("BIC", "Path Diagram"))data(penguins) x <- scale(penguins[, 2:5]) pugmm.penguins <- pugmm(x, 3, 1) plot.pugmm(pugmm.penguins, what = c("BIC", "Path Diagram"))
Model-based clustering via Parsimonious Ultrametric Gaussian Mixture Models. Hierarchical relationships among variables within and between clusters are inspected. The grouped coordinate ascent algorithm is used for the parameter estimation. The optimal model is selected according to BIC.
pugmm( X, G = NULL, m = NULL, normalization = NULL, model = NULL, maxiter = 500, tol = 1e-06, stop = "aitken", rndstart = 1, initG = "kmeans", initm = "ucms", gaussian = "mclust", parallel = FALSE )pugmm( X, G = NULL, m = NULL, normalization = NULL, model = NULL, maxiter = 500, tol = 1e-06, stop = "aitken", rndstart = 1, initG = "kmeans", initm = "ucms", gaussian = "mclust", parallel = FALSE )
X |
( |
G |
Integer (vector) specifying the number of mixture components (default: |
m |
Integer (vector) specifying the number of variable groups (default: |
normalization |
Character string specifying the data transformation. If |
model |
Vector of character strings indicating the model names to be fitted. If |
maxiter |
Integer value specifying the maximum number of iterations of the algorithm (default: |
tol |
Numeric value specifying the tolerance for the convergence criterion (default: |
stop |
Character string specifying the convergence criteria. If "aitken", the Aitken acceleration-based stopping rule is used (default); if "relative", the relative log-likelihood in two sequential iterations is evaluated. |
rndstart |
Integer value specifying the number of random starts (default: |
initG |
Character string specifying the method for the initialization of the unit-component membership. If "kmeans", k-means via RcppArmadillo is used (default). Other options are: "random" for random assignment; "kmeansf" for fuzzy c-means (via the function fcm of the package ppclust). |
initm |
Character string specifying the method for the initialization of the variable-group membership. If "ucms", the multivariate model to be used for obtaining the variable-group membership estimated is the same model.name used for estimating the Parsimonious Ultrametric Gaussian Mixture Model (default); if "random", a random assignment is performed. |
gaussian |
Character string specifying the way to compute the log-likelihood. If "mclust", |
parallel |
A logical value, specifying whether the models should be run in parallel. |
The grouped coordinate ascent algorithm used for the estimation of PUGMMs parameters was demonstrated to be equivalent to an Expectation-Maximization algorithm in the GMM framework (Hathaway, 1986).
An object of class pugmm containing the results of the optimal - according to BIC - Parsimonious Ultrametric Gaussian Mixture Model estimation.
call Matched call.
X Input data matrix.
G Number of components of the best model.
m Number of variable groups of the best model.
label Integer vector of dimension , taking values in . It identifies the unit classification according to the maximum a posteriori of the best model.
pp Numeric vector of dimension containing the prior probabilities for the best model.
mu () numeric matrix containing the component mean vectors (by row) for the best model.
sigma List of dimension containing the () numeric component extended ultrametric covariance matrices for the best model.
V List of dimension containing the () binary variable-group membership matrices for the best model.
Sv List of dimension containing the () numeric diagonal matrices of the group variances for the best model.
Sw List of dimension containing the () numeric diagonal matrices of the within-group covariances for the best model.
Sb List of dimension containing the () numeric hallow matrices of the between-group covariances for the best model.
post () numeric matrix containing the posterior probabilities for the best model.
pm Number of parameters of the best model.
pm.cov Number of covariance parameters of the best model.
pm.free Number of free parameters of the best model (pm - (constraints on + count.constr.SwSb + count.constr.SvSw)).
count.constr.SwSb Number of times the constraint between Sw and Sb has been turned on for the best model.
count.constr.SvSw Number of times the constraint between Sv and Sw has been turned on for the best model.
BIC BIC values for all the fitted models. If BIC is , the model has not been computed since its structure is equal to another model, while if BIC is the solution has a number of clusters .
bic BIC value of the best model.
loglik Log-likelihood of the best model.
loop Random start corresponding to the selected solution of the best model.
iter Number of iterations needed to estimate the best model.
model.name Character string denoting the PUGMM model name of the best model among the ones fitted.
messages Messages.
Cavicchia, C., Vichi, M., Zaccaria, G. (2024) Parsimonious ultrametric Gaussian mixture models. Statistics and Computing, 34, 108.
Cavicchia, C., Vichi, M., Zaccaria, G. (2022) Gaussian mixture model with an extended ultrametric covariance structure. Advances in Data Analysis and Classification, 16(2), 399-427.
Hathaway, R. (1986) Another interpretation of the EM algorithm for mixture distributions. Statistics and Probability Letters, 4(2), 53-56.
pugmm_available_models(), plot.pugmm()
data(penguins) x <- scale(penguins[, 2:5]) pugmm.penguins <- pugmm(x, 3, 1) table(penguins$species, pugmm.penguins$label) pugmm.penguins <- pugmm(x) pugmm.penguins$G pugmm.penguins$m pugmm.penguins$model.namedata(penguins) x <- scale(penguins[, 2:5]) pugmm.penguins <- pugmm(x, 3, 1) table(penguins$species, pugmm.penguins$label) pugmm.penguins <- pugmm(x) pugmm.penguins$G pugmm.penguins$m pugmm.penguins$model.name
Description of the model names used in the PUGMM package.
pugmm_available_models()pugmm_available_models()
The PUGMM model names in the PUGMM package are characterized by four letters:
First letter: it refers to the variable-group membership matrix , which can be equal (E) or free to vary (F) across components.
Second, third, fourth letters: they refer to the matrices of the group variances , the within-group covariances and the between-group covariances , respectively, by indicating if they are unique (U, i.e., equal within and across components), isotropic (I, i.e., equal within components), equal (E, i.e., equal across components) or free to vary across components (F).
Available models in PUGMM, i.e., the thirteen extended ultrametric covariance structures of PUGMM.
Cavicchia, C., Vichi, M., Zaccaria, G. (2024) Parsimonious ultrametric Gaussian mixture models. Statistics and Computing, 34, 108.
pugmm_available_models()pugmm_available_models()
Model-based clustering via Parsimonious Ultrametric Manly Mixture Models. Hierarchical relationships among variables within and between clusters are inspected. The grouped coordinate ascent algorithm is used for the parameter estimation. The optimal model is selected according to BIC.
puMmm( X, G = NULL, m = NULL, lambda = NULL, normalization = NULL, model = NULL, modelselect = "BIC", maxiter = 500, tol = 1e-06, stop = "aitken", rndstart = 1, initG = "ManlyMix", initm = "ucms", seed = 123, parallel = FALSE )puMmm( X, G = NULL, m = NULL, lambda = NULL, normalization = NULL, model = NULL, modelselect = "BIC", maxiter = 500, tol = 1e-06, stop = "aitken", rndstart = 1, initG = "ManlyMix", initm = "ucms", seed = 123, parallel = FALSE )
X |
( |
G |
Integer (vector) specifying the number of mixture components (default: |
m |
Integer (vector) specifying the number of variable groups (default: |
lambda |
( |
normalization |
Character string specifying the data transformation. If |
model |
Vector of character strings indicating the model names to be fitted. If |
modelselect |
Character string indicating the model selection method to be used. If "BIC", the best model is selected according to the BIC (default); if "two-step", the best model is selected according to the two-step model selection method. |
maxiter |
Integer value specifying the maximum number of iterations of the EM algorithm (default: |
tol |
Numeric value specifying the tolerance for the convergence criteria used in the EM algorithm (default: |
stop |
Character string specifying the convergence criteria. If "aitken", the Aitken acceleration-based stopping rule is used (default); if "relative", the relative log-likelihood in two sequential iterations is evaluated. |
rndstart |
Integer value specifying the number of random starts (default: |
initG |
Character string specifying the method for the initialization of the unit-component membership. If "ManlyMix", the |
initm |
Character string specifying the method for the initialization of the variable-group membership. If "ucms", the multivariate model to be used for obtaining the variable-group membership estimated is the same model.name used for estimating the Parsimonious Ultrametric Manly Mixture Model (default); if "random", a random assignment is performed. |
seed |
Numeric value specifying the seed (default: |
parallel |
A logical value, specifying whether the models should be run in parallel. |
The grouped coordinate ascent algorithm used for the estimation of PUMMMs parameters was demonstrated to be equivalent to an Expectation-Maximization (EM) algorithm in the GMM framework (Hathaway, 1986).
An object of class puMmm containing the results of the optimal -according to the model selection criteria- Parsimonious Ultrametric Manly Mixture Model estimation.
call Matched call.
X Input data matrix.
G Number of components of the best model.
m Number of variable groups of the best model.
label Integer vector of dimension , taking values in . It identifies the unit classification according to the maximum a posteriori of the best model.
pp Numeric vector of dimension containing the prior probabilities for the best model.
lambda () numeric matrix containing the component transformation vectors (by row) for the best model.
mu () numeric matrix containing the component mean vectors (by row) for the best model.
sigma List of dimension containing the () numeric component extended ultrametric covariance matrices for the best model.
V List of dimension containing the () binary variable-group membership matrices for the best model.
Sv List of dimension containing the () numeric diagonal matrices of the group variances for the best model.
Sw List of dimension containing the () numeric diagonal matrices of the within-group covariances for the best model.
Sb List of dimension containing the () numeric hallow matrices of the between-group covariances for the best model.
post () numeric matrix containing the posterior probabilities for the best model.
pm Number of parameters of the best model.
pm.cov Number of covariance parameters of the best model.
pm.free Number of free parameters of the best model (pm - (constraints on + count.constr.SwSb + count.constr.SvSw)).
count.constr.SwSb Number of times the constraint between Sw and Sb has been turned on for the best model.
count.constr.SvSw Number of times the constraint between Sv and Sw has been turned on for the best model.
BIC BIC values for all the fitted models. If BIC is , the model has not been computed since its structure is equal to another model, while if BIC is the solution has a number of clusters .
bic BIC value of the best model.
loglik Log-likelihood of the best model.
loop Random start corresponding to the selected solution of the best model.
iter Number of iterations needed to estimate the best model.
model.name Character string denoting the PUGMM model name of the best model among the ones fitted.
messages Messages.
Cavicchia, C., Vichi, M., Zaccaria, G. (2024) Parsimonious ultrametric Gaussian mixture models. Statistics and Computing, 34, 108.
Cavicchia, C., Vichi, M., Zaccaria, G. (2022) Gaussian mixture model with an extended ultrametric covariance structure. Advances in Data Analysis and Classification, 16(2), 399-427.
Hathaway, R. (1986) Another interpretation of the EM algorithm for mixture distributions. Statistics and Probability Letters, 4(2), 53-56.
pugmm(), pugmm_available_models(), plot.pugmm()
data(Harbour_metals) x <- scale(Harbour_metals[,4:10]) ## Not run: results <- puMmm(x, G = 1:4, m = 1:7, model = NULL, modelselect = "two-step") results$G results$m results$model.name table(Harbour_metals$Species, results$label) plot.pugmm(results, what = c("BIC", "Path Diagram")) ## End(Not run)data(Harbour_metals) x <- scale(Harbour_metals[,4:10]) ## Not run: results <- puMmm(x, G = 1:4, m = 1:7, model = NULL, modelselect = "two-step") results$G results$m results$model.name table(Harbour_metals$Species, results$label) plot.pugmm(results, what = c("BIC", "Path Diagram")) ## End(Not run)
Performs a random partition of objects into classes.
rand.member(n.obs, G)rand.member(n.obs, G)
n.obs |
Number of objects |
G |
Number of classes |
No empty classes can occur.
A binary and row-stochastic matrix with rows and columns.
rand.member(10, 3)rand.member(10, 3)
Fit an ultrametric correlation matrix on a nonnegative correlation one.
UCM(R, m, rndstart, maxiter = 100, eps = 1e-06)UCM(R, m, rndstart, maxiter = 100, eps = 1e-06)
R |
( |
m |
Integer specifying the number of variable groups. |
rndstart |
Integer value specifying the number of random starts. |
maxiter |
Integer value specifying the maximum number of iterations of the EM algorithm (default: maxiter = 100). |
eps |
Numeric value specifying the tolerance for the convergence criterion used in the coordinate descent algorithm (default: eps = 1e-6). |
A list with the following elements:
call Matched call.
V Optimal binary and row-stochastic () variable-group membership matrix.
Rt Optimal () ultrametric correlation matrix.
Rw Optimal () within-concept consistency (diagonal) matrix.
Rb Optimal () between-concept correlation matrix.
of Objective function corresponding to the optimal solution.
loop Random start corresponding to the optimal solution.
iter Number of iterations needed to obtain the optimal solution.
Cavicchia, C., Vichi, M., Zaccaria, G. (2020) The ultrametric correlation matrix for modelling hierarchical latent concepts. Advances in Data Analysis and Classification, 14(4), 837-853.
data(penguins) R <- cor(penguins[, 2:5]) UCM(R, 4, 1)data(penguins) R <- cor(penguins[, 2:5]) UCM(R, 4, 1)