Type: Package
Title: Greedy Expected Posterior Loss
Version: 1.2
Date: 2021-08-30
Description: Summarises a collection of partitions into a single optimal partition. The objective function is the expected posterior loss, and the minimisation is performed through a greedy algorithm described in Rastelli, R. and Friel, N. (2017) "Optimal Bayesian estimators for latent variable cluster models" <doi:10.1007/s11222-017-9786-y>.
License: GPL-3
Imports: Rcpp (≥ 0.12.10)
LinkingTo: Rcpp, RcppArmadillo
NeedsCompilation: yes
Packaged: 2021-08-30 12:16:05 UTC; riccardo
Author: Riccardo Rastelli [aut, cre]
Maintainer: Riccardo Rastelli <riccardoras@gmail.com>
Repository: CRAN
Date/Publication: 2021-09-02 15:30:02 UTC

Greedy Expected Posterior Loss

Description

Summarises a collection of partitions into a single optimal partition. The objective function is the expected posterior loss, and the minimisation is performed through a greedy algorithm described in Rastelli, R. and Friel, N. (2017) "Optimal Bayesian estimators for latent variable cluster models" <DOI:10.1007/s11222-017-9786-y>.

Author(s)

Riccardo Rastelli

Mantainer: Riccardo Rastelli <riccardo.rastelli@wu.ac.at>

References

Rastelli, R. and Friel, N. (2017) "Optimal Bayesian estimators for latent variable cluster models" <DOI:10.1007/s11222-017-9786-y>


CollapseLabels

Description

Performs a permutation on the group labels so that, if K non-empty groups are present, the labels used are exactly {1, ..., K}.

Usage

CollapseLabels(decision)

Arguments

decision

A vector identifying a partition. The entries must be positive integers.

Details

The labels of the clustering provided {1,...,G} are mapped into {1,...,K} (K is less or equal than G) based on their order of appearance in the vector provided.

Examples

set.seed(123)
decision <- sample(1:50, 50, TRUE)
CollapseLabels(decision = decision)

MinimiseEPL

Description

Performs greedy optimisation to find the Bayes optimal decision given a collection (sample) of partitions.

Usage

MinimiseEPL(sample_of_partitions, pars = list())

Arguments

sample_of_partitions

A TxN matrix whose rows correspond to partitions of the same N data observations.

pars

A list of additional parameters. See 'Details'.

Details

See Also

CollapseLabels.

Examples

set.seed(123)
N <- 10
niter <- 50
Kup <- 3
sample_of_partitions <- matrix(sample(x = 1:Kup, size = niter*N, replace = TRUE),niter,N)
loss_type = "VI"
output <- MinimiseEPL(sample_of_partitions, list(Kup = Kup, loss_type = loss_type))
output$decision
output$EPL