aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-07-17 16:27:46 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2020-07-17 16:27:46 +0200
commita7e209b553e2e99ffc9aa2b003f9b73b9ac4b985 (patch)
tree25b9b07d372bab606b07e91f53bd8059d867d767 /tests
parent9b8ee1c02b04cd45b9cd5231ec2bad36afe6313f (diff)
mkinfit: Ignore unused components of state.ini
Diffstat (limited to 'tests')
-rw-r--r--tests/testthat/FOCUS_2006_D.csf2
-rw-r--r--tests/testthat/test_mkinfit.R10
2 files changed, 11 insertions, 1 deletions
diff --git a/tests/testthat/FOCUS_2006_D.csf b/tests/testthat/FOCUS_2006_D.csf
index 232d7dad..a340a0a5 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: 2020-07-15
+Date: 2020-07-17
Optimiser: IRLS
[Data]
diff --git a/tests/testthat/test_mkinfit.R b/tests/testthat/test_mkinfit.R
new file mode 100644
index 00000000..fb81c3d8
--- /dev/null
+++ b/tests/testthat/test_mkinfit.R
@@ -0,0 +1,10 @@
+context("mkinfit features")
+
+test_that("Specifying initial values for state variables works correctly", {
+ f_1 <- mkinfit("SFO", FOCUS_2006_C, state.ini = c(parent = 100), quiet = TRUE)
+ f_2 <- mkinfit("SFO", FOCUS_2006_C, state.ini = c(parrrent = 100), quiet = TRUE)
+
+ # Before mkin 0.9.50.3, these would give different degrees of freedom,
+ # also affecting AIC calculations
+ expect_equal(logLik(f_1), logLik(f_2))
+})

Contact - Imprint