| dbs | R Documentation |
Computes the Density-based Silhouette for a ‘soft’ clustering assignment matrix.
dbs(z,
ztol = 1E-100,
weights = NULL,
summ = c("mean", "median"),
clusters = NULL,
...)
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. |
A list with the following elements:
silvalsA 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.
mswDepending on the value of summ, either the mean or median DBS width.
wmswDepending on the value of summ, either the weighted mean or weighted median DBS width.
When calling MEDseq_fit, the summ argument can be passed via the ... construct, in which case it governs both the dbs and asw criteria.
Keefe Murphy - <keefe.murphy@mu.ie>
Menardi, G. (2011). Density-based silhouette diagnostics for clustering methods. Statistics and Computing, 21(3): 295-308.
MEDseq_fit
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.