aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2022-11-04 18:12:03 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2022-11-04 18:12:03 +0100
commit9d013773edc0dc30a98c6218655726d3ad944e3f (patch)
tree4776d72b2fe2e5bddd97249fcff040db668d6936 /tests
parent85cb80385bb26f40d1c1a40bbda457dd29c4cc23 (diff)
Attempt at automatic setting of random effects
Based on parameters in the separate fits that fail the t-test.
Diffstat (limited to 'tests')
-rw-r--r--tests/testthat/illparms_hfits_synth_no_ranef_auto.txt4
-rw-r--r--tests/testthat/print_hfits_synth_no_ranef_auto.txt9
-rw-r--r--tests/testthat/test_mhmkin.R14
3 files changed, 25 insertions, 2 deletions
diff --git a/tests/testthat/illparms_hfits_synth_no_ranef_auto.txt b/tests/testthat/illparms_hfits_synth_no_ranef_auto.txt
new file mode 100644
index 00000000..a64ed222
--- /dev/null
+++ b/tests/testthat/illparms_hfits_synth_no_ranef_auto.txt
@@ -0,0 +1,4 @@
+ error
+degradation const tc
+ SFO sd(parent_0)
+ FOMC b.1
diff --git a/tests/testthat/print_hfits_synth_no_ranef_auto.txt b/tests/testthat/print_hfits_synth_no_ranef_auto.txt
new file mode 100644
index 00000000..9af1cbcd
--- /dev/null
+++ b/tests/testthat/print_hfits_synth_no_ranef_auto.txt
@@ -0,0 +1,9 @@
+<mhmkin> object
+Status of individual fits:
+
+ error
+degradation const tc
+ SFO OK OK
+ FOMC OK OK
+
+OK: Fit terminated successfully
diff --git a/tests/testthat/test_mhmkin.R b/tests/testthat/test_mhmkin.R
index 9fd29c50..93333ac1 100644
--- a/tests/testthat/test_mhmkin.R
+++ b/tests/testthat/test_mhmkin.R
@@ -38,12 +38,22 @@ test_that("Multiple hierarchical kinetic models can be fitted and diagnosed", {
expect_known_output(print(test_summary, digits = 1),
"summary_hfit_sfo_tc.txt")
- # It depends on the platform exactly which of the
- # SFO datasets fail to converge with FOMC
+ # It depends on the platform exactly which of the datasets fail to converge
+ # with FOMC, because they were generated to be SFO
skip_on_travis()
expect_known_output(
print(fits_synth_const),
"print_fits_synth_const.txt")
+ hfits_no_ranef_auto <- update(hfits, no_random_effect = "auto", auto_ranef_threshold = 2)
+
+ expect_known_output(
+ print(hfits_no_ranef_auto),
+ "print_hfits_synth_no_ranef_auto.txt")
+
+ expect_known_output(
+ print(illparms(hfits_no_ranef_auto)),
+ "illparms_hfits_synth_no_ranef_auto.txt")
+
})

Contact - Imprint