From df4bad0f4c627736fb532ecf767d071a0d1af834 Mon Sep 17 00:00:00 2001 From: fweber144 Date: Mon, 6 Jan 2025 20:59:03 +0100 Subject: [PATCH] use `log1p()` for numerical stability (in `get_stat()`), see --- R/summary_funs.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/summary_funs.R b/R/summary_funs.R index 6a2a2eed2..db5f500ba 100644 --- a/R/summary_funs.R +++ b/R/summary_funs.R @@ -559,7 +559,7 @@ get_stat <- function(summaries, summaries_baseline = NULL, # log-normal approximation # https://en.wikipedia.org/wiki/Log-normal_distribution#Arithmetic_moments mul <- log(value^2 / sqrt(value_se^2 + value^2)) - varl <- log(1 + value_se^2 / value^2) + varl <- log1p(value_se^2 / value^2) lq <- qnorm(alpha_half, mean = mul, sd = sqrt(varl)) uq <- qnorm(one_minus_alpha_half, mean = mul, sd = sqrt(varl)) # Go back to linear scale