Title: | Parsimonious Ultrametric Gaussian Mixture Models |
---|---|
Description: | Finite Gaussian mixture models with parsimonious extended ultrametric covariance structures estimated via a grouped coordinate ascent algorithm, which is equivalent to the Expectation-Maximization algorithm. The thirteen ultrametric covariance structures implemented allow for the inspection of different hierarchical relationships among variables. The estimation of an ultrametric correlation matrix is included as a function. The methodologies are described in Cavicchia, Vichi, Zaccaria (2024) <doi:10.1007/s11222-024-10405-9>, Cavicchia, Vichi, Zaccaria (2022) <doi:10.1007/s11634-021-00488-x> and Cavicchia, Vichi, Zaccaria (2020) <doi:10.1007/s11634-020-00400-z>. |
Authors: | Giorgia Zaccaria [aut, cre] |
Maintainer: | Giorgia Zaccaria <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2025-03-11 04:15:58 UTC |
Source: | https://github.com/giorgiazaccaria/pugmm |
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.name
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.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()
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)