kmm: Create an instance of the ['KmmModel'] class

Description Usage Arguments Value Note Author(s) Examples

View source: R/kmm.R

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

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

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).

Value

An instance of the [KmmModel] class.

Note

in KmmModel instance returned, the gram matrix is computed if and only if kernelComputation is TRUE.

Author(s)

Serge Iovleff

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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
## Not run: 
plot(model)

## End(Not run)

MixAll documentation built on Sept. 7, 2019, 3 a.m.