aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2019-11-13 21:15:35 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2019-11-13 21:15:35 +0100
commitc3700bec3a704660d3ade7a54c56b7084beb02b4 (patch)
tree35fe23b6c9e2b3fd5c0bd66e9a4f8b24281302de /tests
parentb0e529ff49dfa52568fe7c5e6e76439a83c62840 (diff)
Calculate Akaike weights
Diffstat (limited to 'tests')
-rw-r--r--tests/testthat/FOCUS_2006_D.csf2
-rw-r--r--tests/testthat/test_aw.R12
2 files changed, 13 insertions, 1 deletions
diff --git a/tests/testthat/FOCUS_2006_D.csf b/tests/testthat/FOCUS_2006_D.csf
index 09940aa3..358b50e3 100644
--- a/tests/testthat/FOCUS_2006_D.csf
+++ b/tests/testthat/FOCUS_2006_D.csf
@@ -5,7 +5,7 @@ Description:
MeasurementUnits: % AR
TimeUnits: days
Comments: Created using mkin::CAKE_export
-Date: 2019-11-09
+Date: 2019-11-13
Optimiser: IRLS
[Data]
diff --git a/tests/testthat/test_aw.R b/tests/testthat/test_aw.R
new file mode 100644
index 00000000..0a493893
--- /dev/null
+++ b/tests/testthat/test_aw.R
@@ -0,0 +1,12 @@
+context("Calculation of Akaike weights")
+
+test_that("Akaike weights sum to one", {
+ skip_on_cran()
+ aw_1 <- aw(fit_nw_1, fit_obs_1, fit_tc_1)
+ expect_error(aw(fit_nw_1, f_2_mkin), "same data")
+ expect_error(aw(fit_nw_1, 3), "mkinfit objects")
+ expect_equal(sum(aw_1), 1)
+ aw_2 <- aw(fits[c("SFO", "DFOP"), "FOCUS_D"])
+ expect_equal(sum(aw_2), 1)
+ expect_error(aw(fits), "mmkin column object")
+})

Contact - Imprint