aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/test_mixed.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-12-10 09:24:35 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2020-12-10 09:24:35 +0100
commitc58c14078f6a30c22863b7b9730f4afc39db4577 (patch)
tree89b9f1f42aa1a97240e130b3e3d6ceed2399aa1c /tests/testthat/test_mixed.R
parentb8b60ef92c605e862294fd29c51e20e31e0ded81 (diff)
Add a test for saemix with deSolve
But skip the test as it takes too long to always run
Diffstat (limited to 'tests/testthat/test_mixed.R')
-rw-r--r--tests/testthat/test_mixed.R17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/testthat/test_mixed.R b/tests/testthat/test_mixed.R
index 7798be8a..05632c6f 100644
--- a/tests/testthat/test_mixed.R
+++ b/tests/testthat/test_mixed.R
@@ -122,17 +122,24 @@ test_that("saem results are reproducible for biphasic fits", {
expect_known_output(print(test_summary, digits = 2), "summary_saem_biphasic_s.txt")
dfop_sfo_pop <- as.numeric(dfop_sfo_pop)
+ no_k1 <- c(1, 2, 3, 5, 6)
+ no_k2 <- c(1, 2, 3, 4, 6)
+
ci_dfop_sfo_s_s <- summary(saem_biphasic_s)$confint_back
expect_true(all(ci_dfop_sfo_s_s[, "lower"] < dfop_sfo_pop))
expect_true(all(ci_dfop_sfo_s_s[, "upper"] > dfop_sfo_pop))
- # The following does not work, as k1 and k2 are not fitted well
+ # k1 and k2 are not fitted well
ci_dfop_sfo_s_m <- summary(saem_biphasic_m)$confint_back
- # expect_true(all(ci_dfop_sfo_s_m[, "lower"] < dfop_sfo_pop))
- # expect_true(all(ci_dfop_sfo_s_m[, "upper"] > dfop_sfo_pop))
+ expect_true(all(ci_dfop_sfo_s_m[no_k2, "lower"] < dfop_sfo_pop[no_k2]))
+ expect_true(all(ci_dfop_sfo_s_m[no_k1, "upper"] > dfop_sfo_pop[no_k1]))
- # Somehow this does not work at the moment. But it took forever (~ 10 min) anyways...
- #saem_biphasic_2 <- saem(mmkin_biphasic, solution_type = "deSolve", quiet = TRUE)
+ skip("Fitting with saemix takes around 10 minutes when using deSolve")
+ saem_biphasic_2 <- saem(mmkin_biphasic, solution_type = "deSolve", quiet = TRUE)
+ # As with the analytical solution, k1 and k2 are not fitted well
+ ci_dfop_sfo_s_d <- summary(saem_biphasic_2)$confint_back
+ expect_true(all(ci_dfop_sfo_s_d[no_k2, "lower"] < dfop_sfo_pop[no_k2]))
+ expect_true(all(ci_dfop_sfo_s_d[no_k1, "upper"] > dfop_sfo_pop[no_k1]))
})

Contact - Imprint