circular.sil {CircularSilhouette} | R Documentation |
Calculating Silhouette on Circular Data Clusters
Description
A fast linear-time algorithm to calculate silhouette information on circular data with cluster labels.
Usage
circular.sil(O, cluster, Circumference, method = c("linear", "quadratic"))
Arguments
O |
a numeric vector of circular data points |
cluster |
an integer vector of cluster labels for each point |
Circumference |
a numeric value giving the circumference of the circle |
method |
a character value to specify the algorithm to calculate
the silhouette information. The default value is |
Details
If method
takes the value of "linear"
(default), the
silhouette information on circular data is calculated by a fast
linear-time algorithm; if method
is "quadratic"
,
a quadratic-time algorithm is used instead to calculate silhouette
by definition. There is an overhead of sorting O(n \log n)
if the
input data are not sorted.
One important assumption is that a cluster cannot be contained in another cluster in the input cluster labels.
Value
The function returns a numeric value of the average silhouette information calculated on the input circular data clusters.
Examples
O <- c(-1.2, -2, -3, -2.5, 1, 0.8, 1.5, 1.2)
cluster <- c(1, 1, 1, 1, 2, 2, 2, 2)
circular.sil(O, cluster, 3)