Learn R Programming

GMCM (version 1.1.1)

fit.full.GMCM: Unsupervised clustering using a general GMCM

Description

Perform unsupervised clusering using various optimization procedures to find the maximum likelihood estimate of the general Gaussian mixture copula model by Tewari et al. (2011).

Usage

fit.full.GMCM(u, m, theta = choose.theta(u, m), method = c("NM", "SANN",
  "L-BFGS", "L-BFGS-B", "PEM"), max.ite = 1000, verbose = TRUE, ...)

Arguments

u
An n by d matrix of ranked and scaled test statistics. Rows correspond to observations and columns to the dimensions of the variables.
m
The number of components to be fitted.
theta
A list of parameters as defined in rtheta. If theta is not provided, then heuristic starting values are chosen using the k-means algorithm.
method
A character vector of length $1$. The optimization method used. Should be either "NM", "SANN", "L-BFGS", "L-BFGS-B", or "PEM" which are the Nelder-Mead, Simulated Annealing, limited-memory q
max.ite
The maximum number of iterations. If the method is "SANN" this is the number of interations as there is no other stopping criterion. (See optim)
verbose
Logical. If TRUE, a trace of the parameter estimates is made.
...
Arguments passed to the control-list in optim or PseudoEMAlgorithm if the method is "PEM".

Value

  • A list of parameters formatted as described in rtheta.

Details

The "L-BFGS-B" method does not perform a transformation of the parameters and uses box-contraints as implemented in optim. Note that the many parameter configurations are poorly estimable or directly unidentifiable.

References

Li, Q., Brown, J. B. J. B., Huang, H., & Bickel, P. J. (2011). Measuring reproducibility of high-throughput experiments. The Annals of Applied Statistics, 5(3), 1752-1779. doi:10.1214/11-AOAS466

Tewari, A., Giering, M. J., & Raghunathan, A. (2011). Parametric Characterization of Multimodal Distributions with Non-gaussian Modes. 2011 IEEE 11th International Conference on Data Mining Workshops, 286-292. doi:10.1109/ICDMW.2011.135

See Also

optim, get.prob

Examples

Run this code
set.seed(17)
sim <- SimulateGMCMData(n = 1000, m = 3, d = 2)

# Plotting simulated data
par(mfrow = c(1,2))
plot(sim$z, col = rainbow(3)[sim$K], main = "Latent process")
plot(sim$u, col = rainbow(3)[sim$K], main = "GMCM process")

# Observed data
uhat <- Uhat(sim$u)

# The model should be fitted multiple times using different starting estimates
start.theta <- choose.theta(uhat, m = 3)  # Random starting estimate
res <- fit.full.GMCM(u = uhat, theta = start.theta,
                     method = "NM", max.ite = 3000,
                     reltol = 1e-2, trace = TRUE)  # Note, 1e-2 is too big

# Confusion matrix
Khat <- apply(get.prob(uhat, theta = res), 1, which.max)
table("Khat" = Khat, "K" = sim$K)  # Note, some components have been swapped

# Simulation from GMCM with the fitted parameters
simfit <- SimulateGMCMData(n = 1000, theta = res)

# As seen, the underlying latent process is hard to estimate.
# The clustering, however, is very good.
par(mfrow = c(2,2))
plot(simfit$z, col = simfit$K, main = "Model check 1\nSimulated GMM")
plot(simfit$u, col = simfit$K, main = "Model check 2\nSimulated GMCM")
plot(sim$u, col = Khat, main = "MAP clustering")

Run the code above in your browser using DataLab