From 2728910b96f0ec7dd7ccd97fc6c1f6677e5e352d Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Sat, 19 Mar 2022 10:42:07 +0100 Subject: Test saemix without special analytical solutions Also increase the performance a bit (from about 210 s to about 140 s in the case of DFOP with four chains and 300, 100 iterations). --- tests/testthat/test_saemix_parent.R | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/testthat/test_saemix_parent.R b/tests/testthat/test_saemix_parent.R index 340db6f1..731228d9 100644 --- a/tests/testthat/test_saemix_parent.R +++ b/tests/testthat/test_saemix_parent.R @@ -92,3 +92,15 @@ test_that("Parent fits using saemix are correctly implemented", { # HS would likely benefit from implemenation of transformations = "saemix" }) +test_that("We can also use mkin solution methods for saem", { + expect_error(saem(mmkin_dfop_1, quiet = TRUE, transformations = "saemix", solution_type = "analytical"), + "saemix transformations is only supported if an analytical solution is implemented" + ) + skip_on_cran() # This still takes almost 2.5 minutes although we do not solve ODEs + dfop_saemix_3 <- saem(mmkin_dfop_1, quiet = TRUE, transformations = "mkin", + solution_type = "analytical") + distimes_dfop <- endpoints(dfop_saemix_1)$distimes + distimes_dfop_analytical <- endpoints(dfop_saemix_3)$distimes + rel_diff <- abs(distimes_dfop_analytical - distimes_dfop) / distimes_dfop + expect_true(all(rel_diff < 0.01)) +}) -- cgit v1.2.1