R/logsum.R

Defines functions logsum

Documented in logsum

#' Log of sum of exponentiated log-likelihood
#'
#' @param x vector of log-likelihoods
#'
#' @return return log of the sum of the exponentiated log-likelihoods



logsum <- function(x) {
  log(sum(exp(x - max(x)))) + max(x)
}
lvhoskovec/mmpack documentation built on Aug. 21, 2021, 4:05 p.m.