diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2020-11-30 14:50:33 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2020-11-30 14:50:33 +0100 |
commit | 78884beed74c18c99521b9ceeaa643e13cf94c06 (patch) | |
tree | af1ebfd975cac837a6bf15c86638299a67a0e017 /tests/testthat/test_nlme.R | |
parent | b3bebc06061cc77b6d549f7b2760afe0b9489bf7 (diff) |
Log-Cholesky parameterisation as default in nlme.mmkin
Diffstat (limited to 'tests/testthat/test_nlme.R')
-rw-r--r-- | tests/testthat/test_nlme.R | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/testthat/test_nlme.R b/tests/testthat/test_nlme.R index 4fd8e53f..da994f49 100644 --- a/tests/testthat/test_nlme.R +++ b/tests/testthat/test_nlme.R @@ -38,24 +38,27 @@ test_that("nlme_function works correctly", { m_nlme_raw <- nlme(value ~ SSasymp(time, 0, parent_0, log_k_parent_sink), data = grouped_data, fixed = parent_0 + log_k_parent_sink ~ 1, - random = pdDiag(parent_0 + log_k_parent_sink ~ 1), - start = mean_dp) + random = pdLogChol(parent_0 + log_k_parent_sink ~ 1), + start = mean_dp, + control = list("msWarnNoConv" = FALSE)) m_nlme_mkin <- nlme(value ~ nlme_f(name, time, parent_0, log_k_parent_sink), data = grouped_data, fixed = parent_0 + log_k_parent_sink ~ 1, - random = pdDiag(parent_0 + log_k_parent_sink ~ 1), - start = mean_dp) + random = pdLogChol(parent_0 + log_k_parent_sink ~ 1), + start = mean_dp, + control = list("msWarnNoConv" = FALSE)) expect_equal(m_nlme_raw$coefficients, m_nlme_mkin$coefficients) - m_nlme_mmkin <- nlme(f) + m_nlme_mmkin <- nlme(f, control = list("msWarnNoConv" = FALSE)) m_nlme_raw_2 <- nlme(value ~ SSasymp(time, 0, parent_0, log_k_parent), data = grouped_data, fixed = parent_0 + log_k_parent ~ 1, - random = pdDiag(parent_0 + log_k_parent ~ 1), - start = mean_degparms(f, random = TRUE)) + random = pdLogChol(parent_0 + log_k_parent ~ 1), + start = mean_degparms(f, random = TRUE), + control = list("msWarnNoConv" = FALSE)) expect_equal(m_nlme_raw_2$coefficients, m_nlme_mmkin$coefficients) @@ -84,8 +87,7 @@ test_that("nlme_function works correctly", { m_nlme_mkin_up_2 <- update(m_nlme_mkin, random = parent_0 ~ 1) expect_equal(m_nlme_raw_up_2$coefficients, m_nlme_mkin_up_2$coefficients) - expect_silent(tmp <- update(m_nlme_mkin)) - expect_silent(tmp <- update(m_nlme_mmkin)) + expect_warning(tmp <- update(m_nlme_mmkin), "Iteration 1, LME step") geomean_dt50_mmkin <- exp(mean(log((sapply(f, function(x) endpoints(x)$distimes["parent", "DT50"]))))) expect_equal(round(endpoints(m_nlme_mmkin)$distimes["parent", "DT50"]), round(geomean_dt50_mmkin)) |