logLik.kmeans {segmenTier} | R Documentation |
Experimental: AIC/BIC for kmeans
Description
This function is supposed to provide a log-likelihood method for
kmeans
results, after Neal Fultz at
https://stackoverflow.com/a/33202188 and also featured in the
stackoverflow package. Note, that the blogged version on Jan 30, 2019 adds
a minus and a division by 2 compared to a linked git version.
This idea has not been reviewed, and this function has not been
tested extensively; feel free to do so and contribute your results.
Usage
## S3 method for class 'kmeans'
logLik(object, ...)
Arguments
object |
a |
... |
unused |
Details
This is an attempt to reproduce the BIC
measure
in model-based clustering to decide on an optimal number of clusters.
This function will be used for kmeans
results objects when passed to BIC
and
AIC
functions from the stats package in
base R, and BIC and AIC are calculated this way in
segmentClusters
. It is however not used anywhere at the
moment.