View source: R/hidalgo_postproc.R
clustering | R Documentation |
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.
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, ...)
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 |
list containing the posterior similarity matrix (psm
) and
the estimated partition clust
.
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, \Sexpr[results=rd]{tools:::Rd_expr_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
Hidalgo
, salso
library(salso)
X <- replicate(5,rnorm(500))
X[1:250,1:2] <- 0
h_out <- Hidalgo(X)
clustering(h_out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.