From df0cff4b829f1abf62f037591a24a8019174dd0a Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 18 Nov 2022 08:37:40 +0100 Subject: Pass error.init to saemix_model, show in parplot Due to an oversight, error.init was not really passed to saemix_model in saem.mmkin. The new initial values were reverted to c(1, 1), in order to avoid changing the test results. Initial values for error model parameters are now shown in parplot.multistart. --- .../_snaps/multistart/parplot-for-biphasic-saemix-fit.svg | 2 ++ tests/testthat/_snaps/multistart/parplot-for-sfo-fit.svg | 2 ++ tests/testthat/test_multistart.R | 8 ++++---- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/testthat/_snaps/multistart/parplot-for-biphasic-saemix-fit.svg b/tests/testthat/_snaps/multistart/parplot-for-biphasic-saemix-fit.svg index c0332fd5..7017908e 100644 --- a/tests/testthat/_snaps/multistart/parplot-for-biphasic-saemix-fit.svg +++ b/tests/testthat/_snaps/multistart/parplot-for-biphasic-saemix-fit.svg @@ -173,6 +173,8 @@ + + diff --git a/tests/testthat/_snaps/multistart/parplot-for-sfo-fit.svg b/tests/testthat/_snaps/multistart/parplot-for-sfo-fit.svg index f3373901..18eb7fcc 100644 --- a/tests/testthat/_snaps/multistart/parplot-for-sfo-fit.svg +++ b/tests/testthat/_snaps/multistart/parplot-for-sfo-fit.svg @@ -89,6 +89,8 @@ + + diff --git a/tests/testthat/test_multistart.R b/tests/testthat/test_multistart.R index 98d3fb6d..502cee98 100644 --- a/tests/testthat/test_multistart.R +++ b/tests/testthat/test_multistart.R @@ -3,16 +3,16 @@ context("Multistart method for saem.mmkin models") test_that("multistart works for saem.mmkin models", { skip_on_cran() # Save CRAN time set.seed(123456) - saem_sfo_s_multi <- multistart(sfo_saem_1_reduced, n = 8, cores = n_cores, - no_random_effect = "parent_0") + saem_sfo_s_multi <- multistart(sfo_saem_1_reduced, n = 8, cores = n_cores) anova_sfo <- anova(sfo_saem_1, sfo_saem_1_reduced, best(saem_sfo_s_multi), test = TRUE ) # On winbuilder, sfo_saem_1 gives an AIC of 1310.8, while we get 1311.7 - # locally on Linux and Windows. The other, well-determined fits - # both give 1309.7 + # locally (using saemix 3.2, which likely makes the difference due to the + # error parameter patch) on Linux and Windows. The other, well-determined + # fits both give 1309.7. expect_equal(round(anova_sfo, 1)["sfo_saem_1_reduced", "AIC"], 1309.7) expect_equal(round(anova_sfo, 1)["best(saem_sfo_s_multi)", "AIC"], 1309.7) expect_true(anova_sfo[3, "Pr(>Chisq)"] > 0.2) # Local: 1, CRAN: 0.4 -- cgit v1.2.1