Skip to content

Commit

Permalink
minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyarz committed Nov 30, 2023
1 parent 94d7b16 commit 922ac4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions R/modelling.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ getModelFitOpt <- function (
ub <- c(Inf, Inf, 1.5 * max(dose_levels), 0.5 * max(dose_levels))
expr_i <- quote(sum((post_combs$means[i, ] - (theta[1] + theta[2] / (1 + exp((theta[3] - dose_levels) / theta[4]))))^2 / (post_combs$vars[i, ])))},
{
stop (GENERAL$ERROR$MODEL_OPTIONS)})
stop ("error")})

simple_fit <- getModelFitSimple(
model = model,
Expand Down Expand Up @@ -225,7 +225,7 @@ predictModelFit <- function (
model_fit$coeffs["eMax"],
model_fit$coeffs["ed50"],
model_fit$coeffs["delta"])},
{stop(GENERAL$ERROR$MODEL_OPTIONS)})
{stop("error")})

return (pred_vals)

Expand Down
4 changes: 2 additions & 2 deletions R/posterior.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ getPosteriorI <- function(
checkmate::check_data_frame(data_i, null.ok = TRUE)
checkmate::check_list(prior_list, names = "named", any.missing = FALSE)
checkmate::check_vector(mu_hat, any.missing = FALSE, null.ok = TRUE)
checkmate::check_double(mu_hat, null.ok = TRUE, lower = -Inf, upper = Inf, len = length(prior_list))
checkmate::check_double(mu_hat, null.ok = TRUE, lower = -Inf, upper = Inf)
checkmate::check_vector(sd_hat, any.missing = FALSE, null.ok = TRUE)
checkmate::check_double(sd_hat, null.ok = TRUE, lower = 0, upper = Inf, len = length(prior_list))
checkmate::check_double(sd_hat, null.ok = TRUE, lower = 0, upper = Inf)

if (is.null(mu_hat) && is.null(sd_hat)) {
checkmate::check_data_frame(data_i, null.ok = FALSE)
Expand Down

0 comments on commit 922ac4e

Please sign in to comment.