aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/test_irls.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2018-09-21 17:52:01 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2018-09-21 17:52:01 +0200
commitf50e716f52c88a9b4767031d1eb62817fba7dce5 (patch)
tree78edcfc623911eb01ce70d5fd070e02dd5060417 /tests/testthat/test_irls.R
parentb12e80a875d87f790d67a4e5a50d829060316a18 (diff)
Skip long running test on travis to avoid timeout
Diffstat (limited to 'tests/testthat/test_irls.R')
-rw-r--r--tests/testthat/test_irls.R17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/testthat/test_irls.R b/tests/testthat/test_irls.R
index 5e09912f..72ab5111 100644
--- a/tests/testthat/test_irls.R
+++ b/tests/testthat/test_irls.R
@@ -107,11 +107,18 @@ test_that("Reweighting method 'tc' works", {
sdfunc = function(x) sigma_twocomp(x, 0.5, 0.07),
n = 15, reps = 1000, digits = 5, LOD = -Inf)
- time_met_2_15_tc_15 <- system.time(
- f_met_2_15_tc_e4 <- mmkin(list(m_synth_DFOP_lin), d_met_2_15, quiet = TRUE,
- reweight.method = "tc", reweight.tol = 1e-4,
- cores = if (Sys.getenv("TRAVIS") != "") 1 else 15)
- )
+ # For a single fit, we get a relative error of less than 30% in the error
+ # model components
+ f_met_2_tc_e4 <- mkinfit(m_synth_DFOP_lin, d_met_2_15[[1]], quiet = TRUE,
+ reweight.method = "tc", reweight.tol = 1e-4)
+ parm_errors_met_2_tc_e4 <- (f_met_2_tc_e4$tc_fitted - c(0.5, 0.07)) / c(0.5, 0.07)
+ expect_true(all(abs(parm_errors_met_2_tc_e4) < 0.3))
+
+ # Doing more takes a lot of computing power
+ skip_on_travis()
+ f_met_2_15_tc_e4 <- mmkin(list(m_synth_DFOP_lin), d_met_2_15, quiet = TRUE,
+ reweight.method = "tc", reweight.tol = 1e-4,
+ cores = 14)
parms_met_2_15_tc_e4 <- apply(sapply(f_met_2_15_tc_e4, function(x) x$bparms.optim), 1, mean)
parm_errors_met_2_15_tc_e4 <- (parms_met_2_15_tc_e4[names(parms_DFOP_lin_optim)] -

Contact - Imprint