dbs {MEDseq} | R Documentation |
Compute the Density-based Silhouette
Description
Computes the Density-based Silhouette for a 'soft' clustering assignment matrix.
Usage
dbs(z,
ztol = 1E-100,
weights = NULL,
summ = c("mean", "median"),
clusters = NULL,
...)
Arguments
z |
A numeric matrix such that rows correspond to observations, columns correspond to clusters, and rows sum to |
ztol |
A small (single, numeric, non-negative) tolerance parameter governing whether small assignment probabilities are treated instead as crisp assignments. Defaults to |
weights |
An optional numeric vector giving observation-specific weights for computing the (weighted) mean/median DBS (see |
summ |
A single character string indicating whether the (possibly weighted) |
clusters |
Optional/experimental argument for giving the indicator labels of the cluster assignments. Defaults to the MAP assignment derived from |
... |
Catches unused arguments. |
Value
A list with the following elements:
silvals
A matrix where each row contains the cluster to which each observation belongs in the first column and the observation-specific DBS width in the second column.
msw
Depending on the value of
summ
, either the mean or median DBS width.wmsw
Depending on the value of
summ
, either the weighted mean or weighted median DBS width.
Note
When calling MEDseq_fit
, the summ
argument can be passed via the ...
construct, in which case it governs both the dbs
and asw
criteria.
Author(s)
Keefe Murphy - <keefe.murphy@mu.ie>
References
Menardi, G. (2011). Density-based silhouette diagnostics for clustering methods. Statistics and Computing, 21(3): 295-308.
See Also
Examples
# Generate a toy z matrix
z <- abs(matrix(rnorm(50), ncol=2))
z <- z/rowSums(z)
# Return the median DBS width
dbs(z, summ="median")$msw
# For real sequence data
data(mvad)
mod <- MEDseq_fit(seqdef(mvad[,17:86]), G=11, modtype="UUN", weights=mvad$weight)
dbs(mod$z, weights=mvad$weight)