Learn R Programming

MixAll (version 1.5.10)

kmm: Create an instance of the [KmmModel] class

Description

This function computes the optimal kernel mixture model (KMM) according to the [criterion] among the number of clusters given in [nbCluster], using the strategy specified in [strategy].

Usage

kmm(
  data,
  nbCluster = 2,
  dim = 10,
  models = "kmm_pk_s",
  kernelName = "Gaussian",
  kernelParameters = c(1),
  kernelComputation = TRUE,
  strategy = kmmStrategy(),
  criterion = "ICL",
  nbCore = 1
)

Value

An instance of the [KmmModel] class.

Arguments

data

frame or matrix containing the data. Rows correspond to observations and columns correspond to variables.

nbCluster

[vector] listing the number of clusters to test.

dim

integer giving the dimension of the Gaussian density. Default is 10.

models

[vector] of model names to run. By default only "kmm_pk_s" is estimated. All the model names are given by the method [kmmNames].

kernelName

string with a kernel name. Possible values: "Gaussian", "polynomial", "Laplace", "linear", "rationalQuadratic_", "Hamming". Default is "Gaussian".

kernelParameters

[vector] with the parameters of the chosen kernel. Default is c(1).

kernelComputation

[logical] parameter. Should be TRUE if the Gram matrix is to be computed (faster but can be memory consuming), FALSE otherwise (times consuming). Default is TRUE. Recall that Gram matrix is a square matrix of size nbSample.

strategy

a [ClusterStrategy] object containing the strategy to run. [kmmStrategy]() 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", "ML". Default is "ICL".

nbCore

integer defining the number of processor to use (default is 1, 0 for all).

Author

Serge Iovleff

Examples

Run this code
## A quantitative example with the famous bulls eye model
data(bullsEye)
## estimate model
model <- kmm( data=bullsEye, nbCluster=2:3, models= "kmm_pk_s")


## get summary
summary(model)
## use graphics functions
if (FALSE) {
plot(model)
}

Run the code above in your browser using DataLab