Skip to content

Commit

Permalink
- added new if-clause to getPosterior() to check if prior_list is obj…
Browse files Browse the repository at this point in the history
…ect of RBesT package
  • Loading branch information
Schick committed Jul 22, 2024
1 parent 0fe144f commit 820b22b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions R/posterior.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ getPosterior <- function(
checkmate::check_vector(S_hat, any.missing = FALSE, null.ok = TRUE)
checkmate::check_double(S_hat, null.ok = TRUE, lower = 0, upper = Inf)

is_matrix_S_hat <- FALSE

stopifnot("prior_list must be an object of RBesT package" =
all(sapply(prior_list, function(x) is(x, "normMix") | is(x, "betaMix") | is(x, "mix"))))

if (!is.null(mu_hat) && !is.null(S_hat) && is.null(data)) {

if (is.matrix(S_hat)) {
Expand Down Expand Up @@ -142,9 +147,10 @@ getPosteriorI <- function(
} else if (!is.null(mu_hat) && !is.null(se_hat)) {

stopifnot("m_hat length must match number of dose levels" =
length(prior_list) == length(mu_hat),
"se_hat length must match number of dose levels" =
length(prior_list) == length(se_hat))
length(prior_list) == length(mu_hat))
# ,
# "se_hat length must match number of dose levels" =
# length(prior_list) == length(se_hat))

} else {

Expand Down

0 comments on commit 820b22b

Please sign in to comment.