R/logmeanexp.R

Defines functions logmeanexp

Documented in logmeanexp

# vim: set noexpandtab tabstop=2:
#' Mean of Numbers in Log-Scale
#'
#' Mean of Numbers in Log-Scale
#'
#' @param x a numeric vector
#' @keywords math
logmeanexp=function(x) {
	mx=max(x)
	log(mean(exp(x-mx)))+mx
}

Try the brt package in your browser

Any scripts or data that you put into this service are public.

brt documentation built on May 2, 2019, 10:22 a.m.