diff options
Diffstat (limited to 'tests/testthat')
-rw-r--r-- | tests/testthat/test_SFORB.R | 15 |
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) |