Skip to content

Commit

Permalink
Fix bug (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-umana authored Nov 14, 2024
1 parent f477b09 commit 5215001
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ geometric_mean <- function(
w_positive <- length(x_positive) / n_x
x_negative <- x[x < 0]
w_negative <- length(x_negative) / n_x
gm_positive <- exp(sum(log(x_positive)))
gm_negative <- -1 * exp(sum(log(abs(x_negative))))
gm_positive <- exp(mean(log(x_positive)))
gm_negative <- -1 * exp(mean(log(abs(x_negative))))
gm <- w_positive * gm_positive + w_negative * gm_negative
} else if (method == "optimized") {
# The formula is:
Expand Down

0 comments on commit 5215001

Please sign in to comment.