aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2022-11-18 08:37:40 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2022-11-18 08:37:40 +0100
commitdf0cff4b829f1abf62f037591a24a8019174dd0a (patch)
treec43c58070ea2fd122e54e11b938bf7b71bf9fa3e /tests/testthat
parent1ba099d12ece70f77737505c41eaa7fd1c701140 (diff)
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.
Diffstat (limited to 'tests/testthat')
-rw-r--r--tests/testthat/_snaps/multistart/parplot-for-biphasic-saemix-fit.svg2
-rw-r--r--tests/testthat/_snaps/multistart/parplot-for-sfo-fit.svg2
-rw-r--r--tests/testthat/test_multistart.R8
3 files changed, 8 insertions, 4 deletions
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 @@
<circle cx='228.40' cy='269.36' r='8.10' style='stroke-width: 0.75; stroke: #61D04F;' />
<circle cx='270.11' cy='283.47' r='8.10' style='stroke-width: 0.75; stroke: #61D04F;' />
<circle cx='311.83' cy='285.42' r='8.10' style='stroke-width: 0.75; stroke: #61D04F;' />
+<circle cx='353.54' cy='258.25' r='8.10' style='stroke-width: 0.75; stroke: #61D04F;' />
+<circle cx='395.26' cy='-596.36' r='8.10' style='stroke-width: 0.75; stroke: #61D04F;' />
<circle cx='103.26' cy='280.60' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
<circle cx='144.97' cy='281.94' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
<circle cx='186.69' cy='281.42' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
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 @@
<g clip-path='url(#cpNTkuMDR8Njg5Ljc2fDU5LjA0fDUwMi41Ng==)'>
<circle cx='140.80' cy='280.97' r='8.10' style='stroke-width: 0.75; stroke: #61D04F;' />
<circle cx='257.60' cy='281.05' r='8.10' style='stroke-width: 0.75; stroke: #61D04F;' />
+<circle cx='374.40' cy='257.89' r='8.10' style='stroke-width: 0.75; stroke: #61D04F;' />
+<circle cx='491.20' cy='-615.24' r='8.10' style='stroke-width: 0.75; stroke: #61D04F;' />
<circle cx='140.80' cy='280.75' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
<circle cx='257.60' cy='280.67' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
<circle cx='374.40' cy='280.50' r='5.40' style='stroke-width: 0.75; stroke: #DF536B;' />
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

Contact - Imprint