Learn R Programming

thamesmix

Implements the truncated harmonic mean estimator (THAMES) of the reciprocal marginal likelihood for uni- and multivariate mixture models using posterior samples and unnormalized log posterior values via reciprocal importance sampling. Reference: Metodiev, Irons, Perrot-Dockès, Latouche & Raftery (2025) <arXiv:2504.21812>.

Installation

You can install the development version of regexcite from GitHub with:

# install.packages("devtools")
devtools::install_github("M-crypto645/thamesmix")

Usage

See the vignette for details.

Copy Link

Version

Install

install.packages('thamesmix')

Monthly Downloads

127

Version

0.1.3

License

GPL (>= 3)

Maintainer

Martin Metodiev

Last Published

July 14th, 2025

Functions in thamesmix (0.1.3)

chisq_find_limit

Determines the hyperparameter of the THAMES for mixtures, as described in Metodiev et al. (2025).
thames_mixtures

THAMES estimator of the reciprocal log marginal likelihood for mixture models
runif_sphere

Uniform sampling on/in sphere
runif_in_ellipsoid

Uniform sampling in ellipsoid
reorder_by_lda

Calculates the function W described in Metodiev et al. (2025).
param_i_qda_linearized

Calculates the function W described in Metodiev et al. (2025).
trunc_quantile

Truncated normal quantiles
calc_shift_mat_simple

Calculate a matrix used to permute the entries of the parameters
extend_param

Extends the parameter to include the last proportion
compute_W_c_volB

Determine the function W, radius c and volume of B from Metodiev et al.(2025)
compute_nobile_identity

Nobile's identity for the marginal likelihood
overlapgraph

Estimator of the overlap graph
melt_sims_simple

Melt array to matrix
get_qda_scaling

Calculates the weights of the function W described in Metodiev et al. (2025).
alltopsorts_recursion

all topological orderings of a DAG
calc_non_I_set

Calculates the set I(G) described in Metodiev et al. (2025) as well as the limit on the complexity of the THAMES associated with it.