Skip to content

Commit

Permalink
Check if Inf occurs on lower or upper
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisaloo committed Apr 30, 2024
1 parent 089f388 commit 1adcd95
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/extract_param.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 1adcd95

Please sign in to comment.