aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/test_saemix_parent.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2022-10-17 10:28:54 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2022-10-17 10:28:54 +0200
commitb848fb360aa865c37298ee7526344b5280c700cc (patch)
treef1403f49672e01baf5f6b6475db6a383b0d60bee /tests/testthat/test_saemix_parent.R
parentc03fa5d4e57033869cb437c1154da31abd96fc50 (diff)
SFORB in saem, update for mhmkin and multistart
Diffstat (limited to 'tests/testthat/test_saemix_parent.R')
-rw-r--r--tests/testthat/test_saemix_parent.R15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/testthat/test_saemix_parent.R b/tests/testthat/test_saemix_parent.R
index ce776bf7..0579f22f 100644
--- a/tests/testthat/test_saemix_parent.R
+++ b/tests/testthat/test_saemix_parent.R
@@ -101,6 +101,21 @@ test_that("Parent fits using saemix are correctly implemented", {
rel_diff_2 <- (s_dfop_s2$confint_back[, "est."] - dfop_pop) / dfop_pop
expect_true(all(rel_diff_2 < 0.2))
+ # We use constant error for SFORB because tc is overparameterised (b.1 is ill-defined in saem)
+ mmkin_sforb_2 <- mmkin("SFORB", ds_dfop, quiet = TRUE, error_model = "const", cores = n_cores)
+ sforb_saemix_1 <- saem(mmkin_sforb_2, quiet = TRUE,
+ no_random_effect = c("parent_free_0", "k_parent_free_bound"),
+ transformations = "saemix")
+ sforb_saemix_2 <- saem(mmkin_sforb_2, quiet = TRUE,
+ no_random_effect = c("parent_free_0", "log_k_parent_free_bound"),
+ transformations = "mkin")
+ expect_equal(
+ log(endpoints(dfop_saemix_1)$distimes[1:2]),
+ log(endpoints(sforb_saemix_1)$distimes[1:2]), tolerance = 0.01)
+ expect_equal(
+ log(endpoints(sforb_saemix_1)$distimes[1:2]),
+ log(endpoints(sforb_saemix_2)$distimes[1:2]), tolerance = 0.01)
+
mmkin_hs_1 <- mmkin("HS", ds_hs, quiet = TRUE, error_model = "const", cores = n_cores)
hs_saem_1 <- saem(mmkin_hs_1, quiet = TRUE)
hs_saem_2 <- saem(mmkin_hs_1, quiet = TRUE, transformations = "mkin")

Contact - Imprint