Skip to content

Commit 9e11291

Browse files
author
Keefe-Murphy
committed
MoE_control gains the arg. exp.init$estart so that the paper's Algorithm 1 can now work as intended: exp.init$estart toggles the behaviour of init.z="random" in the presence of expert covariates when exp.init$mahalanobis=TRUE & nstarts > 1: when FALSE (the default/old behaviour), all random starts are put through the initial reallocation routine and then subjected to full runs of the EM; when TRUE, only the single best random start obtained from this routine is subjected to the full EM.
Tidied verbose argument for some message() calls. CRAN release.
1 parent 1999935 commit 9e11291

File tree

8 files changed

+228
-144
lines changed

8 files changed

+228
-144
lines changed

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: MoEClust
22
Type: Package
3-
Date: 2021-06-21
3+
Date: 2021-10-12
44
Title: Gaussian Parsimonious Clustering Models with Covariates and a Noise Component
5-
Version: 1.4.0
5+
Version: 1.4.1
66
Authors@R: c(person("Keefe", "Murphy", email = "keefe.murphy@mu.ie", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7709-3159")),
77
person("Thomas Brendan", "Murphy", email = "brendan.murphy@ucd.ie", role = "ctb", comment = c(ORCID = "0000-0002-5668-7046")))
88
Description: Clustering via parsimonious Gaussian Mixtures of Experts using the MoEClust models introduced by Murphy and Murphy (2020) <doi:10.1007/s11634-019-00373-8>. This package fits finite Gaussian mixture models with a formula interface for supplying gating and/or expert network covariates 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. A greedy forward stepwise search algorithm is provided for identifying the optimal model in terms of the number of components, the GPCM covariance parameterisation, and the subsets of gating/expert network covariates.
@@ -26,5 +26,5 @@ Suggests:
2626
knitr,
2727
rmarkdown,
2828
snow
29-
RoxygenNote: 7.1.1
29+
RoxygenNote: 7.1.2
3030
VignetteBuilder: knitr

R/Functions.R

Lines changed: 187 additions & 129 deletions
Large diffs are not rendered by default.

R/MoEClust.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#' \itemize{
2525
#' \item{Type: }{Package}
2626
#' \item{Package: }{MoEClust}
27-
#' \item{Version: }{1.4.0}
28-
#' \item{Date: }{2021-06-21 (this version), 2017-11-28 (original release)}
27+
#' \item{Version: }{1.4.1}
28+
#' \item{Date: }{2021-10-12 (this version), 2017-11-28 (original release)}
2929
#' \item{Licence: }{GPL (>=2)}
3030
#' }
3131
#'

R/Plotting_Functions.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#' The result of the subsetting must include at least two variables, whether they be the MAP classification, a response variable, or a covariate, in order to be valid for plotting purposes. The arguments \code{data.ind} and \code{cov.ind} can also be used to simply reorder the panels, without actually subsetting.
1212
#' @param response.type The type of plot desired for the scatterplots comparing continuous response variables. Defaults to \code{"points"}. See \code{scatter.pars} below.
1313
#'
14-
#' Points can also be sized according to their associated clustering uncertainty with the option \code{"uncertainty"}. In doing so, the transparency of the points will also be proportional to their clustering uncertainty, provided the device supports transparency. See also \code{\link{MoE_Uncertainty}} for an alternative means of visualising observation-specific cluster uncertainties (especially for univariate data). See \code{scatter.pars} below.
14+
#' Points can also be sized according to their associated clustering uncertainty with the option \code{"uncertainty"}. In doing so, the transparency of the points will also be proportional to their clustering uncertainty, provided the device supports transparency. See also \code{\link{MoE_Uncertainty}} for an alternative means of visualising observation-specific cluster uncertainties (especially for univariate data). See \code{scatter.pars} below, and note that models fitted via the \code{"CEM"} algorithm will have no associated clustering uncertainty.
1515
#'
1616
#' Alternatively, the bivariate \code{"density"} contours can be displayed (see \code{density.pars}), provided there is at least one Gaussian component in the model. Caution is advised when producing density plots for models with covariates in the expert network; the required number of evaluations of the (multivariate) Gaussian density for each panel (\code{res$G * prod(density.pars$grid.size)}) increases by a factor of \code{res$n}, thus plotting may be slow (particularly for large data sets). See \code{density.pars} below.
1717
#' @param scatter.type A vector of length 2 (or 1) giving the plot type for the upper and lower triangular portions of the plot, respectively, pertaining to the associated covariates. Defaults to \code{"lm"} for covariate vs. response panels and \code{"points"} otherwise. Only relevant for models with continuous covariates in the gating &/or expert network. \code{"ci"} and \code{"lm"} type plots are only produced for plots pairing covariates with response, and never response vs. response or covariate vs. covariate. Note that lines &/or confidence intervals will only be drawn for continuous covariates included in the expert network; to include covariates included only in the gating network also, the options \code{"lm2"} or \code{"ci2"} can be used but this is not generally advisable. See \code{scatter.pars} below.
@@ -389,6 +389,7 @@ MoE_gpairs.MoEClust <- function(res, response.type = c("points", "uncertainty",
389389
} else stop("'scatter.pars$eci.col' must be of length 1 or G", call.=FALSE)
390390
}
391391
if(response.type == "uncertainty") {
392+
if(attr(res, "Algo") == "CEM") message("Model was fitted by CEM and has no clustering uncertainty\n")
392393
uncertainty <- res$uncertainty
393394
uncertainty <- res$uncertainty <- (uncertainty - min(uncertainty))/(diff(range(uncertainty)) + .Machine$double.eps)
394395
bubbleX <- .bubble(uncertainty, cex=c(0.3, 2.8), alpha=c(0.3, 0.8))
@@ -914,6 +915,7 @@ MoE_Uncertainty.MoEClust <- function(res, type = c("barplot", "profile"), truth
914915
}
915916
G <- res$G + noise
916917
if(G == 1) message("No clustering has taken place!\n")
918+
if(attr(res, "Algo") == "CEM") message("Model was fitted by CEM: no uncertainties to plot\n")
917919
oneG <- 1/G
918920
min1G <- 1 - oneG
919921
yx <- unique(c(0, pretty(c(0, min1G))))

inst/NEWS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ __with Gating and Expert Network Covariates__
55
__and a Noise Component__
66
=======================================================
77

8+
## MoEClust v1.4.1 - (_13<sup>th</sup> release [patch update]: 2021-10-12_)
89
### New Features, Improvements, Big Fixes, & Miscellaneous Edits
910
* Various further fixes to `MoE_stepwise`:
1011
* Added the arg. `fullMoE` (defaulting to `FALSE`) which allows restricting the search to "full"
@@ -13,9 +14,14 @@ __and a Noise Component__
1314
now reverts to `"both"` whenever `"all"` would unnecessarily duplicate candidate models.
1415
* Small speed-up if `gating` &/or `expert` have covariates that are already in `initialModel`.
1516
* Small speed-up by searching `G=1` `equalPro` models w/ expert covariates only once.
16-
* Two fixes to handled how `initialModel` and `modelNames` interact:
17+
* Two fixes to handle how `initialModel` and `modelNames` interact:
1718
* It's now assumed (else warned) that `initialModel` should be optimal w.r.t. model type.
1819
* The supplied `modelNames` are augmented with `initialModel$modelName` if needs be.
20+
* `MoE_control` gains the arg. `exp.init$estart` so the paper's Algorithm 1 can work as intended:
21+
`exp.init$estart` toggles the behaviour of `init.z="random"` in the presence of expert covariates
22+
when `exp.init$mahalanobis=TRUE` & `nstarts > 1`: when `FALSE` (the default/old behaviour), all
23+
random starts are put through the initial reallocation routine and then subjected to full runs of the EM;
24+
when `TRUE`, only the single best random start obtained from this routine is subjected to the full EM.
1925
* Handled name mismatches for optional args. w/ `list(...)` defaults in `MoE_control`/`MoE_gpairs`.
2026
* Fixed printing of `noise.gate` in `MoE_compare` for `G=1` models w/ noise & gating covariates.
2127
* Improved checks on `G` in `MoE_clust`.

man/MoEClust-package.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)