From 380a29e81f88cd80c9c6915200ddc7054c8a085a Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 24 Apr 2019 21:03:43 +0200 Subject: Improve output and update tests Remove skipped tests as I do not intend to reactivate them --- R/mkinfit.R | 14 +++-- test.log | 41 ++++--------- tests/testthat/DFOP_FOCUS_C_messages.txt | 90 ++++++++++++++--------------- tests/testthat/FOCUS_2006_D.csf | 2 +- tests/testthat/summary_DFOP_FOCUS_C.txt | 6 +- tests/testthat/test_FOCUS_D_UBA_expertise.R | 19 ------ tests/testthat/test_logistic.R | 10 ---- 7 files changed, 70 insertions(+), 112 deletions(-) diff --git a/R/mkinfit.R b/R/mkinfit.R index 55b57aa6..754e72b8 100644 --- a/R/mkinfit.R +++ b/R/mkinfit.R @@ -327,7 +327,8 @@ mkinfit <- function(mkinmod, observed, if (nlogLik < nlogLik.current) { assign("nlogLik.current", nlogLik, inherits = TRUE) - if (!quiet) cat("Negative log-likelihood at call ", calls, ": ", nlogLik.current, "\n", sep = "") + if (!quiet) cat(ifelse(OLS, "Sum of squared residuals", "Negative log-likelihood"), + " at call ", calls, ": ", nlogLik.current, "\n", sep = "") } return(nlogLik) } @@ -593,6 +594,7 @@ summary.mkinfit <- function(object, data = TRUE, distimes = TRUE, alpha = 0.05, use_of_ff = object$mkinmod$use_of_ff, df = c(p, rdf), cov.unscaled = covar, + err_mod = object$err_mod, #cov.scaled = covar * resvar, niter = object$iterations, calls = object$calls, @@ -657,11 +659,13 @@ print.summary.mkinfit <- function(x, digits = max(3, getOption("digits") - 3), . cat("\nModel predictions using solution type", x$solution_type, "\n") - cat("\nFitted with method", x$method.modFit, - "using", x$calls, "model solutions performed in", x$time[["elapsed"]], "s\n") + cat("\nFitted using", x$calls, "model solutions performed in", x$time[["elapsed"]], "s\n") cat("\nError model:\n") - print(x$err_mod) + cat(switch(x$err_mod, + const = "Constant variance", + obs = "Variance unique to each observed variable", + tc = "Two-component variance function"), "\n") cat("\nStarting values for parameters to be optimised:\n") print(x$start) @@ -696,7 +700,7 @@ print.summary.mkinfit <- function(x, digits = max(3, getOption("digits") - 3), . print(signif(x$bpar[, c(1, 3, 4, 5, 6)], digits = digits)) } - cat("\nChi2 error levels in percent:\n") + cat("\nFOCUS Chi2 error levels in percent:\n") x$errmin$err.min <- 100 * x$errmin$err.min print(x$errmin, digits=digits,...) diff --git a/test.log b/test.log index 58c819f4..bcdb550a 100644 --- a/test.log +++ b/test.log @@ -2,45 +2,28 @@ Loading mkin Testing mkin ✔ | OK F W S | Context ⠏ | 0 | Export dataset for reading into CAKE ⠋ | 1 | Export dataset for reading into CAKE ✔ | 1 | Export dataset for reading into CAKE - ⠏ | 0 | Error model fitting ⠋ | 1 | Error model fitting ⠙ | 2 | Error model fitting ⠹ | 3 | Error model fitting ⠸ | 4 | Error model fitting ⠼ | 5 | Error model fitting ⠴ | 6 | Error model fitting ⠦ | 7 | Error model fitting ⠧ | 8 | Error model fitting ⠇ | 9 | Error model fitting ⠏ | 9 1 | Error model fitting ⠋ | 10 1 | Error model fitting ⠙ | 10 2 | Error model fitting ⠙ | 10 2 | Error model fitting ⠙ | 10 2 | Error model fitting ⠙ | 10 2 | Error model fitting ⠙ | 10 2 | Error model fitting ⠙ | 10 2 | Error model fitting ⠙ | 10 2 | Error model fitting ⠙ | 10 2 | Error model fitting ⠙ | 10 2 | Error model fitting ⠙ | 10 2 | Error model fitting ⠙ | 10 2 | Error model fitting ⠙ | 10 2 | Error model fitting ⠙ | 10 2 | Error model fitting ⠙ | 10 2 ⠙ | 10 | Error model fitting2 | Error model fitting ⠙ | 11 1 | Error model fitting ⠹ | 12 1 | Error model fitting ✔ | 12 1 | Error model fitting [163.7 s] -──────────────────────────────────────────────────────────────────────────────── -test_error_models.R:148: warning: Reweighting method 'tc' produces reasonable variance estimates -Observations with value of zero were removed from the data -──────────────────────────────────────────────────────────────────────────────── - ⠏ | 0 | Calculation of FOCUS chi2 error levels ⠋ | 1 | Calculation of FOCUS chi2 error levels ⠙ | 2 | Calculation of FOCUS chi2 error levels ⠹ | 3 | Calculation of FOCUS chi2 error levels ✔ | 3 | Calculation of FOCUS chi2 error levels [2.4 s] - ⠏ | 0 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠋ | 1 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠙ | 2 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠹ | 3 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠸ | 4 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠼ | 5 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠴ | 6 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠦ | 7 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠧ | 8 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠇ | 9 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠏ | 10 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠋ | 11 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠙ | 12 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠹ | 13 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠸ | 13 1 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ✔ | 13 1 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [8.3 s] -──────────────────────────────────────────────────────────────────────────────── -test_FOCUS_D_UBA_expertise.R:89: skip: The t-value for fits using internal transformations corresponds with results from FME, synthetic data -Hessian matrices and df calculations differ from those in FME -──────────────────────────────────────────────────────────────────────────────── + ⠏ | 0 | Error model fitting ⠋ | 1 | Error model fitting ⠙ | 2 | Error model fitting ⠹ | 3 | Error model fitting ⠸ | 4 | Error model fitting ⠼ | 5 | Error model fitting ⠴ | 6 | Error model fitting ⠦ | 7 | Error model fitting ⠧ | 8 | Error model fitting ⠇ | 9 | Error model fitting ⠏ | 10 | Error model fitting ⠋ | 11 | Error model fitting ⠙ | 12 | Error model fitting ✔ | 12 | Error model fitting [164.6 s] + ⠏ | 0 | Calculation of FOCUS chi2 error levels ⠋ | 1 | Calculation of FOCUS chi2 error levels ⠙ | 2 | Calculation of FOCUS chi2 error levels ⠹ | 3 | Calculation of FOCUS chi2 error levels ✔ | 3 | Calculation of FOCUS chi2 error levels [2.3 s] + ⠏ | 0 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠋ | 1 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠙ | 2 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠹ | 3 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠸ | 4 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠼ | 5 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠴ | 6 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠦ | 7 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠧ | 8 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠇ | 9 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠏ | 10 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠋ | 11 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠙ | 12 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ⠹ | 13 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ✔ | 13 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [3.8 s] ⠏ | 0 | Test fitting the decline of metabolites from their maximum ⠋ | 1 | Test fitting the decline of metabolites from their maximum ⠙ | 2 | Test fitting the decline of metabolites from their maximum ⠹ | 3 | Test fitting the decline of metabolites from their maximum ⠸ | 4 | Test fitting the decline of metabolites from their maximum ⠼ | 5 | Test fitting the decline of metabolites from their maximum ⠴ | 6 | Test fitting the decline of metabolites from their maximum ✔ | 6 | Test fitting the decline of metabolites from their maximum [0.9 s] - ⠏ | 0 | Fitting the logistic model ⠋ | 1 | Fitting the logistic model ⠙ | 1 1 | Fitting the logistic model ✔ | 1 1 | Fitting the logistic model [0.9 s] -──────────────────────────────────────────────────────────────────────────────── -test_logistic.R:41: skip: The logistic fit can be done via differential equation -Skip slow fit of logistic model using deSolve without compilation -──────────────────────────────────────────────────────────────────────────────── + ⠏ | 0 | Fitting the logistic model ⠋ | 1 | Fitting the logistic model ✔ | 1 | Fitting the logistic model [1.0 s] ⠏ | 0 | Test dataset class mkinds used in gmkin ⠋ | 1 | Test dataset class mkinds used in gmkin ✔ | 1 | Test dataset class mkinds used in gmkin - ⠏ | 0 | Special cases of mkinfit calls ⠋ | 1 | Special cases of mkinfit calls ⠙ | 2 | Special cases of mkinfit calls ⠹ | 3 | Special cases of mkinfit calls ⠸ | 4 | Special cases of mkinfit calls ⠼ | 5 | Special cases of mkinfit calls ⠴ | 6 | Special cases of mkinfit calls ⠦ | 7 | Special cases of mkinfit calls ⠧ | 8 | Special cases of mkinfit calls ⠇ | 8 1 | Special cases of mkinfit calls ⠏ | 9 1 | Special cases of mkinfit calls ⠋ | 10 1 | Special cases of mkinfit calls ⠙ | 11 1 | Special cases of mkinfit calls ⠹ | 12 1 | Special cases of mkinfit calls ✔ | 12 1 | Special cases of mkinfit calls [3.2 s] -──────────────────────────────────────────────────────────────────────────────── -test_mkinfit_errors.R:59: warning: mkinfit stops early when a low maximum number of iterations is specified -Optimisation did not converge: -iteration limit reached without convergence (10) -──────────────────────────────────────────────────────────────────────────────── + ⠏ | 0 | Special cases of mkinfit calls ⠋ | 1 | Special cases of mkinfit calls ⠙ | 2 | Special cases of mkinfit calls ⠹ | 3 | Special cases of mkinfit calls ⠸ | 4 | Special cases of mkinfit calls ⠼ | 5 | Special cases of mkinfit calls ⠴ | 6 | Special cases of mkinfit calls ⠦ | 7 | Special cases of mkinfit calls ⠧ | 8 | Special cases of mkinfit calls ⠇ | 9 | Special cases of mkinfit calls ⠏ | 10 | Special cases of mkinfit calls ⠋ | 11 | Special cases of mkinfit calls ⠙ | 12 | Special cases of mkinfit calls ✔ | 12 | Special cases of mkinfit calls [2.8 s] ⠏ | 0 | mkinmod model generation and printing ⠋ | 1 | mkinmod model generation and printing ⠙ | 2 | mkinmod model generation and printing ⠹ | 3 | mkinmod model generation and printing ⠸ | 4 | mkinmod model generation and printing ⠼ | 5 | mkinmod model generation and printing ⠴ | 6 | mkinmod model generation and printing ⠦ | 7 | mkinmod model generation and printing ⠧ | 8 | mkinmod model generation and printing ⠇ | 9 | mkinmod model generation and printing ✔ | 9 | mkinmod model generation and printing [0.2 s] - ⠏ | 0 | Model predictions with mkinpredict ⠋ | 1 | Model predictions with mkinpredict ⠙ | 2 | Model predictions with mkinpredict ⠹ | 3 | Model predictions with mkinpredict ✔ | 3 | Model predictions with mkinpredict [0.3 s] + ⠏ | 0 | Model predictions with mkinpredict ⠋ | 1 | Model predictions with mkinpredict ⠙ | 2 | Model predictions with mkinpredict ⠹ | 3 | Model predictions with mkinpredict ✔ | 3 | Model predictions with mkinpredict [0.4 s] ⠏ | 0 | Evaluations according to 2015 NAFTA guidance ⠋ | 1 | Evaluations according to 2015 NAFTA guidance ⠙ | 2 | Evaluations according to 2015 NAFTA guidance ⠹ | 3 | Evaluations according to 2015 NAFTA guidance ⠸ | 4 | Evaluations according to 2015 NAFTA guidance ⠼ | 5 | Evaluations according to 2015 NAFTA guidance ⠴ | 6 | Evaluations according to 2015 NAFTA guidance ⠦ | 7 | Evaluations according to 2015 NAFTA guidance ⠧ | 8 | Evaluations according to 2015 NAFTA guidance ⠇ | 9 | Evaluations according to 2015 NAFTA guidance ⠏ | 10 | Evaluations according to 2015 NAFTA guidance ⠋ | 11 | Evaluations according to 2015 NAFTA guidance ⠙ | 12 | Evaluations according to 2015 NAFTA guidance ⠹ | 13 | Evaluations according to 2015 NAFTA guidance ⠸ | 14 | Evaluations according to 2015 NAFTA guidance ⠼ | 15 | Evaluations according to 2015 NAFTA guidance ⠴ | 16 | Evaluations according to 2015 NAFTA guidance ✔ | 16 | Evaluations according to 2015 NAFTA guidance [4.1 s] - ⠏ | 0 | Fitting of parent only models ⠋ | 1 | Fitting of parent only models ⠙ | 2 | Fitting of parent only models ⠹ | 3 | Fitting of parent only models ⠸ | 4 | Fitting of parent only models ⠼ | 5 | Fitting of parent only models ⠴ | 6 | Fitting of parent only models ⠦ | 7 | Fitting of parent only models ⠧ | 8 | Fitting of parent only models ⠇ | 9 | Fitting of parent only models ⠏ | 10 | Fitting of parent only models ⠋ | 11 | Fitting of parent only models ⠙ | 12 | Fitting of parent only models ⠹ | 13 | Fitting of parent only models ⠸ | 14 | Fitting of parent only models ⠼ | 15 | Fitting of parent only models ⠴ | 16 | Fitting of parent only models ⠦ | 17 | Fitting of parent only models ⠧ | 18 | Fitting of parent only models ⠇ | 19 | Fitting of parent only models ⠏ | 20 | Fitting of parent only models ⠋ | 21 | Fitting of parent only models ✔ | 21 | Fitting of parent only models [58.6 s] + ⠏ | 0 | Fitting of parent only models ⠋ | 1 | Fitting of parent only models ⠙ | 2 | Fitting of parent only models ⠹ | 3 | Fitting of parent only models ⠸ | 4 | Fitting of parent only models ⠼ | 5 | Fitting of parent only models ⠴ | 6 | Fitting of parent only models ⠦ | 7 | Fitting of parent only models ⠧ | 8 | Fitting of parent only models ⠇ | 9 | Fitting of parent only models ⠏ | 10 | Fitting of parent only models ⠋ | 11 | Fitting of parent only models ⠙ | 12 | Fitting of parent only models ⠹ | 13 | Fitting of parent only models ⠸ | 14 | Fitting of parent only models ⠼ | 15 | Fitting of parent only models ⠴ | 16 | Fitting of parent only models ⠦ | 17 | Fitting of parent only models ⠧ | 18 | Fitting of parent only models ⠇ | 19 | Fitting of parent only models ⠏ | 20 | Fitting of parent only models ⠋ | 21 | Fitting of parent only models ✔ | 21 | Fitting of parent only models [58.1 s] ⠏ | 0 | Calculation of maximum time weighted average concentrations (TWAs) ⠋ | 1 | Calculation of maximum time weighted average concentrations (TWAs) ⠙ | 2 | Calculation of maximum time weighted average concentrations (TWAs) ⠹ | 3 | Calculation of maximum time weighted average concentrations (TWAs) ⠸ | 4 | Calculation of maximum time weighted average concentrations (TWAs) ✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [3.7 s] ⠏ | 0 | Summary ⠋ | 1 | Summary ✔ | 1 | Summary ⠏ | 0 | Plotting ⠋ | 1 | Plotting ⠙ | 2 | Plotting ⠹ | 3 | Plotting ⠸ | 4 | Plotting ✔ | 4 | Plotting [0.3 s] ⠏ | 0 | AIC calculation ⠋ | 1 | AIC calculation ⠙ | 2 | AIC calculation ✔ | 2 | AIC calculation - ⠏ | 0 | Complex test case from Schaefer et al. (2007) Piacenza paper ⠋ | 1 | Complex test case from Schaefer et al. (2007) Piacenza paper ⠙ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper ✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [5.6 s] - ⠏ | 0 | Results for synthetic data established in expertise for UBA (Ranke 2014) ⠋ | 1 | Results for synthetic data established in expertise for UBA (Ranke 2014) ⠙ | 2 | Results for synthetic data established in expertise for UBA (Ranke 2014) ⠹ | 3 | Results for synthetic data established in expertise for UBA (Ranke 2014) ⠸ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) ✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [7.4 s] + ⠏ | 0 | Complex test case from Schaefer et al. (2007) Piacenza paper ⠋ | 1 | Complex test case from Schaefer et al. (2007) Piacenza paper ⠙ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper ✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [5.5 s] + ⠏ | 0 | Results for synthetic data established in expertise for UBA (Ranke 2014) ⠋ | 1 | Results for synthetic data established in expertise for UBA (Ranke 2014) ⠙ | 2 | Results for synthetic data established in expertise for UBA (Ranke 2014) ⠹ | 3 | Results for synthetic data established in expertise for UBA (Ranke 2014) ⠸ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) ✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [7.2 s] ══ Results ═════════════════════════════════════════════════════════════════════ -Duration: 265.8 s +Duration: 261.0 s OK: 115 Failed: 0 -Warnings: 2 -Skipped: 2 +Warnings: 0 +Skipped: 0 diff --git a/tests/testthat/DFOP_FOCUS_C_messages.txt b/tests/testthat/DFOP_FOCUS_C_messages.txt index 5327b3f6..9abde683 100644 --- a/tests/testthat/DFOP_FOCUS_C_messages.txt +++ b/tests/testthat/DFOP_FOCUS_C_messages.txt @@ -1,148 +1,148 @@ parent_0 log_k1 log_k2 g_ilr sigma 85.1 -2.302585 -4.60517 0 -Negative log-likelihood at call 1: 7391.39 +Sum of squared residuals at call 1: 7391.39 85.1 -2.302585 -4.60517 0 85.1 -2.302585 -4.60517 0 -Negative log-likelihood at call 3: 7391.389 +Sum of squared residuals at call 3: 7391.389 85.1 -2.302585 -4.60517 0 -Negative log-likelihood at call 4: 7391.389 +Sum of squared residuals at call 4: 7391.389 85.1 -2.302585 -4.60517 1.490116e-08 85.06371 -1.77328 -4.250366 0.7698268 -Negative log-likelihood at call 6: 2000.127 +Sum of squared residuals at call 6: 2000.127 85.06375 -1.77328 -4.250366 0.7698268 85.06371 -1.773322 -4.250366 0.7698268 85.06371 -1.77328 -4.250408 0.7698268 85.06371 -1.77328 -4.250366 0.7697847 85.03542 -0.9608523 -4.11546 1.336361 -Negative log-likelihood at call 11: 32.97798 +Sum of squared residuals at call 11: 32.97798 85.03542 -0.9608523 -4.11546 1.336361 85.03542 -0.9608526 -4.11546 1.336361 85.03542 -0.9608523 -4.11546 1.336361 85.03542 -0.9608523 -4.11546 1.336361 85.03704 -0.256064 -4.273512 0.6447755 85.03285 -0.7822828 -4.127513 1.312494 -Negative log-likelihood at call 17: 5.348133 +Sum of squared residuals at call 17: 5.348133 85.03286 -0.7822828 -4.127513 1.312494 -Negative log-likelihood at call 18: 5.348132 +Sum of squared residuals at call 18: 5.348132 85.03285 -0.7822828 -4.127513 1.312494 -Negative log-likelihood at call 19: 5.348131 +Sum of squared residuals at call 19: 5.348131 85.03285 -0.7822828 -4.127513 1.312494 85.03285 -0.7822828 -4.127513 1.312494 -Negative log-likelihood at call 21: 5.348131 +Sum of squared residuals at call 21: 5.348131 85.02325 -0.74968 -4.059 1.14891 85.03127 -0.7909068 -4.114802 1.268157 -Negative log-likelihood at call 23: 4.704445 +Sum of squared residuals at call 23: 4.704445 85.03127 -0.7909068 -4.114802 1.268157 -Negative log-likelihood at call 24: 4.704444 +Sum of squared residuals at call 24: 4.704444 85.03127 -0.7909068 -4.114802 1.268157 85.03127 -0.7909068 -4.1148 1.268157 -Negative log-likelihood at call 26: 4.704433 +Sum of squared residuals at call 26: 4.704433 85.03127 -0.7909068 -4.114802 1.268158 85.03001 -0.7801506 -4.069435 1.262797 -Negative log-likelihood at call 28: 4.421625 +Sum of squared residuals at call 28: 4.421625 85.03001 -0.7801506 -4.069435 1.262797 85.03001 -0.7801507 -4.069435 1.262797 -Negative log-likelihood at call 30: 4.421624 +Sum of squared residuals at call 30: 4.421624 85.03001 -0.7801506 -4.069435 1.262797 85.03001 -0.7801506 -4.069435 1.262797 85.02878 -0.7900844 -4.023945 1.256918 85.02964 -0.7857352 -4.054587 1.260236 -Negative log-likelihood at call 34: 4.414346 +Sum of squared residuals at call 34: 4.414346 85.02964 -0.7857352 -4.054587 1.260236 85.02964 -0.7857351 -4.054587 1.260236 -Negative log-likelihood at call 36: 4.414346 +Sum of squared residuals at call 36: 4.414346 85.02964 -0.7857352 -4.054588 1.260236 85.02964 -0.7857352 -4.054587 1.260236 85.02812 -0.7778128 -4.042219 1.25389 -Negative log-likelihood at call 39: 4.372463 +Sum of squared residuals at call 39: 4.372463 85.02812 -0.7778128 -4.042219 1.25389 85.02812 -0.7778129 -4.042219 1.25389 -Negative log-likelihood at call 41: 4.372462 +Sum of squared residuals at call 41: 4.372462 85.02812 -0.7778128 -4.042219 1.25389 85.02812 -0.7778128 -4.042219 1.25389 85.02419 -0.7765144 -4.02942 1.245094 85.0263 -0.7778419 -4.036021 1.249634 -Negative log-likelihood at call 45: 4.369313 +Sum of squared residuals at call 45: 4.369313 85.0263 -0.7778419 -4.036021 1.249634 85.0263 -0.7778418 -4.036021 1.249634 -Negative log-likelihood at call 47: 4.369313 +Sum of squared residuals at call 47: 4.369313 85.0263 -0.7778419 -4.036022 1.249634 85.0263 -0.7778419 -4.036021 1.249634 -Negative log-likelihood at call 49: 4.369313 +Sum of squared residuals at call 49: 4.369313 85.02267 -0.7786811 -4.02967 1.252015 -Negative log-likelihood at call 50: 4.365062 +Sum of squared residuals at call 50: 4.365062 85.02268 -0.7786811 -4.02967 1.252015 85.02267 -0.7786812 -4.02967 1.252015 85.02267 -0.7786811 -4.02967 1.252015 -Negative log-likelihood at call 53: 4.365062 +Sum of squared residuals at call 53: 4.365062 85.02267 -0.7786811 -4.02967 1.252015 85.01633 -0.7763163 -4.027611 1.248897 -Negative log-likelihood at call 55: 4.364078 +Sum of squared residuals at call 55: 4.364078 85.01633 -0.7763163 -4.027611 1.248897 -Negative log-likelihood at call 56: 4.364078 +Sum of squared residuals at call 56: 4.364078 85.01633 -0.7763164 -4.027611 1.248897 -Negative log-likelihood at call 57: 4.364077 +Sum of squared residuals at call 57: 4.364077 85.01633 -0.7763163 -4.027611 1.248897 85.01633 -0.7763163 -4.027611 1.248897 85.00894 -0.7777917 -4.026307 1.24772 -Negative log-likelihood at call 60: 4.364052 +Sum of squared residuals at call 60: 4.364052 85.00894 -0.7777917 -4.026307 1.24772 -Negative log-likelihood at call 61: 4.364052 +Sum of squared residuals at call 61: 4.364052 85.00894 -0.7777917 -4.026307 1.24772 -Negative log-likelihood at call 62: 4.364052 +Sum of squared residuals at call 62: 4.364052 85.00894 -0.7777917 -4.026307 1.24772 85.00894 -0.7777917 -4.026307 1.24772 -Negative log-likelihood at call 64: 4.364052 +Sum of squared residuals at call 64: 4.364052 85.00518 -0.7773082 -4.026004 1.248453 -Negative log-likelihood at call 65: 4.362751 +Sum of squared residuals at call 65: 4.362751 85.00519 -0.7773082 -4.026004 1.248453 85.00518 -0.7773083 -4.026004 1.248453 -Negative log-likelihood at call 67: 4.362751 +Sum of squared residuals at call 67: 4.362751 85.00518 -0.7773082 -4.026005 1.248453 85.00518 -0.7773082 -4.026004 1.248453 85.00134 -0.7776046 -4.025878 1.248775 -Negative log-likelihood at call 70: 4.362721 +Sum of squared residuals at call 70: 4.362721 85.00135 -0.7776046 -4.025878 1.248775 -Negative log-likelihood at call 71: 4.362721 +Sum of squared residuals at call 71: 4.362721 85.00134 -0.7776046 -4.025878 1.248775 -Negative log-likelihood at call 72: 4.362721 +Sum of squared residuals at call 72: 4.362721 85.00134 -0.7776046 -4.025878 1.248775 85.00134 -0.7776046 -4.025878 1.248775 85.0032 -0.7774734 -4.0257 1.248643 -Negative log-likelihood at call 75: 4.362715 +Sum of squared residuals at call 75: 4.362715 85.0032 -0.7774734 -4.0257 1.248643 85.0032 -0.7774734 -4.0257 1.248643 -Negative log-likelihood at call 77: 4.362715 +Sum of squared residuals at call 77: 4.362715 85.0032 -0.7774735 -4.0257 1.248643 85.0032 -0.7774734 -4.0257 1.248643 85.0032 -0.7774734 -4.0257 1.248643 85.0032 -0.7774734 -4.0257 1.248643 85.00249 -0.7774909 -4.025911 1.248679 -Negative log-likelihood at call 82: 4.362715 +Sum of squared residuals at call 82: 4.362715 85.0025 -0.7774909 -4.025911 1.248679 -Negative log-likelihood at call 83: 4.362715 +Sum of squared residuals at call 83: 4.362715 85.00249 -0.7774909 -4.025911 1.248679 85.00249 -0.7774905 -4.025911 1.248679 85.00249 -0.7774914 -4.025911 1.248679 -Negative log-likelihood at call 86: 4.362715 +Sum of squared residuals at call 86: 4.362715 85.00249 -0.7774909 -4.025911 1.248679 85.00249 -0.7774909 -4.025911 1.248679 85.00249 -0.7774909 -4.025911 1.248679 85.00249 -0.7774909 -4.025911 1.248679 85.00274 -0.7774922 -4.025821 1.248672 -Negative log-likelihood at call 91: 4.362714 +Sum of squared residuals at call 91: 4.362714 85.00274 -0.7774922 -4.025821 1.248672 85.00274 -0.7774922 -4.025821 1.248672 -Negative log-likelihood at call 93: 4.362714 +Sum of squared residuals at call 93: 4.362714 85.00274 -0.7774921 -4.025821 1.248672 -Negative log-likelihood at call 94: 4.362714 +Sum of squared residuals at call 94: 4.362714 85.00274 -0.7774922 -4.025821 1.248672 85.00274 -0.7774922 -4.025821 1.248672 85.00274 -0.7774922 -4.025821 1.248672 85.00274 -0.7774922 -4.025821 1.248672 85.00274 -0.7774922 -4.025821 1.248672 85.00273 -0.7774912 -4.025817 1.24867 -Negative log-likelihood at call 100: 4.362714 +Sum of squared residuals at call 100: 4.362714 85.00275 -0.7774912 -4.025817 1.24867 85.00271 -0.7774912 -4.025817 1.24867 85.00273 -0.7774905 -4.025817 1.24867 @@ -152,7 +152,7 @@ Negative log-likelihood at call 100: 4.362714 85.00273 -0.7774912 -4.025817 1.248671 85.00273 -0.7774912 -4.025817 1.248669 85.00274 -0.7774913 -4.025819 1.248671 -Negative log-likelihood at call 109: 4.362714 +Sum of squared residuals at call 109: 4.362714 85.00276 -0.7774913 -4.025819 1.248671 85.00272 -0.7774913 -4.025819 1.248671 85.00274 -0.7774904 -4.025819 1.248671 diff --git a/tests/testthat/FOCUS_2006_D.csf b/tests/testthat/FOCUS_2006_D.csf index 84500b54..9e912a28 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-04-10 +Date: 2019-04-24 Optimiser: IRLS [Data] diff --git a/tests/testthat/summary_DFOP_FOCUS_C.txt b/tests/testthat/summary_DFOP_FOCUS_C.txt index 1d669d43..b0a6bb6d 100644 --- a/tests/testthat/summary_DFOP_FOCUS_C.txt +++ b/tests/testthat/summary_DFOP_FOCUS_C.txt @@ -10,10 +10,10 @@ d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 * Model predictions using solution type analytical -Fitted with method using test 0 model solutions performed in test time 0 s +Fitted using test 0 model solutions performed in test time 0 s Error model: -NULL +Constant variance Starting values for parameters to be optimised: value type @@ -61,7 +61,7 @@ k2 0.01785 7.636 7.901e-04 0.01241 0.02568 g 0.85390 83.310 6.221e-08 0.82310 0.88020 sigma 0.69620 4.243 6.618e-03 0.24060 1.15200 -Chi2 error levels in percent: +FOCUS Chi2 error levels in percent: err.min n.optim df All data 2.661 4 5 parent 2.661 4 5 diff --git a/tests/testthat/test_FOCUS_D_UBA_expertise.R b/tests/testthat/test_FOCUS_D_UBA_expertise.R index 3a49078c..a282f5e7 100644 --- a/tests/testthat/test_FOCUS_D_UBA_expertise.R +++ b/tests/testthat/test_FOCUS_D_UBA_expertise.R @@ -74,22 +74,3 @@ test_that("Fits without internal transformations are correct for FOCUS D", { # References: # Ranke (2014) Prüfung und Validierung von Modellierungssoftware als Alternative # zu ModelMaker 4.0, Umweltbundesamt Projektnummer 27452 - -test_that("The t-value for fits using internal transformations corresponds with results from FME, synthetic data", { - skip_on_cran() - m_synth_DFOP_par.minff <- mkinmod(parent = mkinsub("DFOP", c("M1", "M2")), - M1 = mkinsub("SFO"), - M2 = mkinsub("SFO"), - use_of_ff = "min", quiet = TRUE) - - fit_DFOP_par_c_2 <- mkinfit(m_synth_DFOP_par.minff, - synthetic_data_for_UBA_2014[[12]]$data, - quiet = TRUE) - - skip("Hessian matrices and df calculations differ from those in FME") - # Note that the k1 and k2 are exchanged in the untransformed fit evaluated with FME for this test - expect_equal(signif(summary(fit_DFOP_par_c_2)$bpar[1:7, "t value"], 5), - c(parent_0 = 80.054, k_M1_sink = 12.291, k_M2_sink = 10.588, - f_parent_to_M1 = 21.4960, f_parent_to_M2 = 24.0890, - k1 = 16.1450, k2 = 8.1747)) -}) diff --git a/tests/testthat/test_logistic.R b/tests/testthat/test_logistic.R index 9f50f32e..5a89fbf5 100644 --- a/tests/testthat/test_logistic.R +++ b/tests/testthat/test_logistic.R @@ -34,13 +34,3 @@ test_that("The logistic model fit is reproducible", { dtx <- endpoints(m)$distimes["parent", ] expect_equivalent(dtx, c(36.865, 62.415, 4297.854, 10.833), tolerance = 0.001) }) - -test_that("The logistic fit can be done via differential equation", { - # This is slow as we did not implement conversion to C - # because it is unlikely we will use the logistic model with metabolites - skip("Skip slow fit of logistic model using deSolve without compilation") - m_2 <- mkinfit("logistic", d_2_1[[1]], solution_type = "deSolve", - quiet = TRUE) - dtx_2 <- endpoints(m_2)$distimes["parent", ] - expect_equivalent(dtx_2, c(36.865, 62.415, 4297.854, 10.833), tolerance = 0.001) -}) -- cgit v1.2.1