Skip to content

Commit

Permalink
polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Sabanes Bove committed Sep 13, 2023
1 parent d2eaa63 commit 3a4fdf3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 4 additions & 1 deletion R/crmPack-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ globalVariables(c(
"logit<-",
"rho0",
"alpha0",
"delta0",
"alpha1",
"delta1",
"inverse",
"priorCov",
"theta",
Expand Down Expand Up @@ -135,7 +137,8 @@ globalVariables(c(
"ref_dose",
"comp",
"X",
"skel_probs"
"skel_probs",
"is_combo"
))

# nolint end
1 change: 1 addition & 0 deletions _pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ reference:
- LogisticLogNormalSub
- ProbitLogNormal
- ProbitLogNormalRel
- LogisticLogNormalGrouped
- LogisticKadane
- LogisticKadaneBetaGamma
- LogisticNormalMixture
Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test-Model-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -560,21 +560,21 @@ test_that("dose-LogisticLogNormalGrouped works as expected for scalar samples",
model <- .DefaultLogisticLogNormalGrouped()
samples <- h_as_samples(list(alpha0 = 1, delta0 = -1, alpha1 = 1, delta1 = -0.5))

result <- dose(c(1, 30), model, samples, group = "combo")
expect_equal(result, c(0.5, 0.8456), tolerance = 1e-4)
result <- dose(c(0.2, 0.8), model, samples, group = "combo")
expect_equal(result, c(0.0625, 16), tolerance = 1e-4)
})

test_that("dose-LogisticLogNormalGrouped works as expected for vectors", {
model <- .DefaultLogisticLogNormalGrouped()
samples <- h_as_samples(list(
alpha0 = c(1, 2),
delta0 = c(0.5, -0.5),
alpha1 = c(0, 1),
alpha1 = c(0.5, 1),
delta1 = c(1, 0.2)
))

result <- dose(c(1, 30), model, samples, group = c("mono", "combo"))
expect_equal(result, c(0.7311, 0.9962), tolerance = 1e-4)
result <- dose(c(0.4, 0.8), model, samples, group = c("mono", "combo"))
expect_equal(result, c(0.0601, 0.9096), tolerance = 1e-4)
})

## LogisticKadane ----
Expand Down

0 comments on commit 3a4fdf3

Please sign in to comment.