aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/test_SFORB.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2022-11-08 08:46:57 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2022-11-08 08:46:57 +0100
commit56415f3c0638725aaa77db2c02eeaf9d4983452b (patch)
treefa935e34c86b6be05b7e4384fb84323681f5d485 /tests/testthat/test_SFORB.R
parent7186006740aca909660e42dce8d92eb4735af533 (diff)
Show DFOP g equivalent of SFORB in summary, test
Diffstat (limited to 'tests/testthat/test_SFORB.R')
-rw-r--r--tests/testthat/test_SFORB.R15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/testthat/test_SFORB.R b/tests/testthat/test_SFORB.R
index 91c8f2fb..88dcd761 100644
--- a/tests/testthat/test_SFORB.R
+++ b/tests/testthat/test_SFORB.R
@@ -1,15 +1,20 @@
context("Fitting the SFORB model")
-# We do not want the warnings due to non-normality of residuals here
-warn_option <- options(warn=-1)
-
test_that("Fitting the SFORB model is equivalent to fitting DFOP", {
f_sforb <- mkinfit("SFORB", FOCUS_2006_C, quiet = TRUE)
f_dfop <- mkinfit("DFOP", FOCUS_2006_C, quiet = TRUE)
expect_equivalent(endpoints(f_sforb)$distimes, endpoints(f_dfop)$distimes,
tolerance = 1e-6)
+ s_sforb_parms <- summary(f_sforb)$SFORB
+ expect_equivalent(
+ exp(f_dfop$par["log_k1"]), s_sforb_parms["parent_b1"])
+ expect_equivalent(
+ exp(f_dfop$par["log_k2"]), s_sforb_parms["parent_b2"])
+ expect_equivalent(
+ plogis(f_dfop$par["g_qlogis"]), s_sforb_parms["parent_g"])
+
s_sforb <- capture_output(print(summary(f_sforb)))
- expect_match(s_sforb, "Estimated Eigenvalues of SFORB model\\(s\\):")
+ expect_match(s_sforb, "Estimated Eigenvalues and DFOP g parameter of SFORB model\\(s\\):")
expect_match(s_sforb, "parent_b1 parent_b2")
expect_match(s_sforb, "0.45956 *0.01785")
@@ -35,5 +40,3 @@ test_that("Fitting the SFORB model is equivalent to fitting DFOP", {
expect_equivalent(endpoints(f_sforb_sfo_eigen)$distimes, endpoints(f_dfop_sfo)$distimes,
tolerance = 1e-6)
})
-
-options(warn = warn_option$warn)

Contact - Imprint