ourMELONS/R/log_gamma.R

9 lines
252 B
R
Raw Permalink Normal View History

2019-12-16 16:36:51 +01:00
#' @title Log Gamma
#' @description Equal to log(gamma(x)) with special handling of x < 0 for
2019-12-16 16:36:51 +01:00
#' Matlab compatibility
#' @param x number
#' @return log(gamma(x)) for x > 0, Inf otherwise
log_gamma <- function(x) {
ifelse(x > 0, log(gamma(x)), Inf)
2019-12-16 16:36:51 +01:00
}