ECMLE

ECMLE is an R package for the Elliptical Covering Marginal Likelihood Estimator. It implements a geometric marginal-likelihood estimator based on posterior draws, log-posterior evaluations, and ellipsoidal coverings of a high-posterior-density region.

The method is described in:

Naderi et al. (2025). Approximating Evidence via Bounded Harmonic Means. https://doi.org/10.48550/arXiv.2510.20617

Installation

install.packages("ECMLE")

Main function

ecmle(post_samples, lps, log_post_fn, hpd_level = 0.75)

Arguments

Minimal example

set.seed(1)
post_samples <- cbind(rnorm(400), rnorm(400))
lps <- apply(post_samples, 1, function(z) sum(dnorm(z, log = TRUE)))
log_post_fn <- function(theta) sum(dnorm(theta, log = TRUE))

fit <- ecmle(
  post_samples = post_samples,
  lps          = lps,
  log_post_fn  = log_post_fn,
  hpd_level    = 0.75
)
print(fit)
plot(fit)

Package contents

License

GPL-3