clustering {intRinsic} | R Documentation |
Posterior similarity matrix and partition estimation
Description
The function computes the posterior similarity (coclustering) matrix (psm)
and estimates a representative partition of the observations from the MCMC
output. The user can provide the desired number of clusters or estimate a
optimal clustering solution by minimizing a loss function on the space
of the partitions.
In the latter case, the function uses the package salso
(Dahl et al., 2021),
that the user needs to load.
Usage
clustering(
object,
clustering_method = c("dendrogram", "salso"),
K = 2,
nCores = 1,
...
)
## S3 method for class 'hidalgo_psm'
print(x, ...)
## S3 method for class 'hidalgo_psm'
plot(x, ...)
Arguments
object |
object of class |
clustering_method |
character indicating the method to use to perform clustering. It can be
|
K |
number of clusters to recover by thresholding the dendrogram obtained from the psm. |
nCores |
parameter for the |
... |
ignored. |
x |
object of class |
Value
list containing the posterior similarity matrix (psm
) and
the estimated partition clust
.
References
D. B. Dahl, D. J. Johnson, and P. Müller (2022), "Search Algorithms and Loss Functions for Bayesian Clustering", Journal of Computational and Graphical Statistics, doi:10.1080/10618600.2022.2069779.
David B. Dahl, Devin J. Johnson and Peter Müller (2022). "salso: Search Algorithms and Loss Functions for Bayesian Clustering". R package version 0.3.0. https://CRAN.R-project.org/package=salso
See Also
Examples
library(salso)
X <- replicate(5,rnorm(500))
X[1:250,1:2] <- 0
h_out <- Hidalgo(X)
clustering(h_out)