aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/test_confidence.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-12-08 22:08:38 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2020-12-08 22:08:38 +0100
commitf606838c5310f365eea1c0d6421f5c3636a4dc79 (patch)
treebdf4fdb5cb3a94cc46176f9e69132af11e81f749 /tests/testthat/test_confidence.R
parent2663158c85fca9c088d1f8cfa3bc05ad1ac36f94 (diff)
mixed.mmkin and test coverage
Diffstat (limited to 'tests/testthat/test_confidence.R')
-rw-r--r--tests/testthat/test_confidence.R17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/testthat/test_confidence.R b/tests/testthat/test_confidence.R
index 3fdd3f2c..54be675c 100644
--- a/tests/testthat/test_confidence.R
+++ b/tests/testthat/test_confidence.R
@@ -1,7 +1,20 @@
context("Confidence intervals and p-values")
+test_that("Some special cases of confidence interval calculation work", {
+
+ tmp <- expect_warning(mkinfit("FOMC", FOCUS_2006_A, quiet = TRUE), "not converge")
+
+ expect_equivalent(
+ confint(tmp, transform = FALSE),
+ matrix(rep(NA, 8), nrow = 4))
+})
+
test_that("The confint method 'quadratic' is consistent with the summary", {
expect_equivalent(
+ confint(fit_nw_1, parm = "parent_0", method = "quadratic"),
+ summary(fit_nw_1)$bpar["parent_0", c("Lower", "Upper")])
+
+ expect_equivalent(
confint(fit_nw_1, method = "quadratic"),
summary(fit_nw_1)$bpar[, c("Lower", "Upper")])
@@ -74,8 +87,8 @@ test_that("Likelihood profile based confidence intervals work", {
}
f_mle <- stats4::mle(f_nll, start = as.list(parms(f)), nobs = nrow(FOCUS_2006_C))
- ci_mkin_1_p_0.95 <- confint(f, method = "profile", level = 0.95,
- cores = n_cores, quiet = TRUE)
+ ci_mkin_1_p_0.95 <- expect_message(confint(f, method = "profile", level = 0.95,
+ cores = n_cores, quiet = FALSE), "Profiling the likelihood")
# Magically, we get very similar boundaries as stats4::mle
# (we need to capture the output to avoid printing this while testing as

Contact - Imprint