Learn R Programming

rebmix (version 2.16.0)

EMMIX-methods: EM Algorithm for Univariate or Multivariate Finite Mixture Estimation

Description

Returns as default the EM algorithm output for mixtures of conditionally independent normal, lognormal, Weibull, gamma, Gumbel, binomial, Poisson, Dirac or von Mises component densities. If model equals "REBMVNORM" output for mixtures of multivariate normal component densities with unrestricted variance-covariance matrices is returned.

Usage

# S4 method for REBMIX
EMMIX(model = "REBMIX", Dataset = list(), 
       Theta = NULL, EMcontrol = NULL, ...)
## ... and for other signatures

Value

Returns an object of class REBMIX or REBMVNORM.

Arguments

model

see Methods section below.

Dataset

a list of length \(n_{\mathrm{D}}\) of data frames of size \(n \times d\) containing d-dimensional datasets. Each of the \(d\) columns represents one random variable. Numbers of observations \(n\) equal the number of rows in the datasets.

Theta

an object of class EMMIX.Theta or EMMVNORM.Theta.

EMcontrol

an object of class EM.Control.

...

currently not used.

Methods

signature(model = "REBMIX")

a character giving the default class name "REBMIX" for mixtures of conditionally independent normal, lognormal, Weibull, gamma, Gumbel, binomial, Poisson, Dirac or von Mises component densities.

signature(model = "REBMVNORM")

a character giving the class name "REBMVNORM" for mixtures of multivariate normal component densities with unrestricted variance-covariance matrices.

Author

Branislav Panic

References

B. Panic, J. Klemenc, M. Nagode. Improved initialization of the EM algorithm for mixture model parameter estimation. Mathematics, 8(3):373, 2020. tools:::Rd_expr_doi("10.3390/math8030373").

Examples

Run this code
if (FALSE) {
devAskNewPage(ask = TRUE)

# Load faithful dataset.

data(faithful)

# Plot faithfull dataset.

plot(faithful)

# Number of dimensions.

d <- ncol(faithful)

# Obtain 2 component solution with Gaussian mixtures.

c <- 2

# Create EMMVNORM.Theta object with new call.

Theta <- new("EMMVNORM.Theta", d = d, c = c)

# Set parameters of Theta.
# Weights.

a.w(Theta) <- c(0.5, 0.5)

# Means.

a.theta1.all(Theta) <- c(2.0, 55.0, 4.5, 80.0)

# Covariances.

a.theta2.all(Theta) <- c(1, 0, 0, 1, 1, 0, 0, 1)

# Run EMMIX method.

model <- EMMIX(model = "REBMVNORM", Dataset = list(faithful), Theta = Theta)

# show.

model

# summary.

summary(model)

# plot.

plot(model, nrow = 3, ncol = 2, what = c("pdf", "marginal pdf", "marginal cdf"))

# Create EMMIX.Theta object with new call.

Theta <- new("EMMIX.Theta", c = c, pdf = c("normal", "normal"))

# Set parameters of Theta.
# Weights.

a.w(Theta) <- c(0.5, 0.5)

# Means.

a.theta1.all(Theta) <- c(2.0, 55.0, 4.5, 80.0)

# Covariances.

a.theta2.all(Theta) <- c(1, 1, 1, 1)

# Run EMMIX method.

model <- EMMIX(Dataset = list(faithful), Theta = Theta)

# show.

model

# summary.

summary(model)

# plot.

plot(model, nrow = 3, ncol = 2, what = c("pdf", "marginal pdf", "marginal cdf"))
}

Run the code above in your browser using DataLab