This function uses the quick-and-dirty Newton-Raftery approximation for log-marginal-density.
logMargDenNRu(ll)
A vector of log-likelihood values (i.e., draws)
A single numeric value representing the log marginal density
Approximation of LMD based on Newton-Raftery. It is not the most accurate, but a very fast method.
logll_values <- c(-4000, -4001, -4002)
logMargDenNRu(logll_values)
#> [1] -4001.309