2019-12-16 16:36:51 +01:00
|
|
|
#' @title Log Gamma
|
2021-11-10 14:02:35 +01:00
|
|
|
#' @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) {
|
2021-11-10 14:02:35 +01:00
|
|
|
ifelse(x > 0, log(gamma(x)), Inf)
|
2019-12-16 16:36:51 +01:00
|
|
|
}
|