aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/test_confidence.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-03-27 11:47:48 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2020-03-27 11:47:48 +0100
commit20ece4e0bcbeceb90a940e04a858f4ffb6d6b5e4 (patch)
tree7595dbb6e129332a6ad0c273ecd3fbd92643e0d5 /tests/testthat/test_confidence.R
parent731dd9450f08868140f90af7a305133ec9342994 (diff)
parent68eed166cbe10a5ee79f5b1139261dea98234b22 (diff)
Merge branch 'master' into mxkin
Diffstat (limited to 'tests/testthat/test_confidence.R')
-rw-r--r--tests/testthat/test_confidence.R7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/testthat/test_confidence.R b/tests/testthat/test_confidence.R
index a2bf1401..e85fdb7a 100644
--- a/tests/testthat/test_confidence.R
+++ b/tests/testthat/test_confidence.R
@@ -54,11 +54,12 @@ test_that("Quadratic confidence intervals for rate constants are comparable to v
# Another case:
se_mkin_2 <- summary(f_2_mkin)$par[1:4, "Std. Error"]
se_nls_2 <- summary(f_2_nls)$coefficients[, "Std. Error"]
- # Here we the ratio of standard errors can be explained by the same
+ # Here the ratio of standard errors can be explained by the same
# principle up to about 3%
+ nobs_DFOP_par_c_parent <- nrow(subset(DFOP_par_c, name == "parent"))
expect_equivalent(
se_nls_2[c("lrc1", "lrc2")] / se_mkin_2[c("log_k1", "log_k2")],
- rep(sqrt(nrow(FOCUS_2006_C) / (nrow(FOCUS_2006_C) - 4)), 2),
+ rep(sqrt(nobs_DFOP_par_c_parent / (nobs_DFOP_par_c_parent - 4)), 2),
tolerance = 0.03)
})
@@ -73,7 +74,7 @@ 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,
+ ci_mkin_1_p_0.95 <- confint(f, method = "profile", level = 0.95,
cores = n_cores, quiet = TRUE)
# Magically, we get very similar boundaries as stats4::mle

Contact - Imprint