aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/test_error_models.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-05-29 15:03:04 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2020-05-29 15:03:04 +0200
commit510436646b1bdd5b8cfab70be29334bd3cc9c828 (patch)
tree4b3e26f658e822e18d09e2d939a5c89214566b6d /tests/testthat/test_error_models.R
parent609bfe2fd7ecbdcad5f5d641f0db51541dcd6a4e (diff)
Warn if standardized residuals are unlikely normal
This revealed a bug in the data returned in mkinfit$data in the case of the d_3 algorithm, which also affected the residual plot - the data from the direct fitting was not returned even if this was the better method.
Diffstat (limited to 'tests/testthat/test_error_models.R')
-rw-r--r--tests/testthat/test_error_models.R17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/testthat/test_error_models.R b/tests/testthat/test_error_models.R
index 2dfb2e37..169001f1 100644
--- a/tests/testthat/test_error_models.R
+++ b/tests/testthat/test_error_models.R
@@ -15,36 +15,37 @@ test_that("Error model 'tc' works", {
test_that("The different error model fitting methods work for parent fits", {
skip_on_cran()
- f_9_OLS <- mkinfit("SFO", experimental_data_for_UBA_2019[[9]]$data,
- quiet = TRUE)
+ test_9 <- experimental_data_for_UBA_2019[[9]]$data
+
+ f_9_OLS <- mkinfit("SFO", test_9, quiet = TRUE)
expect_equivalent(round(AIC(f_9_OLS), 2), 137.43)
f_9_parms_const <- parms(f_9_OLS)
- f_9_direct <- mkinfit("SFO", experimental_data_for_UBA_2019[[9]]$data,
+ f_9_direct <- mkinfit("SFO", test_9,
error_model = "tc", error_model_algorithm = "direct", quiet = TRUE)
expect_equivalent(round(AIC(f_9_direct), 2), 134.94)
f_9_parms_tc_direct <- parms(f_9_direct)
- f_9_twostep <- mkinfit("SFO", experimental_data_for_UBA_2019[[9]]$data,
+ f_9_twostep <- mkinfit("SFO", test_9,
error_model = "tc", error_model_algorithm = "twostep", quiet = TRUE)
expect_equivalent(parms(f_9_twostep), f_9_parms_tc_direct, tolerance = 1e-5)
- f_9_threestep <- mkinfit("SFO", experimental_data_for_UBA_2019[[9]]$data,
+ f_9_threestep <- mkinfit("SFO", test_9,
error_model = "tc", error_model_algorithm = "threestep", quiet = TRUE)
expect_equivalent(round(AIC(f_9_threestep), 2), 139.43)
expect_equivalent(parms(f_9_threestep)[1:3], f_9_parms_const)
- f_9_fourstep <- mkinfit("SFO", experimental_data_for_UBA_2019[[9]]$data,
+ f_9_fourstep <- mkinfit("SFO", test_9,
error_model = "tc", error_model_algorithm = "fourstep", quiet = TRUE)
expect_equivalent(round(AIC(f_9_fourstep), 2), 139.43)
expect_equivalent(parms(f_9_fourstep)[1:3], f_9_parms_const)
- f_9_IRLS <- mkinfit("SFO", experimental_data_for_UBA_2019[[9]]$data,
+ f_9_IRLS <- mkinfit("SFO", test_9,
error_model = "tc", error_model_algorithm = "IRLS", quiet = TRUE)
expect_equivalent(round(AIC(f_9_IRLS), 2), 139.43)
expect_equivalent(parms(f_9_IRLS)[1:3], f_9_parms_const)
- f_9_d_3 <- mkinfit("SFO", experimental_data_for_UBA_2019[[9]]$data,
+ f_9_d_3 <- mkinfit("SFO", test_9,
error_model = "tc", error_model_algorithm = "d_3", quiet = TRUE)
expect_equivalent(round(AIC(f_9_d_3), 2), 134.94)
expect_equivalent(parms(f_9_d_3), f_9_parms_tc_direct)

Contact - Imprint