From 5ec8e1bad1aa7d79ee9c19bdd50be07f81a14278 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 18 Nov 2022 22:11:02 +0100 Subject: Move two saem fits from setup script to skipped tests Save winbuilder/CRAN check time... --- tests/testthat/test_multistart.R | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/testthat/test_multistart.R') diff --git a/tests/testthat/test_multistart.R b/tests/testthat/test_multistart.R index 3a511e06..91ef71f0 100644 --- a/tests/testthat/test_multistart.R +++ b/tests/testthat/test_multistart.R @@ -4,6 +4,7 @@ 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) + anova_sfo <- anova(sfo_saem_1, sfo_saem_1_reduced, best(saem_sfo_s_multi), @@ -13,6 +14,17 @@ test_that("multistart works for saem.mmkin models", { expect_equal(round(anova_sfo, 1)["best(saem_sfo_s_multi)", "AIC"], 1302.2) expect_true(anova_sfo[3, "Pr(>Chisq)"] > 0.2) # Local: 1, win-builder: 0.4 + saem_dfop_sfo_m <- saem(mmkin_dfop_sfo, transformations = "mkin", quiet = TRUE) + dfop_sfo_pop <- attr(ds_dfop_sfo, "pop") + + # k2 is not fitted well (compare saem_dfop_sfo_s in test_mixed.R) + ci_dfop_sfo_s_m <- summary(saem_dfop_sfo_m)$confint_back + no_k1 <- c(1, 2, 3, 5, 6) + no_k2 <- c(1, 2, 3, 4, 6) + expect_true(all(ci_dfop_sfo_s_m[no_k2, "lower"] < dfop_sfo_pop[no_k2])) + expect_true(all(ci_dfop_sfo_s_m[no_k1, "upper"] > dfop_sfo_pop[no_k1])) + + set.seed(123456) saem_dfop_sfo_m_multi <- multistart(saem_dfop_sfo_m, n = 8, cores = n_cores) @@ -28,6 +40,9 @@ test_that("multistart works for saem.mmkin models", { tolerance = 1e-4) skip_on_travis() # Plots are platform dependent + plot_dfop_sfo_saem_m <- function() plot(saem_dfop_sfo_m) + vdiffr::expect_doppelganger("mixed model fit for saem object with mkin transformations", plot_dfop_sfo_saem_m) + llhist_sfo <- function() llhist(saem_sfo_s_multi) parplot_sfo <- function() parplot(saem_sfo_s_multi, ylim = c(0.5, 2)) vdiffr::expect_doppelganger("llhist for sfo fit", llhist_sfo) -- cgit v1.2.1