From a7e209b553e2e99ffc9aa2b003f9b73b9ac4b985 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 17 Jul 2020 16:27:46 +0200 Subject: mkinfit: Ignore unused components of state.ini --- tests/testthat/test_mkinfit.R | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/testthat/test_mkinfit.R (limited to 'tests/testthat/test_mkinfit.R') 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)) +}) -- cgit v1.2.1