Learn R Programming

rtkpp (version 0.8.5)

clusterDiagGaussian: Create an instance of the [ClusterDiagGaussian] class

Description

This function computes the optimal diagonal Gaussian mixture model according to the [criterion] among the list of model given in [modelNames] and the number of clusters given in [nbCluster], using the strategy specified in [strategy].

Usage

clusterDiagGaussian(data, nbCluster = 2,
  modelNames = clusterDiagGaussianNames(), strategy = clusterFastStrategy(),
  criterion = "ICL")

Arguments

data
frame or matrix containing the data. Rows correspond to observations and columns correspond to variables. If the data set contains NA values, they will be estimated during the estimation process.
nbCluster
[vector] listing the number of clusters to test.
modelNames
[vector] of model names to run. By default all diagonal Gaussian models are estimated. All the model names are given by the method [clusterDiagGaussianN
strategy
a [ClusterStrategy] object containing the strategy to run. clusterStrategy() method by default.
criterion
character defining the criterion to select the best model. The best model is the one with the lowest criterion value. Possible values: "BIC", "AIC", "ICL". Default is "ICL".

Value

  • An instance of the [ClusterDiagGaussian] class.

Examples

Run this code
## A quantitative example with the famous geyser data set
data(geyser)
## add 10 missing values
x = geyser;
x[round(runif(5,1,nrow(geyser))), 1] <- NA
x[round(runif(5,1,nrow(geyser))), 2] <- NA
## with default values
model <- clusterDiagGaussian(data=x, nbCluster=2:3, strategy = clusterFastStrategy())

## use graphics functions
plot(model)

## get summary
summary(model)
## print model
print(model)
## get estimated missing values
missingValues(model)

Run the code above in your browser using DataLab