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