From 00e70f1f4229c8d22b0c967848fb584ed27f579f Mon Sep 17 00:00:00 2001 From: Hugo Gruson <10783929+Bisaloo@users.noreply.github.com> Date: Mon, 29 Apr 2024 20:57:21 +0200 Subject: [PATCH] Check if Inf occurs on lower or upper --- R/extract_param.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/extract_param.R b/R/extract_param.R index 55a37727f..16f9857af 100644 --- a/R/extract_param.R +++ b/R/extract_param.R @@ -214,18 +214,22 @@ extract_param <- function(type = c("percentiles", "range"), if (distribution == "lnorm") { names(param) <- c("meanlog", "sdlog") lower <- c(-1e5, 1e-10) + upper <- c(1e10, 1e10) } if (distribution == "gamma") { names(param) <- c("shape", "scale") lower <- c(1e-10, 1e-10) + upper <- c(1e10, 1e10) } if (distribution == "weibull") { names(param) <- c("shape", "scale") lower <- c(1e-10, 1e-10) + upper <- c(1e10, 1e10) } if (distribution == "norm") { names(param) <- c("mean", "sd") lower <- c(-1e5, 1e-10) + upper <- c(1e10, 1e10) } optim_params <- tryCatch(stats::optim(