From 9d013773edc0dc30a98c6218655726d3ad944e3f Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 4 Nov 2022 18:12:03 +0100 Subject: Attempt at automatic setting of random effects Based on parameters in the separate fits that fail the t-test. --- tests/testthat/illparms_hfits_synth_no_ranef_auto.txt | 4 ++++ tests/testthat/print_hfits_synth_no_ranef_auto.txt | 9 +++++++++ tests/testthat/test_mhmkin.R | 14 ++++++++++++-- 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 tests/testthat/illparms_hfits_synth_no_ranef_auto.txt create mode 100644 tests/testthat/print_hfits_synth_no_ranef_auto.txt (limited to 'tests') 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 @@ + 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") + }) -- cgit v1.2.1