From 587662437bce06ea202551048226b86cff0db187 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 14 Sep 2018 21:02:46 +0200 Subject: Skip more tests on CRAN Static documentation rebuilt by pkgdown --- NEWS.md | 2 - docs/articles/FOCUS_L.html | 40 ++++++------- docs/articles/web_only/compiled_models.html | 10 ++-- docs/news/index.html | 10 +--- docs/reference/Extract.mmkin.html | 12 ++-- docs/reference/mccall81_245T.html | 12 ++-- docs/reference/mkinfit.html | 46 +++++++-------- docs/reference/mkinmod.html | 2 +- docs/reference/mkinpredict.html | 6 +- docs/reference/mmkin.html | 4 +- docs/reference/summary.mkinfit.html | 6 +- docs/reference/transform_odeparms.html | 24 ++++---- test.log | 13 ++--- tests/testthat/test_FOCUS_D_UBA_expertise.R | 70 ++++++++++------------- tests/testthat/test_mkinpredict_SFO_SFO.R | 4 +- tests/testthat/test_parent_only.R | 3 + tests/testthat/test_synthetic_data_for_UBA_2014.R | 1 + tests/testthat/test_twa.R | 8 ++- 18 files changed, 128 insertions(+), 145 deletions(-) diff --git a/NEWS.md b/NEWS.md index 4710801b..d265dc6f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,8 +4,6 @@ - Move two vignettes to a location where they will not be built on CRAN (to avoid more NOTES from long execution times) -# mkin 0.9.47.4 - - Exclude more example code from testing on CRAN to avoid NOTES from long execution times # mkin 0.9.47.3 diff --git a/docs/articles/FOCUS_L.html b/docs/articles/FOCUS_L.html index f1a91c04..2a99a609 100644 --- a/docs/articles/FOCUS_L.html +++ b/docs/articles/FOCUS_L.html @@ -110,15 +110,15 @@ summary(m.L1.SFO)
## mkin version used for fitting:    0.9.47.5 
 ## R version used for fitting:       3.5.1 
-## Date of fit:     Fri Sep 14 18:22:23 2018 
-## Date of summary: Fri Sep 14 18:22:23 2018 
+## Date of fit:     Fri Sep 14 21:00:22 2018 
+## Date of summary: Fri Sep 14 21:00:22 2018 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 37 model solutions performed in 0.092 s
+## Fitted with method Port using 37 model solutions performed in 0.087 s
 ## 
 ## Weighting: none
 ## 
@@ -201,15 +201,15 @@
 
 
## mkin version used for fitting:    0.9.47.5 
 ## R version used for fitting:       3.5.1 
-## Date of fit:     Fri Sep 14 18:22:25 2018 
-## Date of summary: Fri Sep 14 18:22:25 2018 
+## Date of fit:     Fri Sep 14 21:00:23 2018 
+## Date of summary: Fri Sep 14 21:00:23 2018 
 ## 
 ## Equations:
 ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 611 model solutions performed in 1.355 s
+## Fitted with method Port using 611 model solutions performed in 1.352 s
 ## 
 ## Weighting: none
 ## 
@@ -296,8 +296,8 @@
 
 
## mkin version used for fitting:    0.9.47.5 
 ## R version used for fitting:       3.5.1 
-## Date of fit:     Fri Sep 14 18:22:25 2018 
-## Date of summary: Fri Sep 14 18:22:25 2018 
+## Date of fit:     Fri Sep 14 21:00:24 2018 
+## Date of summary: Fri Sep 14 21:00:24 2018 
 ## 
 ## Equations:
 ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
@@ -367,8 +367,8 @@
 
 
## mkin version used for fitting:    0.9.47.5 
 ## R version used for fitting:       3.5.1 
-## Date of fit:     Fri Sep 14 18:22:26 2018 
-## Date of summary: Fri Sep 14 18:22:26 2018 
+## Date of fit:     Fri Sep 14 21:00:25 2018 
+## Date of summary: Fri Sep 14 21:00:25 2018 
 ## 
 ## Equations:
 ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -377,7 +377,7 @@
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 336 model solutions performed in 0.756 s
+## Fitted with method Port using 336 model solutions performed in 0.758 s
 ## 
 ## Weighting: none
 ## 
@@ -459,8 +459,8 @@
 
 
## mkin version used for fitting:    0.9.47.5 
 ## R version used for fitting:       3.5.1 
-## Date of fit:     Fri Sep 14 18:22:27 2018 
-## Date of summary: Fri Sep 14 18:22:28 2018 
+## Date of fit:     Fri Sep 14 21:00:26 2018 
+## Date of summary: Fri Sep 14 21:00:26 2018 
 ## 
 ## Equations:
 ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -469,7 +469,7 @@
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 137 model solutions performed in 0.322 s
+## Fitted with method Port using 137 model solutions performed in 0.31 s
 ## 
 ## Weighting: none
 ## 
@@ -560,15 +560,15 @@
 
 
## mkin version used for fitting:    0.9.47.5 
 ## R version used for fitting:       3.5.1 
-## Date of fit:     Fri Sep 14 18:22:28 2018 
-## Date of summary: Fri Sep 14 18:22:28 2018 
+## Date of fit:     Fri Sep 14 21:00:26 2018 
+## Date of summary: Fri Sep 14 21:00:27 2018 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 46 model solutions performed in 0.101 s
+## Fitted with method Port using 46 model solutions performed in 0.102 s
 ## 
 ## Weighting: none
 ## 
@@ -620,15 +620,15 @@
 
 
## mkin version used for fitting:    0.9.47.5 
 ## R version used for fitting:       3.5.1 
-## Date of fit:     Fri Sep 14 18:22:28 2018 
-## Date of summary: Fri Sep 14 18:22:28 2018 
+## Date of fit:     Fri Sep 14 21:00:26 2018 
+## Date of summary: Fri Sep 14 21:00:27 2018 
 ## 
 ## Equations:
 ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 66 model solutions performed in 0.16 s
+## Fitted with method Port using 66 model solutions performed in 0.151 s
 ## 
 ## Weighting: none
 ## 
diff --git a/docs/articles/web_only/compiled_models.html b/docs/articles/web_only/compiled_models.html
index 12c192f0..9aac1ab2 100644
--- a/docs/articles/web_only/compiled_models.html
+++ b/docs/articles/web_only/compiled_models.html
@@ -125,9 +125,9 @@
 }
## Lade nötiges Paket: rbenchmark
##                    test replications elapsed relative user.self sys.self
-## 3     deSolve, compiled            3   2.115    1.000     2.114        0
-## 1 deSolve, not compiled            3  16.235    7.676    16.228        0
-## 2      Eigenvalue based            3   2.589    1.224     2.587        0
+## 3     deSolve, compiled            3   2.134    1.000     2.132        0
+## 1 deSolve, not compiled            3  16.165    7.575    16.157        0
+## 2      Eigenvalue based            3   2.597    1.217     2.595        0
 ##   user.child sys.child
 ## 3          0         0
 ## 1          0         0
@@ -156,8 +156,8 @@
 }
## Successfully compiled differential equation model from auto-generated C code.
##                    test replications elapsed relative user.self sys.self
-## 2     deSolve, compiled            3   3.887    1.000     3.885        0
-## 1 deSolve, not compiled            3  35.492    9.131    35.474        0
+## 2     deSolve, compiled            3   3.717    1.000     3.715        0
+## 1 deSolve, not compiled            3  34.646    9.321    34.630        0
 ##   user.child sys.child
 ## 2          0         0
 ## 1          0         0
diff --git a/docs/news/index.html b/docs/news/index.html index cbfcdde0..73eb7aa2 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -124,14 +124,7 @@
  • Make the two-component error model stop in cases where it is inadequate to avoid nls crashes on windows

  • Move two vignettes to a location where they will not be built on CRAN (to avoid more NOTES from long execution times)

  • -
- -
-

-mkin 0.9.47.4 Unreleased -

-
    -
  • Exclude more example code from testing on CRAN to avoid NOTES from long execution times
  • +
  • Exclude more example code from testing on CRAN to avoid NOTES from long execution times

@@ -666,7 +659,6 @@

Contents

#> Successfully compiled differential equation model from auto-generated C code.
fit.1 <- mkinfit(SFO_SFO_SFO, subset(mccall81_245T, soil == "Commerce"), quiet = TRUE) summary(fit.1, data = FALSE)
#> mkin version used for fitting: 0.9.47.5 #> R version used for fitting: 3.5.1 -#> Date of fit: Fri Sep 14 18:20:57 2018 -#> Date of summary: Fri Sep 14 18:20:57 2018 +#> Date of fit: Fri Sep 14 20:58:58 2018 +#> Date of summary: Fri Sep 14 20:58:58 2018 #> #> Equations: #> d_T245/dt = - k_T245_sink * T245 - k_T245_phenol * T245 @@ -169,7 +169,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 574 model solutions performed in 3.418 s +#> Fitted with method Port using 574 model solutions performed in 3.393 s #> #> Weighting: none #> @@ -247,8 +247,8 @@ fixed_parms = "k_phenol_sink", quiet = TRUE) summary(fit.2, data = FALSE)
#> mkin version used for fitting: 0.9.47.5 #> R version used for fitting: 3.5.1 -#> Date of fit: Fri Sep 14 18:20:59 2018 -#> Date of summary: Fri Sep 14 18:20:59 2018 +#> Date of fit: Fri Sep 14 20:58:59 2018 +#> Date of summary: Fri Sep 14 20:59:00 2018 #> #> Equations: #> d_T245/dt = - k_T245_sink * T245 - k_T245_phenol * T245 @@ -258,7 +258,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 246 model solutions performed in 1.458 s +#> Fitted with method Port using 246 model solutions performed in 1.451 s #> #> Weighting: none #> diff --git a/docs/reference/mkinfit.html b/docs/reference/mkinfit.html index 261d48fb..f3c6d595 100644 --- a/docs/reference/mkinfit.html +++ b/docs/reference/mkinfit.html @@ -434,15 +434,15 @@ fit <- mkinfit("FOMC", FOCUS_2006_C, quiet = TRUE) summary(fit)
#> mkin version used for fitting: 0.9.47.5 #> R version used for fitting: 3.5.1 -#> Date of fit: Fri Sep 14 18:21:02 2018 -#> Date of summary: Fri Sep 14 18:21:02 2018 +#> Date of fit: Fri Sep 14 20:59:02 2018 +#> Date of summary: Fri Sep 14 20:59:02 2018 #> #> Equations: #> d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent #> #> Model predictions using solution type analytical #> -#> Fitted with method Port using 64 model solutions performed in 0.143 s +#> Fitted with method Port using 64 model solutions performed in 0.141 s #> #> Weighting: none #> @@ -511,7 +511,7 @@ m1 = mkinsub("SFO"))
#> Successfully compiled differential equation model from auto-generated C code.
# Fit the model to the FOCUS example dataset D using defaults print(system.time(fit <- mkinfit(SFO_SFO, FOCUS_2006_D, solution_type = "eigen", quiet = TRUE)))
#> User System verstrichen -#> 0.918 0.000 0.919
coef(fit)
#> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink +#> 0.895 0.000 0.897
coef(fit)
#> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink #> 99.59848 -3.03822 -2.98030 -5.24750
#> $ff #> parent_sink parent_m1 m1_sink #> 0.485524 0.514476 1.000000 @@ -586,7 +586,7 @@ #> Model cost at call 146 : 371.2134 #> Optimisation by method Port successfully terminated. #> User System verstrichen -#> 0.757 0.000 0.757
coef(fit.deSolve)
#> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink +#> 0.726 0.000 0.726
coef(fit.deSolve)
#> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink #> 99.59848 -3.03822 -2.98030 -5.24750
endpoints(fit.deSolve)
#> $ff #> parent_sink parent_m1 m1_sink #> 0.485524 0.514476 1.000000 @@ -624,8 +624,8 @@ m1 = mkinsub("SFO"), use_of_ff = "max")
#> Successfully compiled differential equation model from auto-generated C code.
f.noweight <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, quiet = TRUE) summary(f.noweight)
#> mkin version used for fitting: 0.9.47.5 #> R version used for fitting: 3.5.1 -#> Date of fit: Fri Sep 14 18:21:13 2018 -#> Date of summary: Fri Sep 14 18:21:13 2018 +#> Date of fit: Fri Sep 14 20:59:13 2018 +#> Date of summary: Fri Sep 14 20:59:13 2018 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -633,7 +633,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 186 model solutions performed in 0.775 s +#> Fitted with method Port using 186 model solutions performed in 0.757 s #> #> Weighting: none #> @@ -741,8 +741,8 @@ #> 120 m1 33.31 28.78984 4.520e+00
f.irls <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, reweight.method = "obs", quiet = TRUE) summary(f.irls)
#> mkin version used for fitting: 0.9.47.5 #> R version used for fitting: 3.5.1 -#> Date of fit: Fri Sep 14 18:21:15 2018 -#> Date of summary: Fri Sep 14 18:21:15 2018 +#> Date of fit: Fri Sep 14 20:59:15 2018 +#> Date of summary: Fri Sep 14 20:59:16 2018 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -750,7 +750,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 551 model solutions performed in 2.282 s +#> Fitted with method Port using 551 model solutions performed in 2.329 s #> #> Weighting: none #> @@ -863,8 +863,8 @@ #> 120 m1 33.31 28.80898 4.501e+00 2.722
f.w.mean <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, weight = "mean", quiet = TRUE) summary(f.w.mean)
#> mkin version used for fitting: 0.9.47.5 #> R version used for fitting: 3.5.1 -#> Date of fit: Fri Sep 14 18:21:16 2018 -#> Date of summary: Fri Sep 14 18:21:16 2018 +#> Date of fit: Fri Sep 14 20:59:16 2018 +#> Date of summary: Fri Sep 14 20:59:16 2018 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -872,7 +872,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 155 model solutions performed in 0.653 s +#> Fitted with method Port using 155 model solutions performed in 0.628 s #> #> Weighting: mean #> @@ -981,8 +981,8 @@ quiet = TRUE) summary(f.w.value)
#> mkin version used for fitting: 0.9.47.5 #> R version used for fitting: 3.5.1 -#> Date of fit: Fri Sep 14 18:21:17 2018 -#> Date of summary: Fri Sep 14 18:21:17 2018 +#> Date of fit: Fri Sep 14 20:59:17 2018 +#> Date of summary: Fri Sep 14 20:59:17 2018 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -990,7 +990,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 174 model solutions performed in 0.721 s +#> Fitted with method Port using 174 model solutions performed in 0.713 s #> #> Weighting: manual #> @@ -1101,8 +1101,8 @@ f.w.man <- mkinfit(SFO_SFO.ff, dw, err = "err.man", quiet = TRUE) summary(f.w.man)
#> mkin version used for fitting: 0.9.47.5 #> R version used for fitting: 3.5.1 -#> Date of fit: Fri Sep 14 18:21:18 2018 -#> Date of summary: Fri Sep 14 18:21:18 2018 +#> Date of fit: Fri Sep 14 20:59:18 2018 +#> Date of summary: Fri Sep 14 20:59:18 2018 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -1110,7 +1110,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 270 model solutions performed in 1.215 s +#> Fitted with method Port using 270 model solutions performed in 1.119 s #> #> Weighting: manual #> @@ -1219,8 +1219,8 @@ reweight.method = "obs") summary(f.w.man.irls)
#> mkin version used for fitting: 0.9.47.5 #> R version used for fitting: 3.5.1 -#> Date of fit: Fri Sep 14 18:21:22 2018 -#> Date of summary: Fri Sep 14 18:21:22 2018 +#> Date of fit: Fri Sep 14 20:59:21 2018 +#> Date of summary: Fri Sep 14 20:59:21 2018 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -1228,7 +1228,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 692 model solutions performed in 3.114 s +#> Fitted with method Port using 692 model solutions performed in 2.955 s #> #> Weighting: manual #> diff --git a/docs/reference/mkinmod.html b/docs/reference/mkinmod.html index 9048c1b1..464178bc 100644 --- a/docs/reference/mkinmod.html +++ b/docs/reference/mkinmod.html @@ -229,7 +229,7 @@ For the definition of model types and their parameters, the equations given SFO_SFO <- mkinmod( parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"), verbose = TRUE)
#> Compilation argument: -#> /usr/lib/R/bin/R CMD SHLIB file49ec17c0788e.c 2> file49ec17c0788e.c.err.txt +#> /usr/lib/R/bin/R CMD SHLIB file7aee6cc2a6d.c 2> file7aee6cc2a6d.c.err.txt #> Program source: #> 1: #include <R.h> #> 2: diff --git a/docs/reference/mkinpredict.html b/docs/reference/mkinpredict.html index 6c30d7a8..dfcd08a8 100644 --- a/docs/reference/mkinpredict.html +++ b/docs/reference/mkinpredict.html @@ -321,17 +321,17 @@ c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "eigen")[201,]))
#> time parent m1 #> 201 20 4.978707 27.46227
#> User System verstrichen -#> 0.003 0.000 0.003
system.time( +#> 0.004 0.000 0.003
system.time( print(mkinpredict(SFO_SFO, c(k_parent_m1 = 0.05, k_parent_sink = 0.1, k_m1_sink = 0.01), c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "deSolve")[201,]))
#> time parent m1 #> 201 20 4.978707 27.46227
#> User System verstrichen -#> 0.002 0.000 0.002
system.time( +#> 0.001 0.000 0.002
system.time( print(mkinpredict(SFO_SFO, c(k_parent_m1 = 0.05, k_parent_sink = 0.1, k_m1_sink = 0.01), c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "deSolve", use_compiled = FALSE)[201,]))
#> time parent m1 #> 201 20 4.978707 27.46227
#> User System verstrichen -#> 0.035 0.000 0.035
+#> 0.036 0.000 0.036
#> User System verstrichen -#> 0.059 0.027 6.918
time_1
#> User System verstrichen -#> 21.127 0.000 21.141
+#> 0.056 0.024 6.712
time_1
#> User System verstrichen +#> 20.446 0.000 20.459
endpoints(fits.0[["SFO_lin", 2]])
#> $ff #> parent_M1 parent_sink M1_M2 M1_sink #> 0.7340480 0.2659520 0.7505686 0.2494314 diff --git a/docs/reference/summary.mkinfit.html b/docs/reference/summary.mkinfit.html index cb6beda2..317c7a87 100644 --- a/docs/reference/summary.mkinfit.html +++ b/docs/reference/summary.mkinfit.html @@ -206,15 +206,15 @@

Examples

summary(mkinfit(mkinmod(parent = mkinsub("SFO")), FOCUS_2006_A, quiet = TRUE))
#> mkin version used for fitting: 0.9.47.5 #> R version used for fitting: 3.5.1 -#> Date of fit: Fri Sep 14 18:22:10 2018 -#> Date of summary: Fri Sep 14 18:22:10 2018 +#> Date of fit: Fri Sep 14 21:00:08 2018 +#> Date of summary: Fri Sep 14 21:00:08 2018 #> #> Equations: #> d_parent/dt = - k_parent_sink * parent #> #> Model predictions using solution type analytical #> -#> Fitted with method Port using 35 model solutions performed in 0.076 s +#> Fitted with method Port using 35 model solutions performed in 0.081 s #> #> Weighting: none #> diff --git a/docs/reference/transform_odeparms.html b/docs/reference/transform_odeparms.html index db92667c..6f7ec4a4 100644 --- a/docs/reference/transform_odeparms.html +++ b/docs/reference/transform_odeparms.html @@ -200,8 +200,8 @@ The transformation of sets of formation fractions is fragile, as it supposes fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE) summary(fit, data=FALSE) # See transformed and backtransformed parameters
#> mkin version used for fitting: 0.9.47.5 #> R version used for fitting: 3.5.1 -#> Date of fit: Fri Sep 14 18:22:17 2018 -#> Date of summary: Fri Sep 14 18:22:17 2018 +#> Date of fit: Fri Sep 14 21:00:16 2018 +#> Date of summary: Fri Sep 14 21:00:16 2018 #> #> Equations: #> d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent @@ -209,7 +209,7 @@ The transformation of sets of formation fractions is fragile, as it supposes #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 153 model solutions performed in 0.701 s +#> Fitted with method Port using 153 model solutions performed in 0.71 s #> #> Weighting: none #> @@ -276,8 +276,8 @@ The transformation of sets of formation fractions is fragile, as it supposes
fit.2 <- mkinfit(SFO_SFO, FOCUS_2006_D, transform_rates = FALSE, quiet = TRUE) summary(fit.2, data=FALSE)
#> mkin version used for fitting: 0.9.47.5 #> R version used for fitting: 3.5.1 -#> Date of fit: Fri Sep 14 18:22:19 2018 -#> Date of summary: Fri Sep 14 18:22:19 2018 +#> Date of fit: Fri Sep 14 21:00:17 2018 +#> Date of summary: Fri Sep 14 21:00:17 2018 #> #> Equations: #> d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent @@ -285,7 +285,7 @@ The transformation of sets of formation fractions is fragile, as it supposes #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 350 model solutions performed in 1.431 s +#> Fitted with method Port using 350 model solutions performed in 1.417 s #> #> Weighting: none #> @@ -364,8 +364,8 @@ The transformation of sets of formation fractions is fragile, as it supposes fit.ff <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, quiet = TRUE) summary(fit.ff, data = FALSE)
#> mkin version used for fitting: 0.9.47.5 #> R version used for fitting: 3.5.1 -#> Date of fit: Fri Sep 14 18:22:20 2018 -#> Date of summary: Fri Sep 14 18:22:20 2018 +#> Date of fit: Fri Sep 14 21:00:18 2018 +#> Date of summary: Fri Sep 14 21:00:18 2018 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -373,7 +373,7 @@ The transformation of sets of formation fractions is fragile, as it supposes #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 186 model solutions performed in 0.778 s +#> Fitted with method Port using 186 model solutions performed in 0.755 s #> #> Weighting: none #> @@ -448,8 +448,8 @@ The transformation of sets of formation fractions is fragile, as it supposes fit.ff.2 <- mkinfit(SFO_SFO.ff.2, FOCUS_2006_D, quiet = TRUE) summary(fit.ff.2, data = FALSE)
#> mkin version used for fitting: 0.9.47.5 #> R version used for fitting: 3.5.1 -#> Date of fit: Fri Sep 14 18:22:20 2018 -#> Date of summary: Fri Sep 14 18:22:20 2018 +#> Date of fit: Fri Sep 14 21:00:19 2018 +#> Date of summary: Fri Sep 14 21:00:19 2018 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -457,7 +457,7 @@ The transformation of sets of formation fractions is fragile, as it supposes #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 104 model solutions performed in 0.417 s +#> Fitted with method Port using 104 model solutions performed in 0.416 s #> #> Weighting: none #> diff --git a/test.log b/test.log index aab7d12b..c4ced344 100644 --- a/test.log +++ b/test.log @@ -3,17 +3,16 @@ Loading required package: testthat Testing mkin ✔ | OK F W S | Context ⠏ | 0 | Calculation of FOCUS chi2 error levels ⠋ | 1 | Calculation of FOCUS chi2 error levels ⠙ | 2 | Calculation of FOCUS chi2 error levels ✔ | 2 | Calculation of FOCUS chi2 error levels [2.2 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) ✔ | 6 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [2.2 s] - ⠏ | 0 | The t-test for significant difference from zero ⠋ | 1 | The t-test for significant difference from zero ⠙ | 2 | The t-test for significant difference from zero ✔ | 2 | The t-test for significant difference from zero [4.3 s] - ⠏ | 0 | Iteratively reweighted least squares (IRLS) fitting ⠋ | 1 | Iteratively reweighted least squares (IRLS) fitting ⠙ | 2 | Iteratively reweighted least squares (IRLS) fitting ⠹ | 3 | Iteratively reweighted least squares (IRLS) fitting ✔ | 3 | Iteratively reweighted least squares (IRLS) fitting [36.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) ✔ | 8 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [6.5 s] + ⠏ | 0 | Iteratively reweighted least squares (IRLS) fitting ⠋ | 1 | Iteratively reweighted least squares (IRLS) fitting ⠙ | 2 | Iteratively reweighted least squares (IRLS) fitting ⠹ | 3 | Iteratively reweighted least squares (IRLS) fitting ✔ | 3 | Iteratively reweighted least squares (IRLS) fitting [36.6 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 | 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 [21.8 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.4 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 [22.6 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) [6.7 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) ✔ | 3 | Calculation of maximum time weighted average concentrations (TWAs) [4.6 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) ✔ | 3 | Calculation of maximum time weighted average concentrations (TWAs) [3.8 s] ══ Results ═════════════════════════════════════════════════════════════════════ -Duration: 84.0 s +Duration: 84.2 s OK: 46 Failed: 0 diff --git a/tests/testthat/test_FOCUS_D_UBA_expertise.R b/tests/testthat/test_FOCUS_D_UBA_expertise.R index 5d5a801a..3b241aa4 100644 --- a/tests/testthat/test_FOCUS_D_UBA_expertise.R +++ b/tests/testthat/test_FOCUS_D_UBA_expertise.R @@ -1,4 +1,4 @@ -# Copyright (C) 2015 Johannes Ranke +# Copyright (C) 2015,2018 Johannes Ranke # Contact: jranke@uni-bremen.de # This file is part of the R package mkin @@ -18,69 +18,59 @@ context("Results for FOCUS D established in expertise for UBA (Ranke 2014)") -SFO_SFO <- mkinmod(parent = list(type = "SFO", to = "m1"), - m1 = list(type = "SFO"), quiet = TRUE) -SFO_SFO.ff <- mkinmod(parent = list(type = "SFO", to = "m1"), - m1 = list(type = "SFO"), - use_of_ff = "max", quiet = TRUE) +# Results are from p. 40 -fit.default <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE) -fit.ff <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, quiet = TRUE) +test_that("Fits without formation fractions are correct for FOCUS D", { + SFO_SFO <- mkinmod(parent = list(type = "SFO", to = "m1"), + m1 = list(type = "SFO"), quiet = TRUE) + fit.default <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE) -# Results are from p. 40 + expect_equal(round(as.numeric(endpoints(fit.default)$distimes["parent", ]), 2), + c(7.02, 23.33)) + expect_equal(round(as.numeric(endpoints(fit.default)$distimes["m1", ]), 1), + c(131.8, 437.7)) -test_that("Fitted parameters are correct for FOCUS D", { + expect_equal(signif(summary(fit.default)$bpar[, "t value"], 5), + c(parent_0 = 61.720, k_parent_sink = 12.777, k_parent_m1 = 24.248, k_m1_sink = 7.3486)) +}) + +test_that("Fits with formation fractions are correct for FOCUS D", { + skip_on_cran() + SFO_SFO.ff <- mkinmod(parent = list(type = "SFO", to = "m1"), + m1 = list(type = "SFO"), + use_of_ff = "max", quiet = TRUE) + + fit.ff <- mkinfit(SFO_SFO.ff, FOCUS_2006_D, quiet = TRUE) expect_equivalent(round(fit.ff$bparms.optim, c(2, 4, 4, 4)), c(99.60, 0.0987, 0.0053, 0.5145)) -}) -test_that("FOCUS chi2 error levels are correct for FOCUS D", { expect_equivalent(round(100 * mkinerrmin(fit.ff)$err.min, 2), c(6.40, 6.46, 4.69)) -}) -test_that("DT50/90 are correct for FOCUS D when using formation fractions", { expect_equal(round(as.numeric(endpoints(fit.ff)$distimes["parent", ]), 2), c(7.02, 23.33)) expect_equal(round(as.numeric(endpoints(fit.ff)$distimes["m1", ]), 1), c(131.8, 437.7)) }) -test_that("DT50/90 are correct for FOCUS D when not using formation fractions", { - expect_equal(round(as.numeric(endpoints(fit.default)$distimes["parent", ]), 2), - c(7.02, 23.33)) - expect_equal(round(as.numeric(endpoints(fit.default)$distimes["m1", ]), 1), - c(131.8, 437.7)) -}) - # References: # Ranke (2014) Prüfung und Validierung von Modellierungssoftware als Alternative # zu ModelMaker 4.0, Umweltbundesamt Projektnummer 27452 -context("The t-test for significant difference from zero") - -test_that("The t-value for fits using internal transformations corresponds with result from FME", { - - expect_equal(signif(summary(fit.default)$bpar[, "t value"], 5), - c(parent_0 = 61.720, k_parent_sink = 12.777, k_parent_m1 = 24.248, k_m1_sink = 7.3486)) - -}) - -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) - 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) # 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_mkinpredict_SFO_SFO.R b/tests/testthat/test_mkinpredict_SFO_SFO.R index b7004f64..3fcdb3a2 100644 --- a/tests/testthat/test_mkinpredict_SFO_SFO.R +++ b/tests/testthat/test_mkinpredict_SFO_SFO.R @@ -1,6 +1,4 @@ -# $Id: jranke $ - -# Copyright (C) 2012-2015 Johannes Ranke +# Copyright (C) 2012-2015,2018 Johannes Ranke # Contact: jranke@uni-bremen.de # This file is part of the R package mkin diff --git a/tests/testthat/test_parent_only.R b/tests/testthat/test_parent_only.R index ee0cc144..7521e145 100644 --- a/tests/testthat/test_parent_only.R +++ b/tests/testthat/test_parent_only.R @@ -165,6 +165,7 @@ test_that("Fits for FOCUS C deviate less than 0.1% from median of values from FO }) test_that("SFO fits give approximately (0.001%) equal results with different solution methods", { + skip_on_cran() fit.A.SFO.default <- mkinfit("SFO", FOCUS_2006_A, quiet = TRUE)$bparms.optim fits.A.SFO <- list() @@ -179,6 +180,7 @@ test_that("SFO fits give approximately (0.001%) equal results with different sol }) test_that("FOMC fits give approximately (0.001%) equal results with different solution methods", { + skip_on_cran() fit.C.FOMC.default <- mkinfit("FOMC", FOCUS_2006_C, quiet = TRUE)$bparms.optim fits.C.FOMC <- list() @@ -191,6 +193,7 @@ test_that("FOMC fits give approximately (0.001%) equal results with different so }) test_that("DFOP fits give approximately (0.001%) equal results with different solution methods", { + skip_on_cran() fit.C.DFOP.default <- mkinfit("DFOP", FOCUS_2006_C, quiet = TRUE)$bparms.optim fits.C.DFOP <- list() diff --git a/tests/testthat/test_synthetic_data_for_UBA_2014.R b/tests/testthat/test_synthetic_data_for_UBA_2014.R index fd3e8bba..6856a9a3 100644 --- a/tests/testthat/test_synthetic_data_for_UBA_2014.R +++ b/tests/testthat/test_synthetic_data_for_UBA_2014.R @@ -20,6 +20,7 @@ context("Results for synthetic data established in expertise for UBA (Ranke 2014 test_that("Results are correct for SFO_lin_a", { + skip_on_cran() m_synth_SFO_lin <- mkinmod(parent = mkinsub("SFO", "M1"), M1 = mkinsub("SFO", "M2"), M2 = mkinsub("SFO"), diff --git a/tests/testthat/test_twa.R b/tests/testthat/test_twa.R index d5c0b98b..a84b2c4e 100644 --- a/tests/testthat/test_twa.R +++ b/tests/testthat/test_twa.R @@ -18,11 +18,13 @@ context("Calculation of maximum time weighted average concentrations (TWAs)") -twa_models <- c("SFO", "FOMC", "DFOP") -fits <- mmkin(twa_models, list(FOCUS_D = FOCUS_2006_D), - quiet = TRUE, cores = 1) test_that("Time weighted average concentrations are correct", { + skip_on_cran() + twa_models <- c("SFO", "FOMC", "DFOP") + fits <- mmkin(twa_models, list(FOCUS_D = FOCUS_2006_D), + quiet = TRUE, cores = 1) + outtimes_7 <- seq(0, 7, length.out = 10000) for (model in twa_models) { fit <- fits[[model, 1]] -- cgit v1.2.1