From 396e40d2c45d81a8e74c41a2f632665021e980a1 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 26 Feb 2019 20:28:15 +0100 Subject: NAFTA SOP Attachment vignette Also: - Change rounding in print.nafta - Add dots argument to nafta() - Use cores=1 in examples - Restrict N in IORE model to values > 0 --- R/mkinfit.R | 4 + R/nafta.R | 6 +- _pkgdown.yml | 2 + build.log | 1 - check.log | 20 +- data/NAFTA_SOP_Attachment.rda | Bin 0 -> 1623 bytes docs/articles/FOCUS_D.html | 6 +- docs/articles/FOCUS_L.html | 32 +- docs/articles/index.html | 1 + docs/articles/web_only/NAFTA_examples.html | 933 +++++++++++++++++++++ .../NAFTA_examples_files/figure-html/p10-1.png | Bin 0 -> 53961 bytes .../NAFTA_examples_files/figure-html/p11-1.png | Bin 0 -> 51343 bytes .../NAFTA_examples_files/figure-html/p12a-1.png | Bin 0 -> 54599 bytes .../NAFTA_examples_files/figure-html/p12b-1.png | Bin 0 -> 47216 bytes .../NAFTA_examples_files/figure-html/p13-1.png | Bin 0 -> 51514 bytes .../NAFTA_examples_files/figure-html/p14-1.png | Bin 0 -> 54064 bytes .../NAFTA_examples_files/figure-html/p15a-1.png | Bin 0 -> 51221 bytes .../NAFTA_examples_files/figure-html/p15b-1.png | Bin 0 -> 53121 bytes .../NAFTA_examples_files/figure-html/p16-1.png | Bin 0 -> 62569 bytes .../NAFTA_examples_files/figure-html/p5a-1.png | Bin 0 -> 55421 bytes .../NAFTA_examples_files/figure-html/p5b-1.png | Bin 0 -> 53575 bytes .../NAFTA_examples_files/figure-html/p6-1.png | Bin 0 -> 54970 bytes .../NAFTA_examples_files/figure-html/p7-1.png | Bin 0 -> 66810 bytes .../NAFTA_examples_files/figure-html/p8-1.png | Bin 0 -> 61563 bytes .../NAFTA_examples_files/figure-html/p9a-1.png | Bin 0 -> 53090 bytes .../NAFTA_examples_files/figure-html/p9b-1.png | Bin 0 -> 50040 bytes docs/articles/web_only/compiled_models.html | 10 +- docs/authors.html | 3 + docs/index.html | 3 + docs/pkgdown.yml | 1 + docs/reference/AIC.mmkin.html | 4 +- docs/reference/Extract.mmkin.html | 12 +- docs/reference/NAFTA_SOP_2015.html | 13 +- docs/reference/NAFTA_SOP_Attachment-1.png | Bin 0 -> 42277 bytes docs/reference/NAFTA_SOP_Attachment.html | 217 +++++ docs/reference/index.html | 4 +- docs/reference/mccall81_245T.html | 12 +- docs/reference/mkinfit.html | 44 +- docs/reference/mkinmod.html | 2 +- docs/reference/mkinpredict.html | 4 +- docs/reference/mmkin.html | 4 +- docs/reference/nafta.html | 19 +- docs/reference/plot.nafta.html | 12 +- docs/reference/print.nafta.html | 8 +- docs/reference/summary.mkinfit.html | 6 +- docs/reference/transform_odeparms.html | 24 +- man/AIC.mmkin.Rd | 2 +- man/NAFTA_SOP_2015.Rd | 2 +- man/NAFTA_SOP_Attachment.Rd | 31 + man/nafta.Rd | 8 +- man/plot.nafta.Rd | 4 +- man/print.nafta.Rd | 4 +- test.log | 43 +- tests/testthat/NAFTA_SOP_Appendix_B.txt | 16 +- tests/testthat/NAFTA_SOP_Appendix_D.txt | 10 +- tests/testthat/test_nafta.R | 2 +- vignettes/web_only/NAFTA_examples.Rmd | 243 ++++++ 57 files changed, 1616 insertions(+), 156 deletions(-) create mode 100644 data/NAFTA_SOP_Attachment.rda create mode 100644 docs/articles/web_only/NAFTA_examples.html create mode 100644 docs/articles/web_only/NAFTA_examples_files/figure-html/p10-1.png create mode 100644 docs/articles/web_only/NAFTA_examples_files/figure-html/p11-1.png create mode 100644 docs/articles/web_only/NAFTA_examples_files/figure-html/p12a-1.png create mode 100644 docs/articles/web_only/NAFTA_examples_files/figure-html/p12b-1.png create mode 100644 docs/articles/web_only/NAFTA_examples_files/figure-html/p13-1.png create mode 100644 docs/articles/web_only/NAFTA_examples_files/figure-html/p14-1.png create mode 100644 docs/articles/web_only/NAFTA_examples_files/figure-html/p15a-1.png create mode 100644 docs/articles/web_only/NAFTA_examples_files/figure-html/p15b-1.png create mode 100644 docs/articles/web_only/NAFTA_examples_files/figure-html/p16-1.png create mode 100644 docs/articles/web_only/NAFTA_examples_files/figure-html/p5a-1.png create mode 100644 docs/articles/web_only/NAFTA_examples_files/figure-html/p5b-1.png create mode 100644 docs/articles/web_only/NAFTA_examples_files/figure-html/p6-1.png create mode 100644 docs/articles/web_only/NAFTA_examples_files/figure-html/p7-1.png create mode 100644 docs/articles/web_only/NAFTA_examples_files/figure-html/p8-1.png create mode 100644 docs/articles/web_only/NAFTA_examples_files/figure-html/p9a-1.png create mode 100644 docs/articles/web_only/NAFTA_examples_files/figure-html/p9b-1.png create mode 100644 docs/reference/NAFTA_SOP_Attachment-1.png create mode 100644 docs/reference/NAFTA_SOP_Attachment.html create mode 100644 man/NAFTA_SOP_Attachment.Rd create mode 100644 vignettes/web_only/NAFTA_examples.Rmd diff --git a/R/mkinfit.R b/R/mkinfit.R index 2dec3a72..63455300 100644 --- a/R/mkinfit.R +++ b/R/mkinfit.R @@ -374,6 +374,10 @@ mkinfit <- function(mkinmod, observed, lower <- rep(-Inf, length(c(state.ini.optim, transparms.optim))) upper <- rep(Inf, length(c(state.ini.optim, transparms.optim))) names(lower) <- names(upper) <- c(names(state.ini.optim), names(transparms.optim)) + + # IORE exponentes are not transformed, but need a lower bound of zero + index_N <- grep("^N", names(lower)) + lower[index_N] <- 0 if (!transform_rates) { index_k <- grep("^k_", names(lower)) lower[index_k] <- 0 diff --git a/R/nafta.R b/R/nafta.R index 03bd77c1..d4d63f6b 100644 --- a/R/nafta.R +++ b/R/nafta.R @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License along with # this program. If not, see -nafta <- function(ds, title = NA, quiet = FALSE) { +nafta <- function(ds, title = NA, quiet = FALSE, ...) { if (length(levels(ds$name)) > 1) { stop("The NAFTA procedure is only defined for decline data for a single compound") } @@ -24,7 +24,7 @@ nafta <- function(ds, title = NA, quiet = FALSE) { models <- c("SFO", "IORE", "DFOP") result <- list(title = title, data = ds) - result$mmkin <- mmkin(models, list(ds), quiet = TRUE) + result$mmkin <- mmkin(models, list(ds), quiet = TRUE, ...) distimes <- lapply(result$mmkin, function(x) as.numeric(endpoints(x)$distimes["parent", ])) @@ -73,7 +73,7 @@ print.nafta <- function(x, quiet = TRUE, ...) { print(x$parameters) t_rep <- .evaluate_nafta_results(x$S, x$S_c, x$distimes, quiet = quiet) cat("\nDTx values:\n") - print(round((x$distimes), digits = 0)) + print(signif((x$distimes), 3)) cat("\nRepresentative half-life:\n") print(t_rep) } diff --git a/_pkgdown.yml b/_pkgdown.yml index 041d7507..62dc7f07 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -97,5 +97,7 @@ navbar: href: articles/web_only/compiled_models.html - text: Calculation of time weighted average concentrations with mkin href: articles/twa.html + - text: Example evaluation of NAFTA SOP Attachment examples + href: articles/web_only/NAFTA_examples.html - text: News href: news/index.html diff --git a/build.log b/build.log index 217b621f..6831459d 100644 --- a/build.log +++ b/build.log @@ -5,7 +5,6 @@ * creating vignettes ... OK * checking for LF line-endings in source and make files and shell scripts * checking for empty or unneeded directories -Removed empty directory ‘mkin/tests/figs/export-dataset-for-reading-into-cake’ * looking to see if a ‘data/datalist’ file should be added * building ‘mkin_0.9.48.1.tar.gz’ diff --git a/check.log b/check.log index 3afdb1b6..3802c49f 100644 --- a/check.log +++ b/check.log @@ -1,14 +1,17 @@ * using log directory ‘/home/jranke/git/mkin/mkin.Rcheck’ -* using R version 3.5.1 (2018-07-02) +* using R version 3.5.2 (2018-12-20) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using options ‘--no-tests --as-cran’ * checking for file ‘mkin/DESCRIPTION’ ... OK * checking extension type ... Package -* this is package ‘mkin’ version ‘0.9.47.6’ +* this is package ‘mkin’ version ‘0.9.48.1’ * package encoding: UTF-8 -* checking CRAN incoming feasibility ... Note_to_CRAN_maintainers +* checking CRAN incoming feasibility ... NOTE Maintainer: ‘Johannes Ranke ’ + +Unknown, possibly mis-spelled, fields in DESCRIPTION: + ‘Remotes’ * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK @@ -55,7 +58,10 @@ Maintainer: ‘Johannes Ranke ’ * checking data for ASCII and uncompressed saves ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK -* checking examples ... OK +* checking examples ... NOTE +Examples with CPU or elapsed time > 5s + user system elapsed +logLik.mkinfit 6.66 0.075 6.737 * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... SKIPPED * checking for unstated dependencies in vignettes ... OK @@ -64,5 +70,9 @@ Maintainer: ‘Johannes Ranke ’ * checking PDF version of manual ... OK * DONE -Status: OK +Status: 2 NOTEs +See + ‘/home/jranke/git/mkin/mkin.Rcheck/00check.log’ +for details. + diff --git a/data/NAFTA_SOP_Attachment.rda b/data/NAFTA_SOP_Attachment.rda new file mode 100644 index 00000000..4e59a39d Binary files /dev/null and b/data/NAFTA_SOP_Attachment.rda differ diff --git a/docs/articles/FOCUS_D.html b/docs/articles/FOCUS_D.html index 5c1cc0dd..9030710e 100644 --- a/docs/articles/FOCUS_D.html +++ b/docs/articles/FOCUS_D.html @@ -163,8 +163,8 @@
summary(fit)
## mkin version used for fitting:    0.9.48.1 
 ## R version used for fitting:       3.5.2 
-## Date of fit:     Tue Feb 26 09:29:03 2019 
-## Date of summary: Tue Feb 26 09:29:03 2019 
+## Date of fit:     Tue Feb 26 20:25:04 2019 
+## Date of summary: Tue Feb 26 20:25:04 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent
@@ -172,7 +172,7 @@
 ## 
 ## Model predictions using solution type deSolve 
 ## 
-## Fitted with method Port using 153 model solutions performed in 0.681 s
+## Fitted with method Port using 153 model solutions performed in 0.7 s
 ## 
 ## Weighting: none
 ## 
diff --git a/docs/articles/FOCUS_L.html b/docs/articles/FOCUS_L.html
index 57bd4d34..a6853c97 100644
--- a/docs/articles/FOCUS_L.html
+++ b/docs/articles/FOCUS_L.html
@@ -111,8 +111,8 @@
 summary(m.L1.SFO)
## mkin version used for fitting:    0.9.48.1 
 ## R version used for fitting:       3.5.2 
-## Date of fit:     Tue Feb 26 09:29:05 2019 
-## Date of summary: Tue Feb 26 09:29:05 2019 
+## Date of fit:     Tue Feb 26 20:25:06 2019 
+## Date of summary: Tue Feb 26 20:25:06 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent
@@ -202,15 +202,15 @@
 
summary(m.L1.FOMC, data = FALSE)
## mkin version used for fitting:    0.9.48.1 
 ## R version used for fitting:       3.5.2 
-## Date of fit:     Tue Feb 26 09:29:06 2019 
-## Date of summary: Tue Feb 26 09:29:06 2019 
+## Date of fit:     Tue Feb 26 20:25:08 2019 
+## Date of summary: Tue Feb 26 20:25:08 2019 
 ## 
 ## 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.51 s
+## Fitted with method Port using 611 model solutions performed in 1.509 s
 ## 
 ## Weighting: none
 ## 
@@ -297,8 +297,8 @@
 
summary(m.L2.FOMC, data = FALSE)
## mkin version used for fitting:    0.9.48.1 
 ## R version used for fitting:       3.5.2 
-## Date of fit:     Tue Feb 26 09:29:07 2019 
-## Date of summary: Tue Feb 26 09:29:07 2019 
+## Date of fit:     Tue Feb 26 20:25:08 2019 
+## Date of summary: Tue Feb 26 20:25:08 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
@@ -368,8 +368,8 @@
 
summary(m.L2.DFOP, data = FALSE)
## mkin version used for fitting:    0.9.48.1 
 ## R version used for fitting:       3.5.2 
-## Date of fit:     Tue Feb 26 09:29:08 2019 
-## Date of summary: Tue Feb 26 09:29:08 2019 
+## Date of fit:     Tue Feb 26 20:25:09 2019 
+## Date of summary: Tue Feb 26 20:25:09 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -460,8 +460,8 @@
 
summary(mm.L3[["DFOP", 1]])
## mkin version used for fitting:    0.9.48.1 
 ## R version used for fitting:       3.5.2 
-## Date of fit:     Tue Feb 26 09:29:09 2019 
-## Date of summary: Tue Feb 26 09:29:09 2019 
+## Date of fit:     Tue Feb 26 20:25:10 2019 
+## Date of summary: Tue Feb 26 20:25:11 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -470,7 +470,7 @@
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 137 model solutions performed in 0.343 s
+## Fitted with method Port using 137 model solutions performed in 0.344 s
 ## 
 ## Weighting: none
 ## 
@@ -561,8 +561,8 @@
 
summary(mm.L4[["SFO", 1]], data = FALSE)
## mkin version used for fitting:    0.9.48.1 
 ## R version used for fitting:       3.5.2 
-## Date of fit:     Tue Feb 26 09:29:10 2019 
-## Date of summary: Tue Feb 26 09:29:10 2019 
+## Date of fit:     Tue Feb 26 20:25:11 2019 
+## Date of summary: Tue Feb 26 20:25:11 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent
@@ -621,8 +621,8 @@
 
summary(mm.L4[["FOMC", 1]], data = FALSE)
## mkin version used for fitting:    0.9.48.1 
 ## R version used for fitting:       3.5.2 
-## Date of fit:     Tue Feb 26 09:29:10 2019 
-## Date of summary: Tue Feb 26 09:29:10 2019 
+## Date of fit:     Tue Feb 26 20:25:11 2019 
+## Date of summary: Tue Feb 26 20:25:11 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
diff --git a/docs/articles/index.html b/docs/articles/index.html
index a1c08835..49a501b7 100644
--- a/docs/articles/index.html
+++ b/docs/articles/index.html
@@ -128,6 +128,7 @@
         
  • Introduction to mkin
  • Calculation of time weighted average concentrations with mkin
  • Example evaluation of FOCUS dataset Z
  • +
  • Evaluation of example datasets from Attachment 1 to the US EPA SOP for the NAFTA guidance
  • Performance benefit by using compiled model definitions in mkin
  • diff --git a/docs/articles/web_only/NAFTA_examples.html b/docs/articles/web_only/NAFTA_examples.html new file mode 100644 index 00000000..bd202a54 --- /dev/null +++ b/docs/articles/web_only/NAFTA_examples.html @@ -0,0 +1,933 @@ + + + + + + + +Evaluation of example datasets from Attachment 1 to the US EPA SOP for the NAFTA guidance • mkin + + + + + + + + + +
    +
    + + + +
    +
    + + + + +
    +

    +Introduction

    +

    In this document, the example evaluations provided in Attachment 1 to the SOP of US EPA for using the NAFTA guidance (US EPA 2015) are repeated using mkin. The original evaluations reported in the attachment were performed using PestDF in version 0.8.4. Note that PestDF 0.8.13 is the version distributed at the US EPA website today (2019-02-26).

    +

    The datasets are now distributed with the mkin package.

    +
    +
    +

    +Examples where DFOP did not converge with PestDF 0.8.4

    +

    In attachment 1, it is reported that the DFOP model does not converge for these datasets when PestDF 0.8.4 was used. For all four datasets, the DFOP model can be fitted with mkin (see below). The negative half-life given by PestDF 0.8.4 for these fits appears to be the result of a bug. The results for the other two models (SFO and IORE) are the same.

    +
    +

    +Example on page 5, upper panel

    +
    p5a <- nafta(NAFTA_SOP_Attachment[["p5a"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    +
    plot(p5a)
    +

    +
    print(p5a)
    +
    ## Sums of squares:
    +##       SFO      IORE      DFOP 
    +## 465.21753  56.27506  32.06401 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 64.4304
    +## 
    +## Parameters:
    +## $SFO
    +##                  Estimate       Pr(>t)        Lower       Upper
    +## parent_0      95.84012168 1.095639e-21 92.120517864 99.55972549
    +## k_parent_sink  0.01024015 1.710227e-12  0.008996874  0.01165524
    +## 
    +## $IORE
    +##                         Estimate       Pr(>t)        Lower        Upper
    +## parent_0            1.007532e+02 2.365797e-26 9.891170e+01 1.025947e+02
    +## k__iore_parent_sink 1.544192e-05 8.733384e-02 3.482391e-06 6.847393e-05
    +## N_parent            2.569877e+00 1.140446e-11 2.215298e+00 2.924456e+00
    +## 
    +## $DFOP
    +##              Estimate       Pr(>t) Lower Upper
    +## parent_0 9.994630e+01 4.330861e-27    NA    NA
    +## k1       2.674255e-02 3.171390e-05    NA    NA
    +## k2       2.161318e-12 5.000000e-01    NA    NA
    +## g        6.465276e-01 2.129114e-05    NA    NA
    +## 
    +## 
    +## DTx values:
    +##      DT50     DT90 DT50_rep
    +## SFO  67.7 2.25e+02 6.77e+01
    +## IORE 58.2 1.07e+03 3.22e+02
    +## DFOP 55.5 5.84e+11 3.21e+11
    +## 
    +## Representative half-life:
    +## [1] 321.5119
    +
    +
    +

    +Example on page 5, lower panel

    +
    p5b <- nafta(NAFTA_SOP_Attachment[["p5b"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    +
    plot(p5b)
    +

    +
    print(p5b)
    +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 94.81123 10.10936  7.55871 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 11.77879
    +## 
    +## Parameters:
    +## $SFO
    +##                   Estimate       Pr(>t)        Lower        Upper
    +## parent_0      96.497133849 2.623748e-25 94.776528606 98.217739092
    +## k_parent_sink  0.008002704 1.352275e-14  0.007356108  0.008706135
    +## 
    +## $IORE
    +##                         Estimate       Pr(>t)        Lower        Upper
    +## parent_0            9.854518e+01 1.019174e-29 9.780760e+01 9.928276e+01
    +## k__iore_parent_sink 1.532766e-04 1.152046e-02 6.603390e-05 3.557826e-04
    +## N_parent            1.939125e+00 8.177751e-13 1.741616e+00 2.136633e+00
    +## 
    +## $DFOP
    +##              Estimate       Pr(>t) Lower Upper
    +## parent_0 9.836323e+01 1.896304e-28    NA    NA
    +## k1       1.546859e-02 2.833415e-03    NA    NA
    +## k2       8.172408e-12 5.000000e-01    NA    NA
    +## g        6.889941e-01 1.306276e-02    NA    NA
    +## 
    +## 
    +## DTx values:
    +##      DT50     DT90 DT50_rep
    +## SFO  86.6 2.88e+02 8.66e+01
    +## IORE 85.5 7.17e+02 2.16e+02
    +## DFOP 83.6 1.39e+11 8.48e+10
    +## 
    +## Representative half-life:
    +## [1] 215.8655
    +
    +
    +

    +Example on page 6

    +
    p6 <- nafta(NAFTA_SOP_Attachment[["p6"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    +
    plot(p6)
    +

    +
    print(p6)
    +
    ## Sums of squares:
    +##       SFO      IORE      DFOP 
    +## 188.45361  51.00699  42.46931 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 58.39888
    +## 
    +## Parameters:
    +## $SFO
    +##                  Estimate       Pr(>t)       Lower       Upper
    +## parent_0      94.77587412 1.246335e-24 92.25575879 97.29598945
    +## k_parent_sink  0.01794259 2.347664e-16  0.01660595  0.01938682
    +## 
    +## $IORE
    +##                         Estimate       Pr(>t)        Lower        Upper
    +## parent_0            97.124460863 5.616271e-27 95.493434421 98.755487305
    +## k__iore_parent_sink  0.002517728 3.535472e-03  0.001263771  0.005015906
    +## N_parent             1.495871465 6.129227e-13  1.323799338  1.667943591
    +## 
    +## $DFOP
    +##              Estimate       Pr(>t) Lower Upper
    +## parent_0 9.662275e+01 4.174516e-26    NA    NA
    +## k1       2.547327e-02 2.115246e-05    NA    NA
    +## k2       3.087623e-11 5.000000e-01    NA    NA
    +## g        8.613785e-01 2.097173e-05    NA    NA
    +## 
    +## 
    +## DTx values:
    +##      DT50     DT90 DT50_rep
    +## SFO  38.6 1.28e+02 3.86e+01
    +## IORE 34.0 1.77e+02 5.32e+01
    +## DFOP 34.1 1.06e+10 2.24e+10
    +## 
    +## Representative half-life:
    +## [1] 53.16582
    +
    +
    +

    +Example on page 7

    +
    p7 <- nafta(NAFTA_SOP_Attachment[["p7"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    +
    plot(p7)
    +

    +
    print(p7)
    +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 3661.661 3195.030 3174.145 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 3334.194
    +## 
    +## Parameters:
    +## $SFO
    +##                   Estimate       Pr(>t)        Lower        Upper
    +## parent_0      96.417960406 1.520951e-53 93.295541980 99.540378832
    +## k_parent_sink  0.007350054 3.592731e-21  0.006413446  0.008423441
    +## 
    +## $IORE
    +##                         Estimate       Pr(>t)        Lower        Upper
    +## parent_0            9.915322e+01 7.332574e-49 9.534934e+01 1.029571e+02
    +## k__iore_parent_sink 1.600884e-05 3.472978e-01 9.982484e-08 2.567328e-03
    +## N_parent            2.446000e+00 6.141482e-05 1.260173e+00 3.631827e+00
    +## 
    +## $DFOP
    +##              Estimate       Pr(>t) Lower Upper
    +## parent_0 9.886065e+01 8.134302e-48    NA    NA
    +## k1       1.805928e-02 2.198367e-01    NA    NA
    +## k2       3.279731e-10 5.000000e-01    NA    NA
    +## g        6.063177e-01 2.601365e-01    NA    NA
    +## 
    +## 
    +## DTx values:
    +##      DT50     DT90 DT50_rep
    +## SFO  94.3 3.13e+02 9.43e+01
    +## IORE 96.7 1.51e+03 4.55e+02
    +## DFOP 96.4 4.18e+09 2.11e+09
    +## 
    +## Representative half-life:
    +## [1] 454.5528
    +
    +
    +
    +

    +Examples where the representative half-life deviates from the observed DT50

    +
    +

    +Example on page 8

    +

    For this dataset, the IORE fit does not converge when the default starting values used by mkin for the IORE model are used. Therefore, a lower value for the rate constant is used here.

    +
    p8 <- nafta(NAFTA_SOP_Attachment[["p8"]], parms.ini = c(k__iore_parent_sink = 1e-3))
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    +
    plot(p8)
    +

    +
    print(p8)
    +
    ## Sums of squares:
    +##       SFO      IORE      DFOP 
    +## 1996.9408  444.9237  547.5616 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 477.4924
    +## 
    +## Parameters:
    +## $SFO
    +##                         Estimate Pr(>t) Lower Upper
    +## parent_0            88.165489334     NA    NA    NA
    +## k__iore_parent_sink  0.001000000     NA    NA    NA
    +## k_parent_sink        0.008032303     NA    NA    NA
    +## 
    +## $IORE
    +##                         Estimate       Pr(>t)        Lower        Upper
    +## parent_0            9.771060e+01 1.048016e-35 9.442778e+01 1.009934e+02
    +## k__iore_parent_sink 6.141041e-05 2.763666e-02 2.205805e-05 1.709688e-04
    +## N_parent            2.271648e+00 5.996684e-19 2.015215e+00 2.528080e+00
    +## 
    +## $DFOP
    +##                         Estimate Pr(>t) Lower Upper
    +## parent_0            95.706193520     NA    NA    NA
    +## k__iore_parent_sink  0.001000000     NA    NA    NA
    +## k1                   0.024995243     NA    NA    NA
    +## k2                   0.002734623     NA    NA    NA
    +## g                    0.588349874     NA    NA    NA
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO  86.3  287     86.3
    +## IORE 53.4  668    201.0
    +## DFOP 55.6  517    253.0
    +## 
    +## Representative half-life:
    +## [1] 201.0316
    +
    +
    +
    +

    +Examples where SFO was not selected for an abiotic study

    +
    +

    +Example on page 9, upper panel

    +
    p9a <- nafta(NAFTA_SOP_Attachment[["p9a"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    +
    plot(p9a)
    +

    +
    print(p9a)
    +
    ## Sums of squares:
    +##       SFO      IORE      DFOP 
    +## 839.35238  88.57064   9.93363 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 105.5678
    +## 
    +## Parameters:
    +## $SFO
    +##                 Estimate       Pr(>t)       Lower       Upper
    +## parent_0      88.1933161 1.117569e-12 79.76708923 96.61954288
    +## k_parent_sink  0.0409019 9.501453e-08  0.03258829  0.05133639
    +## 
    +## $IORE
    +##                         Estimate       Pr(>t)        Lower        Upper
    +## parent_0            9.891481e+01 5.163566e-17 9.497891e+01 1.028507e+02
    +## k__iore_parent_sink 1.927824e-05 1.480158e-01 2.650455e-06 1.402214e-04
    +## N_parent            2.910027e+00 3.738041e-09 2.428904e+00 3.391151e+00
    +## 
    +## $DFOP
    +##              Estimate       Pr(>t) Lower Upper
    +## parent_0 9.853112e+01 1.308505e-21    NA    NA
    +## k1       1.382145e-01 3.630589e-09    NA    NA
    +## k2       6.019228e-13 5.000000e-01    NA    NA
    +## g        6.518659e-01 1.502543e-10    NA    NA
    +## 
    +## 
    +## DTx values:
    +##      DT50     DT90 DT50_rep
    +## SFO  16.9 5.63e+01 1.69e+01
    +## IORE 11.6 3.37e+02 1.01e+02
    +## DFOP 10.5 2.07e+12 1.15e+12
    +## 
    +## Representative half-life:
    +## [1] 101.4264
    +

    In this example, the residuals of the SFO indicate a lack of fit of this model, so even if it was an abiotic experiment, the data do not suggest a simple exponential decline.

    +
    +
    +

    +Example on page 9, lower panel

    +
    p9b <- nafta(NAFTA_SOP_Attachment[["p9b"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    +
    plot(p9b)
    +

    +
    print(p9b)
    +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 35.64867 23.22334 35.64867 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 28.54188
    +## 
    +## Parameters:
    +## $SFO
    +##                  Estimate       Pr(>t)      Lower       Upper
    +## parent_0      94.71226787 2.207090e-20 93.0673253 96.35721040
    +## k_parent_sink  0.03887215 1.482921e-14  0.0368549  0.04099981
    +## 
    +## $IORE
    +##                       Estimate       Pr(>t)       Lower      Upper
    +## parent_0            93.8626223 2.911881e-19 92.29955547 95.4256890
    +## k__iore_parent_sink  0.1271399 2.725876e-02  0.04570569  0.3536663
    +## N_parent             0.7108771 3.130915e-05  0.46052920  0.9612249
    +## 
    +## $DFOP
    +##             Estimate Pr(>t) Lower Upper
    +## parent_0 94.71226786     NA    NA    NA
    +## k1        0.03887215     NA    NA    NA
    +## k2        0.03887215     NA    NA    NA
    +## g         0.77417779     NA    NA    NA
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO  17.8 59.2     17.8
    +## IORE 18.4 49.2     14.8
    +## DFOP 17.8 59.2     17.8
    +## 
    +## Representative half-life:
    +## [1] 14.80013
    +

    Here, mkin gives a longer slow DT50 for the DFOP model (17.8 days) than PestDF (13.5 days). Presumably, this is related to the fact that PestDF gives a negative value for the proportion of the fast degradation which should be between 0 and 1, inclusive. This parameter is called f in PestDF and g in mkin. In mkin, it is restricted to the interval from 0 to 1.

    +
    +
    +

    +Example on page 10

    +
    p10 <- nafta(NAFTA_SOP_Attachment[["p10"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    +
    plot(p10)
    +

    +
    print(p10)
    +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 899.4089 336.4348 899.4089 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 413.4841
    +## 
    +## Parameters:
    +## $SFO
    +##                   Estimate       Pr(>t)       Lower        Upper
    +## parent_0      101.73153064 4.954950e-11 90.96832870 112.49473259
    +## k_parent_sink   0.04952864 3.398569e-07  0.03930194   0.06241642
    +## 
    +## $IORE
    +##                      Estimate       Pr(>t)      Lower       Upper
    +## parent_0            96.855416 2.706118e-12 89.8843855 103.8264461
    +## k__iore_parent_sink  2.960977 1.308097e-01  0.4609504  19.0202303
    +## N_parent             0.000000 5.000000e-01 -0.4728922   0.4728922
    +## 
    +## $DFOP
    +##              Estimate Pr(>t) Lower Upper
    +## parent_0 101.73153022     NA    NA    NA
    +## k1         0.04952864     NA    NA    NA
    +## k2         0.04952864     NA    NA    NA
    +## g          0.66344649     NA    NA    NA
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO  14.0 46.5    14.00
    +## IORE 16.4 29.4     8.86
    +## DFOP 14.0 46.5    14.00
    +## 
    +## Representative half-life:
    +## [1] 8.862193
    +

    Here, a value below N is given for the IORE model, because the data suggests a faster decline towards the end of the experiment, which appears physically rather unlikely in the case of a photolysis study. It seems PestDF does not constrain N to values above zero, thus the slight difference in IORE model parameters between PestDF and mkin.

    +
    +
    +
    +

    +The DT50 was not observed during the study

    +
    +

    +Example on page 11

    +
    p11 <- nafta(NAFTA_SOP_Attachment[["p11"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    +
    plot(p11)
    +

    +
    print(p11)
    +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 579.6805 204.7932 144.7783 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 251.6944
    +## 
    +## Parameters:
    +## $SFO
    +##                   Estimate       Pr(>t)        Lower        Upper
    +## parent_0      96.158200840 1.560217e-13 89.913728706 1.024027e+02
    +## k_parent_sink  0.003208498 5.266271e-05  0.002183575 4.714497e-03
    +## 
    +## $IORE
    +##                         Estimate Pr(>t)        Lower        Upper
    +## parent_0            1.045981e+02     NA 9.798102e+01 1.112151e+02
    +## k__iore_parent_sink 3.110367e-17     NA 6.875825e-25 1.407014e-09
    +## N_parent            8.360812e+00     NA 4.397006e+00 1.232462e+01
    +## 
    +## $DFOP
    +##              Estimate       Pr(>t) Lower Upper
    +## parent_0 1.045607e+02 7.502642e-13    NA    NA
    +## k1       4.414526e-02 3.343950e-02    NA    NA
    +## k2       7.246905e-13 5.000000e-01    NA    NA
    +## g        3.217737e-01 7.868540e-03    NA    NA
    +## 
    +## 
    +## DTx values:
    +##          DT50     DT90 DT50_rep
    +## SFO  2.16e+02 7.18e+02 2.16e+02
    +## IORE 9.73e+02 1.37e+08 4.11e+07
    +## DFOP 4.21e+11 2.64e+12 9.56e+11
    +## 
    +## Representative half-life:
    +## [1] 41148169
    +

    In this case, the DFOP fit reported for PestDF resulted in a negative value for the slower rate constant, which is not possible in mkin. The other results are in agreement.

    +
    +
    +
    +

    +N is less than 1 and the DFOP rate constants are like the SFO rate constant

    +

    In the following three examples, the same results are obtained with mkin as reported for PestDF. As in the case on page 10, the N values below 1 are deemed unrealistic and appear to be the result of an overparameterisation.

    +
    +

    +Example on page 12, upper panel

    +
    p12a <- nafta(NAFTA_SOP_Attachment[["p12a"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    +
    plot(p12a)
    +

    +
    print(p12a)
    +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 695.4440 220.0685 695.4440 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 270.4679
    +## 
    +## Parameters:
    +## $SFO
    +##                  Estimate       Pr(>t)      Lower       Upper
    +## parent_0      100.5206988 5.606929e-12 91.6867692 109.3546284
    +## k_parent_sink   0.1243142 7.235485e-08  0.1017305   0.1519113
    +## 
    +## $IORE
    +##                       Estimate       Pr(>t)       Lower       Upper
    +## parent_0            96.8234045 1.242894e-13 91.56908085 102.0777281
    +## k__iore_parent_sink  2.4360714 3.893118e-02  0.78536982   7.5562415
    +## N_parent             0.2627157 3.639503e-02 -0.02875633   0.5541876
    +## 
    +## $DFOP
    +##             Estimate Pr(>t) Lower Upper
    +## parent_0 100.5206988     NA    NA    NA
    +## k1         0.1243142     NA    NA    NA
    +## k2         0.1243142     NA    NA    NA
    +## g          0.8772377     NA    NA    NA
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO  5.58 18.5     5.58
    +## IORE 6.49 13.2     3.99
    +## DFOP 5.58 18.5     5.58
    +## 
    +## Representative half-life:
    +## [1] 3.987308
    +
    +
    +

    +Example on page 12, lower panel

    +
    p12b <- nafta(NAFTA_SOP_Attachment[["p12b"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    +
    plot(p12b)
    +

    +
    print(p12b)
    +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 58.90242 19.06353 58.90242 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 51.51756
    +## 
    +## Parameters:
    +## $SFO
    +##                 Estimate       Pr(>t)       Lower        Upper
    +## parent_0      97.6840211 0.0000535970 86.32050115 109.04754103
    +## k_parent_sink  0.0589177 0.0009869932  0.04320553   0.08034377
    +## 
    +## $IORE
    +##                       Estimate       Pr(>t)       Lower      Upper
    +## parent_0            95.5232270 0.0003860431 84.09629121 106.950163
    +## k__iore_parent_sink  0.3329365 0.1708863327  0.01026046  10.803285
    +## N_parent             0.5677771 0.0548808046 -0.31606833   1.451622
    +## 
    +## $DFOP
    +##            Estimate Pr(>t) Lower Upper
    +## parent_0 97.6840212     NA    NA    NA
    +## k1        0.0589177     NA    NA    NA
    +## k2        0.0589177     NA    NA    NA
    +## g         0.6901929     NA    NA    NA
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO  11.8 39.1    11.80
    +## IORE 12.9 31.4     9.46
    +## DFOP 11.8 39.1    11.80
    +## 
    +## Representative half-life:
    +## [1] 9.461912
    +
    +
    +

    +Example on page 13

    +
    p13 <- nafta(NAFTA_SOP_Attachment[["p13"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    +
    plot(p13)
    +

    +
    print(p13)
    +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 174.5971 142.3951 174.5971 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 172.131
    +## 
    +## Parameters:
    +## $SFO
    +##                   Estimate       Pr(>t)        Lower        Upper
    +## parent_0      92.735003006 1.453426e-17 89.389064698 96.080941315
    +## k_parent_sink  0.002581189 2.630396e-09  0.002198171  0.003030945
    +## 
    +## $IORE
    +##                        Estimate       Pr(>t)       Lower     Upper
    +## parent_0            91.60158658 2.932498e-16 88.08710837 95.116065
    +## k__iore_parent_sink  0.03960674 2.810573e-01  0.00102485  1.530656
    +## N_parent             0.35408757 1.972378e-01 -0.51942545  1.227601
    +## 
    +## $DFOP
    +##              Estimate Pr(>t) Lower Upper
    +## parent_0 92.735003208     NA    NA    NA
    +## k1        0.002581186     NA    NA    NA
    +## k2        0.002581188     NA    NA    NA
    +## g         0.004422859     NA    NA    NA
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO   269  892      269
    +## IORE  261  560      169
    +## DFOP  269  892      269
    +## 
    +## Representative half-life:
    +## [1] 168.5123
    +
    +
    +
    +

    +DT50 not observed in the study and DFOP problems in PestDF

    +
    p14 <- nafta(NAFTA_SOP_Attachment[["p14"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    +
    plot(p14)
    +

    +
    print(p14)
    +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 48.43249 28.67746 27.26248 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 32.83337
    +## 
    +## Parameters:
    +## $SFO
    +##                   Estimate       Pr(>t)        Lower        Upper
    +## parent_0      99.471243637 1.708290e-31 98.373131052 1.005694e+02
    +## k_parent_sink  0.002789581 2.222078e-15  0.002554583 3.046197e-03
    +## 
    +## $IORE
    +##                         Estimate Pr(>t)        Lower        Upper
    +## parent_0            1.003522e+02     NA 9.926773e+01 1.014366e+02
    +## k__iore_parent_sink 9.443770e-08     NA 6.810412e-11 1.309536e-04
    +## N_parent            3.308552e+00     NA 1.690051e+00 4.927053e+00
    +## 
    +## $DFOP
    +##              Estimate       Pr(>t) Lower Upper
    +## parent_0 1.003398e+02 2.698790e-28    NA    NA
    +## k1       9.532677e-03 3.394353e-01    NA    NA
    +## k2       9.189935e-12 5.000000e-01    NA    NA
    +## g        3.982564e-01 3.920847e-01    NA    NA
    +## 
    +## 
    +## DTx values:
    +##          DT50     DT90 DT50_rep
    +## SFO  2.48e+02 8.25e+02 2.48e+02
    +## IORE 4.34e+02 2.22e+04 6.70e+03
    +## DFOP 2.02e+10 1.95e+11 7.54e+10
    +## 
    +## Representative half-life:
    +## [1] 6697.437
    +

    The slower rate constant reported by PestDF is negative, which is not physically realistic, and not possible in mkin. The other fits give the same results in mkin and PestDF.

    +
    +
    +

    +N is less than 1 and DFOP fraction parameter is below zero

    +
    p15a <- nafta(NAFTA_SOP_Attachment[["p15a"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    +
    plot(p15a)
    +

    +
    print(p15a)
    +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 245.5248 135.0132 245.5248 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 165.9335
    +## 
    +## Parameters:
    +## $SFO
    +##                   Estimate       Pr(>t)        Lower       Upper
    +## parent_0      97.967511635 4.984358e-16 94.038286642 101.8967366
    +## k_parent_sink  0.009522227 5.239115e-09  0.008126698   0.0111574
    +## 
    +## $IORE
    +##                       Estimate       Pr(>t)       Lower      Upper
    +## parent_0            95.8736780 8.295860e-16 92.58018331 99.1671726
    +## k__iore_parent_sink  0.6285106 2.386496e-01  0.03155477 12.5187302
    +## N_parent             0.0000000 5.000000e-01 -0.72189225  0.7218923
    +## 
    +## $DFOP
    +##              Estimate Pr(>t) Lower Upper
    +## parent_0 97.967516468     NA    NA    NA
    +## k1        0.009522243     NA    NA    NA
    +## k2        0.009522223     NA    NA    NA
    +## g         0.172466840     NA    NA    NA
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO  72.8  242     72.8
    +## IORE 76.3  137     41.3
    +## DFOP 72.8  242     72.8
    +## 
    +## Representative half-life:
    +## [1] 41.32749
    +
    p15b <- nafta(NAFTA_SOP_Attachment[["p15b"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The half-life obtained from the IORE model may be used
    +
    plot(p15b)
    +

    +
    print(p15b)
    +
    ## Sums of squares:
    +##       SFO      IORE      DFOP 
    +## 106.91629  68.55574 106.91629 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 84.25618
    +## 
    +## Parameters:
    +## $SFO
    +##                   Estimate       Pr(>t)        Lower        Upper
    +## parent_0      1.008816e+02 4.987925e-18 98.127607367 1.036355e+02
    +## k_parent_sink 4.856586e-03 1.756208e-10  0.004316334 5.464459e-03
    +## 
    +## $IORE
    +##                       Estimate       Pr(>t)       Lower     Upper
    +## parent_0            99.8268283 4.490292e-17 97.19753163 102.45613
    +## k__iore_parent_sink  0.3799625 3.406003e-01  0.00206198  70.01593
    +## N_parent             0.0000000 5.000000e-01 -1.20105017   1.20105
    +## 
    +## $DFOP
    +##              Estimate Pr(>t) Lower Upper
    +## parent_0 1.008816e+02     NA    NA    NA
    +## k1       4.856586e-03     NA    NA    NA
    +## k2       4.856586e-03     NA    NA    NA
    +## g        1.496838e-01     NA    NA    NA
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO   143  474    143.0
    +## IORE  131  236     71.2
    +## DFOP  143  474    143.0
    +## 
    +## Representative half-life:
    +## [1] 71.18014
    +

    In mkin, only the IORE fit is affected (deemed unrealistic), as the fraction parameter of the DFOP model is restricted to the interval between 0 and 1 in mkin. The SFO fits give the same results for both mkin and PestDF.

    +
    +
    +

    +The DFOP fraction parameter is greater than 1

    +
    p16 <- nafta(NAFTA_SOP_Attachment[["p16"]])
    +
    ## The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    +
    ## The representative half-life of the IORE model is longer than the one corresponding
    +
    ## to the terminal degradation rate found with the DFOP model.
    +
    ## The representative half-life obtained from the DFOP model may be used
    +
    plot(p16)
    +

    +
    print(p16)
    +
    ## Sums of squares:
    +##      SFO     IORE     DFOP 
    +## 3831.804 2062.008 1550.980 
    +## 
    +## Critical sum of squares for checking the SFO model:
    +## [1] 2247.348
    +## 
    +## Parameters:
    +## $SFO
    +##                 Estimate       Pr(>t)      Lower      Upper
    +## parent_0      71.9528227 3.923531e-14 61.0870510 82.8185944
    +## k_parent_sink  0.1594518 2.271601e-06  0.1110583  0.2289327
    +## 
    +## $IORE
    +##                         Estimate       Pr(>t)        Lower        Upper
    +## parent_0            8.738846e+01 1.739390e-16 7.706991e+01 97.707005461
    +## k__iore_parent_sink 4.549683e-04 2.282721e-01 3.008533e-05  0.006880303
    +## N_parent            2.696278e+00 1.869479e-08 1.966442e+00  3.426114200
    +## 
    +## $DFOP
    +##             Estimate Pr(>t)       Lower      Upper
    +## parent_0 88.53333334     NA 79.36733990 97.6993268
    +## k1       18.55624337     NA  0.00000000        Inf
    +## k2        0.07759679     NA  0.04709945  0.1278414
    +## g         0.47333008     NA  0.31375096  0.6385506
    +## 
    +## 
    +## DTx values:
    +##      DT50 DT90 DT50_rep
    +## SFO  4.35 14.4     4.35
    +## IORE 1.48 32.1     9.67
    +## DFOP 0.67 21.4     8.93
    +## 
    +## Representative half-life:
    +## [1] 8.932679
    +

    In PestDF, the DFOP fit seems to have stuck in a local minimum, as mkin finds a solution with a much lower \(\chi^2\) error level. As the half-life from the slower rate constant of the DFOP model is larger than the IORE derived half-life, the NAFTA recommendation obtained with mkin is to use the DFOP representative half-life of 8.9 days.

    +
    +
    +

    +Conclusions

    +

    The results obtained with mkin deviate from the results obtained with PestDF either in cases where one of the interpretive rules would apply, i.e. the IORE parameter N is less than one or the DFOP k values obtained with PestDF are equal to the SFO k values, or in cases where the DFOP model did not converge, which often lead to negative rate constants returned by PestDF.

    +

    Therefore, mkin appears to suitable for kinetic evaluations according to the NAFTA guidance.

    +
    +
    +

    +References

    +
    +
    +

    US EPA. 2015. “Standard Operating Procedure for Using the NAFTA Guidance to Calculate Representative Half-Life Values and Characterizing Pesticide Degradation.”

    +
    +
    +
    +
    + + + +
    + + +
    + +
    +

    Site built with pkgdown 1.3.0.9000.

    +
    +
    +
    + + + + + diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p10-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p10-1.png new file mode 100644 index 00000000..e4062661 Binary files /dev/null and b/docs/articles/web_only/NAFTA_examples_files/figure-html/p10-1.png differ diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p11-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p11-1.png new file mode 100644 index 00000000..cc4ce2d7 Binary files /dev/null and b/docs/articles/web_only/NAFTA_examples_files/figure-html/p11-1.png differ diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p12a-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p12a-1.png new file mode 100644 index 00000000..d2a334b7 Binary files /dev/null and b/docs/articles/web_only/NAFTA_examples_files/figure-html/p12a-1.png differ diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p12b-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p12b-1.png new file mode 100644 index 00000000..9eb2b59f Binary files /dev/null and b/docs/articles/web_only/NAFTA_examples_files/figure-html/p12b-1.png differ diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p13-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p13-1.png new file mode 100644 index 00000000..df60b257 Binary files /dev/null and b/docs/articles/web_only/NAFTA_examples_files/figure-html/p13-1.png differ diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p14-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p14-1.png new file mode 100644 index 00000000..02975183 Binary files /dev/null and b/docs/articles/web_only/NAFTA_examples_files/figure-html/p14-1.png differ diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p15a-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p15a-1.png new file mode 100644 index 00000000..98fb5855 Binary files /dev/null and b/docs/articles/web_only/NAFTA_examples_files/figure-html/p15a-1.png differ diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p15b-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p15b-1.png new file mode 100644 index 00000000..6b3a988a Binary files /dev/null and b/docs/articles/web_only/NAFTA_examples_files/figure-html/p15b-1.png differ diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p16-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p16-1.png new file mode 100644 index 00000000..d0ef1821 Binary files /dev/null and b/docs/articles/web_only/NAFTA_examples_files/figure-html/p16-1.png differ diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p5a-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p5a-1.png new file mode 100644 index 00000000..3b39d9fa Binary files /dev/null and b/docs/articles/web_only/NAFTA_examples_files/figure-html/p5a-1.png differ diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p5b-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p5b-1.png new file mode 100644 index 00000000..e2666703 Binary files /dev/null and b/docs/articles/web_only/NAFTA_examples_files/figure-html/p5b-1.png differ diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p6-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p6-1.png new file mode 100644 index 00000000..cad7f615 Binary files /dev/null and b/docs/articles/web_only/NAFTA_examples_files/figure-html/p6-1.png differ diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p7-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p7-1.png new file mode 100644 index 00000000..7d93d546 Binary files /dev/null and b/docs/articles/web_only/NAFTA_examples_files/figure-html/p7-1.png differ diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p8-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p8-1.png new file mode 100644 index 00000000..f86bbd54 Binary files /dev/null and b/docs/articles/web_only/NAFTA_examples_files/figure-html/p8-1.png differ diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p9a-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p9a-1.png new file mode 100644 index 00000000..866f1523 Binary files /dev/null and b/docs/articles/web_only/NAFTA_examples_files/figure-html/p9a-1.png differ diff --git a/docs/articles/web_only/NAFTA_examples_files/figure-html/p9b-1.png b/docs/articles/web_only/NAFTA_examples_files/figure-html/p9b-1.png new file mode 100644 index 00000000..7f99d9cd Binary files /dev/null and b/docs/articles/web_only/NAFTA_examples_files/figure-html/p9b-1.png differ diff --git a/docs/articles/web_only/compiled_models.html b/docs/articles/web_only/compiled_models.html index 6d4d1e42..0295d844 100644 --- a/docs/articles/web_only/compiled_models.html +++ b/docs/articles/web_only/compiled_models.html @@ -126,9 +126,9 @@ }
    ## Lade nötiges Paket: rbenchmark
    ##                    test replications elapsed relative user.self sys.self
    -## 3     deSolve, compiled            3   2.323    1.000     2.321        0
    -## 1 deSolve, not compiled            3  17.568    7.563    17.559        0
    -## 2      Eigenvalue based            3   2.884    1.241     2.883        0
    +## 3     deSolve, compiled            3   2.318    1.000     2.317        0
    +## 1 deSolve, not compiled            3  17.559    7.575    17.551        0
    +## 2      Eigenvalue based            3   2.859    1.233     2.857        0
     ##   user.child sys.child
     ## 3          0         0
     ## 1          0         0
    @@ -157,8 +157,8 @@
     }
    ## Successfully compiled differential equation model from auto-generated C code.
    ##                    test replications elapsed relative user.self sys.self
    -## 2     deSolve, compiled            3   4.078    1.000     4.075        0
    -## 1 deSolve, not compiled            3  37.246    9.133    37.231        0
    +## 2     deSolve, compiled            3   4.093    1.000     4.090        0
    +## 1 deSolve, not compiled            3  37.258    9.103    37.241        0
     ##   user.child sys.child
     ## 2          0         0
     ## 1          0         0
    diff --git a/docs/authors.html b/docs/authors.html index 1c3101aa..d3516580 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -94,6 +94,9 @@
  • Calculation of time weighted average concentrations with mkin
  • +
  • + Example evaluation of NAFTA SOP Attachment examples +
  • diff --git a/docs/index.html b/docs/index.html index 75cf8c00..47bc7464 100644 --- a/docs/index.html +++ b/docs/index.html @@ -71,6 +71,9 @@
  • Calculation of time weighted average concentrations with mkin
  • +
  • + Example evaluation of NAFTA SOP Attachment examples +
  • diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 2783dff9..85d3ba48 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -7,5 +7,6 @@ articles: mkin: mkin.html twa: twa.html FOCUS_Z: web_only/FOCUS_Z.html + NAFTA_examples: web_only/NAFTA_examples.html compiled_models: web_only/compiled_models.html diff --git a/docs/reference/AIC.mmkin.html b/docs/reference/AIC.mmkin.html index 69552d5f..2a4a6de4 100644 --- a/docs/reference/AIC.mmkin.html +++ b/docs/reference/AIC.mmkin.html @@ -160,8 +160,8 @@

    Examples

    f <- mmkin(c("SFO", "FOMC", "DFOP"), list("FOCUS A" = FOCUS_2006_A, - "FOCUS C" = FOCUS_2006_C)) - AIC(f[1, "FOCUS A"]) # We get a single number for a single fit
    #> [1] 55.32452
    + "FOCUS C" = FOCUS_2006_C), cores = 1, quiet = TRUE)
    #> Warning: Optimisation by method Port did not converge: +#> false convergence (8)
    AIC(f[1, "FOCUS A"]) # We get a single number for a single fit
    #> [1] 55.32452
    # For FOCUS A, the models fit almost equally well, so the higher the number # of parameters, the higher (worse) the AIC AIC(f[, "FOCUS A"])
    #> df AIC diff --git a/docs/reference/Extract.mmkin.html b/docs/reference/Extract.mmkin.html index 873d75bd..f10805a0 100644 --- a/docs/reference/Extract.mmkin.html +++ b/docs/reference/Extract.mmkin.html @@ -280,7 +280,7 @@ #> #> $time #> User System verstrichen -#> 0.195 0.000 0.195 +#> 0.071 0.000 0.071 #> #> $mkinmod #> <mkinmod> model generated with @@ -469,8 +469,8 @@ #> } #> return(mC) #> } -#> <bytecode: 0x55555925ca08> -#> <environment: 0x55555b668200> +#> <bytecode: 0x55555bb55ad0> +#> <environment: 0x55555c4dcf70> #> #> $cost_notrans #> function (P) @@ -492,8 +492,8 @@ #> scaleVar = scaleVar) #> return(mC) #> } -#> <bytecode: 0x55555a590818> -#> <environment: 0x55555b668200> +#> <bytecode: 0x55555c537298> +#> <environment: 0x55555c4dcf70> #> #> $hessian_notrans #> parent_0 k_parent_sink @@ -560,7 +560,7 @@ #> 99.17407 #> #> $date -#> [1] "Tue Feb 26 09:27:10 2019" +#> [1] "Tue Feb 26 20:23:09 2019" #> #> $version #> [1] "0.9.48.1" diff --git a/docs/reference/NAFTA_SOP_2015.html b/docs/reference/NAFTA_SOP_2015.html index 4a2c71a9..f4d89222 100644 --- a/docs/reference/NAFTA_SOP_2015.html +++ b/docs/reference/NAFTA_SOP_2015.html @@ -152,7 +152,8 @@

    Examples

    -
    nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D)
    #> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    #> The representative half-life of the IORE model is longer than the one corresponding
    #> to the terminal degradation rate found with the DFOP model.
    #> The representative half-life obtained from the DFOP model may be used
    print(nafta_evaluation)
    #> Sums of squares: +
    nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D, cores = 1)
    #> Warning: Calculation of the Jacobian failed for the cost function of the untransformed model. +#> No t-test results will be available
    #> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    #> The representative half-life of the IORE model is longer than the one corresponding
    #> to the terminal degradation rate found with the DFOP model.
    #> The representative half-life obtained from the DFOP model may be used
    print(nafta_evaluation)
    #> Sums of squares: #> SFO IORE DFOP #> 1378.6832 615.7730 517.8836 #> @@ -168,8 +169,8 @@ #> $IORE #> Estimate Pr(>t) Lower Upper #> parent_0 9.685291e+01 NA 8.752855e+01 1.061773e+02 -#> k__iore_parent_sink 8.403374e-14 NA 1.092054e-19 6.466412e-08 -#> N_parent 6.684458e+00 NA 3.538511e+00 9.830405e+00 +#> k__iore_parent_sink 8.403401e-14 NA 1.092058e-19 6.466429e-08 +#> N_parent 6.684457e+00 NA 3.538510e+00 9.830404e+00 #> #> $DFOP #> Estimate Pr(>t) Lower Upper @@ -181,9 +182,9 @@ #> #> DTx values: #> DT50 DT90 DT50_rep -#> SFO 407 1352 407 -#> IORE 541 5192066 1562968 -#> DFOP 429 2383 841 +#> SFO 407 1350 407 +#> IORE 541 5190000 1560000 +#> DFOP 429 2380 841 #> #> Representative half-life: #> [1] 841.4096
    plot(nafta_evaluation)
    diff --git a/docs/reference/NAFTA_SOP_Attachment-1.png b/docs/reference/NAFTA_SOP_Attachment-1.png new file mode 100644 index 00000000..d781cdb0 Binary files /dev/null and b/docs/reference/NAFTA_SOP_Attachment-1.png differ diff --git a/docs/reference/NAFTA_SOP_Attachment.html b/docs/reference/NAFTA_SOP_Attachment.html new file mode 100644 index 00000000..63b47855 --- /dev/null +++ b/docs/reference/NAFTA_SOP_Attachment.html @@ -0,0 +1,217 @@ + + + + + + + + +Example datasets from Attachment 1 to the NAFTA SOP published 2015 — NAFTA_SOP_Attachment • mkin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    Data taken from from Attachment 1 of the SOP.

    + +
    + +
    NAFTA_SOP_Attachment
    + +

    Format

    + +

    Additionally, a list (NAFTA_SOP_Attachment) containing 16 datasets suitable + for the evaluation with nafta

    + +

    Source

    + +

    NAFTA (2011) Guidance for evaluating and calculating degradation kinetics + in environmental media. NAFTA Technical Working Group on Pesticides + https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/guidance-evaluating-and-calculating-degradation + accessed 2019-02-22

    +

    US EPA (2015) Standard Operating Procedure for Using the NAFTA Guidance to + Calculate Representative Half-life Values and Characterizing Pesticide + Degradation + https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance

    + + +

    Examples

    +
    nafta_att_p5a <- nafta(NAFTA_SOP_Attachment[["p5a"]], cores = 1)
    #> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    #> The half-life obtained from the IORE model may be used
    print(nafta_att_p5a)
    #> Sums of squares: +#> SFO IORE DFOP +#> 465.21753 56.27506 32.06401 +#> +#> Critical sum of squares for checking the SFO model: +#> [1] 64.4304 +#> +#> Parameters: +#> $SFO +#> Estimate Pr(>t) Lower Upper +#> parent_0 95.84012168 1.095639e-21 92.120517864 99.55972549 +#> k_parent_sink 0.01024015 1.710227e-12 0.008996874 0.01165524 +#> +#> $IORE +#> Estimate Pr(>t) Lower Upper +#> parent_0 1.007532e+02 2.365797e-26 9.891170e+01 1.025947e+02 +#> k__iore_parent_sink 1.544192e-05 8.733384e-02 3.482391e-06 6.847393e-05 +#> N_parent 2.569877e+00 1.140446e-11 2.215298e+00 2.924456e+00 +#> +#> $DFOP +#> Estimate Pr(>t) Lower Upper +#> parent_0 9.994630e+01 4.330861e-27 NA NA +#> k1 2.674255e-02 3.171390e-05 NA NA +#> k2 2.161318e-12 5.000000e-01 NA NA +#> g 6.465276e-01 2.129114e-05 NA NA +#> +#> +#> DTx values: +#> DT50 DT90 DT50_rep +#> SFO 67.7 2.25e+02 6.77e+01 +#> IORE 58.2 1.07e+03 3.22e+02 +#> DFOP 55.5 5.84e+11 3.21e+11 +#> +#> Representative half-life: +#> [1] 321.5119
    plot(nafta_att_p5a)
    +
    + +
    + +
    + + +
    +

    Site built with pkgdown 1.3.0.9000.

    +
    +
    +
    + + + + + + diff --git a/docs/reference/index.html b/docs/reference/index.html index a251dc33..4e57fd3d 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -338,7 +338,9 @@

    plot(<nafta>)

    -

    Plot the results of the three models used in the NAFTA scheme

    +

    Plot the results of the three models used in the NAFTA scheme. The plots + are ordered with increasing complexity of the model in this function + (SFO, then IORE, then DFOP).

    diff --git a/docs/reference/mccall81_245T.html b/docs/reference/mccall81_245T.html index 1845a31c..2e5f0ac2 100644 --- a/docs/reference/mccall81_245T.html +++ b/docs/reference/mccall81_245T.html @@ -160,8 +160,8 @@ anisole = list(type = "SFO"))
    #> 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.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Tue Feb 26 09:27:31 2019 -#> Date of summary: Tue Feb 26 09:27:31 2019 +#> Date of fit: Tue Feb 26 20:23:32 2019 +#> Date of summary: Tue Feb 26 20:23:32 2019 #> #> Equations: #> d_T245/dt = - k_T245_sink * T245 - k_T245_phenol * T245 @@ -171,7 +171,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 574 model solutions performed in 3.812 s +#> Fitted with method Port using 574 model solutions performed in 3.765 s #> #> Weighting: none #> @@ -249,8 +249,8 @@ fixed_parms = "k_phenol_sink", quiet = TRUE) summary(fit.2, data = FALSE)
    #> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Tue Feb 26 09:27:33 2019 -#> Date of summary: Tue Feb 26 09:27:33 2019 +#> Date of fit: Tue Feb 26 20:23:34 2019 +#> Date of summary: Tue Feb 26 20:23:34 2019 #> #> Equations: #> d_T245/dt = - k_T245_sink * T245 - k_T245_phenol * T245 @@ -260,7 +260,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 246 model solutions performed in 1.597 s +#> Fitted with method Port using 246 model solutions performed in 1.601 s #> #> Weighting: none #> diff --git a/docs/reference/mkinfit.html b/docs/reference/mkinfit.html index 53f46988..84c0fc49 100644 --- a/docs/reference/mkinfit.html +++ b/docs/reference/mkinfit.html @@ -438,15 +438,15 @@ fit <- mkinfit("FOMC", FOCUS_2006_C, quiet = TRUE) summary(fit)
    #> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Tue Feb 26 09:27:36 2019 -#> Date of summary: Tue Feb 26 09:27:36 2019 +#> Date of fit: Tue Feb 26 20:23:36 2019 +#> Date of summary: Tue Feb 26 20:23:36 2019 #> #> 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.163 s +#> Fitted with method Port using 64 model solutions performed in 0.161 s #> #> Weighting: none #> @@ -515,7 +515,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 -#> 1.008 0.000 1.008
    coef(fit)
    #> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink +#> 1.081 0.000 1.081
    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 @@ -590,7 +590,7 @@ #> Model cost at call 146 : 371.2134 #> Optimisation by method Port successfully terminated. #> User System verstrichen -#> 0.812 0.000 0.813
    coef(fit.deSolve)
    #> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink +#> 0.812 0.000 0.812
    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 @@ -628,8 +628,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.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Tue Feb 26 09:27:48 2019 -#> Date of summary: Tue Feb 26 09:27:48 2019 +#> Date of fit: Tue Feb 26 20:23:48 2019 +#> Date of summary: Tue Feb 26 20:23:48 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -637,7 +637,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 186 model solutions performed in 0.845 s +#> Fitted with method Port using 186 model solutions performed in 0.852 s #> #> Weighting: none #> @@ -745,8 +745,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.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Tue Feb 26 09:27:50 2019 -#> Date of summary: Tue Feb 26 09:27:50 2019 +#> Date of fit: Tue Feb 26 20:23:51 2019 +#> Date of summary: Tue Feb 26 20:23:51 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -754,7 +754,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 551 model solutions performed in 2.523 s +#> Fitted with method Port using 551 model solutions performed in 2.6 s #> #> Weighting: none #> @@ -867,8 +867,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.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Tue Feb 26 09:27:51 2019 -#> Date of summary: Tue Feb 26 09:27:51 2019 +#> Date of fit: Tue Feb 26 20:23:52 2019 +#> Date of summary: Tue Feb 26 20:23:52 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -876,7 +876,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 155 model solutions performed in 0.705 s +#> Fitted with method Port using 155 model solutions performed in 0.704 s #> #> Weighting: mean #> @@ -985,8 +985,8 @@ quiet = TRUE) summary(f.w.value)
    #> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Tue Feb 26 09:27:52 2019 -#> Date of summary: Tue Feb 26 09:27:52 2019 +#> Date of fit: Tue Feb 26 20:23:53 2019 +#> Date of summary: Tue Feb 26 20:23:53 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -994,7 +994,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 174 model solutions performed in 0.8 s +#> Fitted with method Port using 174 model solutions performed in 0.796 s #> #> Weighting: manual #> @@ -1105,8 +1105,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.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Tue Feb 26 09:27:54 2019 -#> Date of summary: Tue Feb 26 09:27:54 2019 +#> Date of fit: Tue Feb 26 20:23:54 2019 +#> Date of summary: Tue Feb 26 20:23:54 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -1223,8 +1223,8 @@ reweight.method = "obs") summary(f.w.man.irls)
    #> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Tue Feb 26 09:27:57 2019 -#> Date of summary: Tue Feb 26 09:27:57 2019 +#> Date of fit: Tue Feb 26 20:23:58 2019 +#> Date of summary: Tue Feb 26 20:23:58 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -1232,7 +1232,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 692 model solutions performed in 3.246 s +#> Fitted with method Port using 692 model solutions performed in 3.182 s #> #> Weighting: manual #> diff --git a/docs/reference/mkinmod.html b/docs/reference/mkinmod.html index bcf39e7f..a6dd68c5 100644 --- a/docs/reference/mkinmod.html +++ b/docs/reference/mkinmod.html @@ -231,7 +231,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 file4a116f6acbf1.c 2> file4a116f6acbf1.c.err.txt +#> /usr/lib/R/bin/R CMD SHLIB file240f6aec3e43.c 2> file240f6aec3e43.c.err.txt #> Program source: #> 1: #include <R.h> #> 2: diff --git a/docs/reference/mkinpredict.html b/docs/reference/mkinpredict.html index a38de769..bab6deb8 100644 --- a/docs/reference/mkinpredict.html +++ b/docs/reference/mkinpredict.html @@ -325,7 +325,7 @@ 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.004 0.000 0.004
    system.time( +#> 0.003 0.000 0.004
    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 @@ -335,7 +335,7 @@ 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.040 0.000 0.039
    +#> 0.039 0.000 0.040
    # Predict from a fitted model f <- mkinfit(SFO_SFO, FOCUS_2006_C)
    #> Model cost at call 1 : 552.5739 #> Model cost at call 3 : 552.5739 diff --git a/docs/reference/mmkin.html b/docs/reference/mmkin.html index 6613f35c..0078baed 100644 --- a/docs/reference/mmkin.html +++ b/docs/reference/mmkin.html @@ -191,8 +191,8 @@ time_1 <- system.time(fits.4 <- mmkin(models, datasets, cores = 1, quiet = TRUE)) time_default
    #> User System verstrichen -#> 0.052 0.024 7.037
    time_1
    #> User System verstrichen -#> 22.463 0.000 22.476
    +#> 0.059 0.021 6.916
    time_1
    #> User System verstrichen +#> 22.506 0.000 22.518
    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/nafta.html b/docs/reference/nafta.html index b1d45272..9b879786 100644 --- a/docs/reference/nafta.html +++ b/docs/reference/nafta.html @@ -133,7 +133,7 @@
    -
    nafta(ds, title = NA, quiet = FALSE)
    +
    nafta(ds, title = NA, quiet = FALSE, …)

    Arguments

    @@ -153,6 +153,10 @@ + + + +
    quiet

    Should the evaluation text be shown?

    Further arguments passed to mmkin.

    Value

    @@ -175,7 +179,8 @@

    Examples

    -
    nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D)
    #> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    #> The representative half-life of the IORE model is longer than the one corresponding
    #> to the terminal degradation rate found with the DFOP model.
    #> The representative half-life obtained from the DFOP model may be used
    print(nafta_evaluation)
    #> Sums of squares: +
    nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D, cores = 1)
    #> Warning: Calculation of the Jacobian failed for the cost function of the untransformed model. +#> No t-test results will be available
    #> The SFO model is rejected as S_SFO is equal or higher than the critical value S_c
    #> The representative half-life of the IORE model is longer than the one corresponding
    #> to the terminal degradation rate found with the DFOP model.
    #> The representative half-life obtained from the DFOP model may be used
    print(nafta_evaluation)
    #> Sums of squares: #> SFO IORE DFOP #> 1378.6832 615.7730 517.8836 #> @@ -191,8 +196,8 @@ #> $IORE #> Estimate Pr(>t) Lower Upper #> parent_0 9.685291e+01 NA 8.752855e+01 1.061773e+02 -#> k__iore_parent_sink 8.403374e-14 NA 1.092054e-19 6.466412e-08 -#> N_parent 6.684458e+00 NA 3.538511e+00 9.830405e+00 +#> k__iore_parent_sink 8.403401e-14 NA 1.092058e-19 6.466429e-08 +#> N_parent 6.684457e+00 NA 3.538510e+00 9.830404e+00 #> #> $DFOP #> Estimate Pr(>t) Lower Upper @@ -204,9 +209,9 @@ #> #> DTx values: #> DT50 DT90 DT50_rep -#> SFO 407 1352 407 -#> IORE 541 5192066 1562968 -#> DFOP 429 2383 841 +#> SFO 407 1350 407 +#> IORE 541 5190000 1560000 +#> DFOP 429 2380 841 #> #> Representative half-life: #> [1] 841.4096
    plot(nafta_evaluation)
    diff --git a/docs/reference/plot.nafta.html b/docs/reference/plot.nafta.html index 76da1ffa..7949d36c 100644 --- a/docs/reference/plot.nafta.html +++ b/docs/reference/plot.nafta.html @@ -6,7 +6,9 @@ -Plot the results of the three models used in the NAFTA scheme — plot.nafta • mkin +Plot the results of the three models used in the NAFTA scheme. The plots + are ordered with increasing complexity of the model in this function + (SFO, then IORE, then DFOP). — plot.nafta • mkin @@ -30,7 +32,9 @@ - + @@ -118,7 +122,9 @@
    diff --git a/docs/reference/print.nafta.html b/docs/reference/print.nafta.html index ac276857..44f1f6e5 100644 --- a/docs/reference/print.nafta.html +++ b/docs/reference/print.nafta.html @@ -32,7 +32,9 @@ - + @@ -125,7 +127,9 @@
    -

    Print nafta objects.

    +

    Print nafta objects. The results for the three models + are printed in the order of increasing model complexity, + i.e. SFO, then IORE, and finally DFOP.

    diff --git a/docs/reference/summary.mkinfit.html b/docs/reference/summary.mkinfit.html index ca0b1c4c..6ec72f80 100644 --- a/docs/reference/summary.mkinfit.html +++ b/docs/reference/summary.mkinfit.html @@ -208,15 +208,15 @@

    Examples

    summary(mkinfit(mkinmod(parent = mkinsub("SFO")), FOCUS_2006_A, quiet = TRUE))
    #> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Tue Feb 26 09:28:49 2019 -#> Date of summary: Tue Feb 26 09:28:49 2019 +#> Date of fit: Tue Feb 26 20:24:50 2019 +#> Date of summary: Tue Feb 26 20:24:50 2019 #> #> 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.085 s +#> Fitted with method Port using 35 model solutions performed in 0.084 s #> #> Weighting: none #> diff --git a/docs/reference/transform_odeparms.html b/docs/reference/transform_odeparms.html index bcfbe975..6e65f609 100644 --- a/docs/reference/transform_odeparms.html +++ b/docs/reference/transform_odeparms.html @@ -202,8 +202,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.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Tue Feb 26 09:28:57 2019 -#> Date of summary: Tue Feb 26 09:28:57 2019 +#> Date of fit: Tue Feb 26 20:24:58 2019 +#> Date of summary: Tue Feb 26 20:24:58 2019 #> #> Equations: #> d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent @@ -211,7 +211,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.7 s +#> Fitted with method Port using 153 model solutions performed in 0.707 s #> #> Weighting: none #> @@ -278,8 +278,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.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Tue Feb 26 09:28:59 2019 -#> Date of summary: Tue Feb 26 09:28:59 2019 +#> Date of fit: Tue Feb 26 20:25:00 2019 +#> Date of summary: Tue Feb 26 20:25:00 2019 #> #> Equations: #> d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent @@ -287,7 +287,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.59 s +#> Fitted with method Port using 350 model solutions performed in 1.584 s #> #> Weighting: none #> @@ -366,8 +366,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.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Tue Feb 26 09:29:00 2019 -#> Date of summary: Tue Feb 26 09:29:00 2019 +#> Date of fit: Tue Feb 26 20:25:01 2019 +#> Date of summary: Tue Feb 26 20:25:01 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -375,7 +375,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.844 s +#> Fitted with method Port using 186 model solutions performed in 0.867 s #> #> Weighting: none #> @@ -450,8 +450,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.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Tue Feb 26 09:29:01 2019 -#> Date of summary: Tue Feb 26 09:29:01 2019 +#> Date of fit: Tue Feb 26 20:25:02 2019 +#> Date of summary: Tue Feb 26 20:25:02 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -459,7 +459,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.467 s +#> Fitted with method Port using 104 model solutions performed in 0.472 s #> #> Weighting: none #> diff --git a/man/AIC.mmkin.Rd b/man/AIC.mmkin.Rd index e7f5c228..08e4cc57 100644 --- a/man/AIC.mmkin.Rd +++ b/man/AIC.mmkin.Rd @@ -28,7 +28,7 @@ \examples{ f <- mmkin(c("SFO", "FOMC", "DFOP"), list("FOCUS A" = FOCUS_2006_A, - "FOCUS C" = FOCUS_2006_C)) + "FOCUS C" = FOCUS_2006_C), cores = 1, quiet = TRUE) AIC(f[1, "FOCUS A"]) # We get a single number for a single fit # For FOCUS A, the models fit almost equally well, so the higher the number diff --git a/man/NAFTA_SOP_2015.Rd b/man/NAFTA_SOP_2015.Rd index a47ae155..bca4cba2 100644 --- a/man/NAFTA_SOP_2015.Rd +++ b/man/NAFTA_SOP_2015.Rd @@ -29,7 +29,7 @@ Data taken from US EPA (2015), p. 19 and 23. \url{https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance} } \examples{ - nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D) + nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D, cores = 1) print(nafta_evaluation) plot(nafta_evaluation) } diff --git a/man/NAFTA_SOP_Attachment.Rd b/man/NAFTA_SOP_Attachment.Rd new file mode 100644 index 00000000..b8d015a4 --- /dev/null +++ b/man/NAFTA_SOP_Attachment.Rd @@ -0,0 +1,31 @@ +\name{NAFTA_SOP_Attachment} +\alias{NAFTA_SOP_Attachment} +\docType{data} +\title{ +Example datasets from Attachment 1 to the NAFTA SOP published 2015 +} +\description{ +Data taken from from Attachment 1 of the SOP. +} +\usage{NAFTA_SOP_Attachment} +\format{ + Additionally, a list (NAFTA_SOP_Attachment) containing 16 datasets suitable + for the evaluation with \code{\link{nafta}} +} +\source{ + NAFTA (2011) Guidance for evaluating and calculating degradation kinetics + in environmental media. NAFTA Technical Working Group on Pesticides + \url{https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/guidance-evaluating-and-calculating-degradation} + accessed 2019-02-22 + + US EPA (2015) Standard Operating Procedure for Using the NAFTA Guidance to + Calculate Representative Half-life Values and Characterizing Pesticide + Degradation + \url{https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance} +} +\examples{ + nafta_att_p5a <- nafta(NAFTA_SOP_Attachment[["p5a"]], cores = 1) + print(nafta_att_p5a) + plot(nafta_att_p5a) +} +\keyword{datasets} diff --git a/man/nafta.Rd b/man/nafta.Rd index 48b4fefe..6917d0e9 100644 --- a/man/nafta.Rd +++ b/man/nafta.Rd @@ -4,7 +4,7 @@ Evaluate parent kinetics using the NAFTA guidance } \usage{ -nafta(ds, title = NA, quiet = FALSE) +nafta(ds, title = NA, quiet = FALSE, \dots) } \description{ The function fits the SFO, IORE and DFOP models using @@ -20,6 +20,10 @@ nafta(ds, title = NA, quiet = FALSE) } \item{title}{ Optional title of the dataset } \item{quiet}{ Should the evaluation text be shown? } + \item{\dots}{ + Further arguments passed to \code{\link{mmkin}}. + } + } \value{ An list of class \code{nafta}. The list element named "mmkin" is the @@ -39,7 +43,7 @@ nafta(ds, title = NA, quiet = FALSE) \url{https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance} } \examples{ - nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D) + nafta_evaluation <- nafta(NAFTA_SOP_Appendix_D, cores = 1) print(nafta_evaluation) plot(nafta_evaluation) } diff --git a/man/plot.nafta.Rd b/man/plot.nafta.Rd index a3dfdbae..62bbcddf 100644 --- a/man/plot.nafta.Rd +++ b/man/plot.nafta.Rd @@ -1,7 +1,9 @@ \name{plot.nafta} \alias{plot.nafta} \title{ - Plot the results of the three models used in the NAFTA scheme + Plot the results of the three models used in the NAFTA scheme. The plots + are ordered with increasing complexity of the model in this function + (SFO, then IORE, then DFOP). } \description{ Calls \code{\link{plot.mmkin}}. diff --git a/man/print.nafta.Rd b/man/print.nafta.Rd index 4ae4c8b2..78ece0ad 100644 --- a/man/print.nafta.Rd +++ b/man/print.nafta.Rd @@ -4,7 +4,9 @@ Print nafta objects } \description{ - Print nafta objects. + Print nafta objects. The results for the three models + are printed in the order of increasing model complexity, + i.e. SFO, then IORE, and finally DFOP. } \usage{ \method{print}{nafta}(x, quiet = TRUE, ...) diff --git a/test.log b/test.log index 77981c86..98303e9b 100644 --- a/test.log +++ b/test.log @@ -1,24 +1,10 @@ Loading mkin Testing mkin ✔ | OK F W S | Context - ⠏ | 0 | Export dataset for reading into CAKE ⠋ | 1 | Export dataset for reading into CAKE ⠙ | 1 1 | Export dataset for reading into CAKE ✖ | 1 1 | Export dataset for reading into CAKE -──────────────────────────────────────────────────────────────────────────────── -test_CAKE_export.R:32: error: Test data from Appendix D are correctly evaluated -Objekt 'MRID_555555' nicht gefunden -1: expect_message(res <- nafta(MRID_555555, "MRID 555555")) at /home/jranke/git/mkin/tests/testthat/test_CAKE_export.R:32 -2: quasi_capture(enquo(object), capture_messages, label = label) -3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo))) -4: withCallingHandlers(code, message = function(condition) { - out$push(condition) - invokeRestart("muffleMessage") - }) -5: eval_bare(get_expr(quo), get_env(quo)) -6: nafta(MRID_555555, "MRID 555555") -7: levels(ds$name) at /home/jranke/git/mkin/R/nafta.R:20 -──────────────────────────────────────────────────────────────────────────────── + ⠏ | 0 | Export dataset for reading into CAKE ⠋ | 1 | Export dataset for reading into CAKE ✔ | 1 | Export dataset for reading into CAKE ⠏ | 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.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) ⠸ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ✔ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [7.9 s] - ⠏ | 0 | Iteratively reweighted least squares (IRLS) fitting ⠋ | 1 | Iteratively reweighted least squares (IRLS) fitting ⠙ | 2 | Iteratively reweighted least squares (IRLS) fitting ⠹ | 2 1 | Iteratively reweighted least squares (IRLS) fitting ✔ | 2 1 | Iteratively reweighted least squares (IRLS) fitting [16.0 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) ⠸ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) ✔ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [8.0 s] + ⠏ | 0 | Iteratively reweighted least squares (IRLS) fitting ⠋ | 1 | Iteratively reweighted least squares (IRLS) fitting ⠙ | 2 | Iteratively reweighted least squares (IRLS) fitting ⠹ | 2 1 | Iteratively reweighted least squares (IRLS) fitting ✔ | 2 1 | Iteratively reweighted least squares (IRLS) fitting [15.9 s] ──────────────────────────────────────────────────────────────────────────────── test_irls.R:48: skip: Reweighting method 'tc' works Too much trouble with datasets that are randomly generated @@ -29,23 +15,24 @@ 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 | 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 | 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 ⠏ | 9 1 | 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 ⠦ | 17 | Evaluations according to 2015 NAFTA guidance ✔ | 17 | Evaluations according to 2015 NAFTA guidance [1.5 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 [24.5 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) ⠼ | 5 | Calculation of maximum time weighted average concentrations (TWAs) ⠴ | 6 | Calculation of maximum time weighted average concentrations (TWAs) ⠦ | 7 | Calculation of maximum time weighted average concentrations (TWAs) ⠧ | 8 | Calculation of maximum time weighted average concentrations (TWAs) ✔ | 8 | Calculation of maximum time weighted average concentrations (TWAs) [7.3 s] - ⠏ | 0 | Summary ⠋ | 1 | Summary ✔ | 1 | Summary - ⠏ | 0 | Plotting ⠋ | 1 | Plotting ⠙ | 1 1 | Plotting ⠹ | 2 1 | Plotting ⠸ | 3 1 | Plotting ✔ | 3 1 | Plotting [0.3 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 ⠏ | 9 1 | Evaluations according to 2015 NAFTA guidance ⠏ | 10 | Evaluations according to 2015 NAFTA guidance ⠋ | 10 1 | Evaluations according to 2015 NAFTA guidance ⠙ | 11 1 | Evaluations according to 2015 NAFTA guidance ⠹ | 12 1 | Evaluations according to 2015 NAFTA guidance ⠸ | 13 1 | Evaluations according to 2015 NAFTA guidance ⠼ | 14 1 | Evaluations according to 2015 NAFTA guidance ⠴ | 15 1 | Evaluations according to 2015 NAFTA guidance ⠦ | 16 1 | Evaluations according to 2015 NAFTA guidance ✖ | 16 1 | Evaluations according to 2015 NAFTA guidance [1.5 s] ──────────────────────────────────────────────────────────────────────────────── -test_plots_summary_twa.R:76: skip: Plotting mmkin objects is reproducible -Figure not generated yet: mkinparplot-for-focus-c-sfo.svg -Please run `vdiffr::manage_cases()` to validate the figure. +test_nafta.R:50: failure: Test data from Appendix D are correctly evaluated +round(res$distimes[, 1:2]) not equivalent to `dtx_sop`. +1/6 mismatches +[5] 5192060 - 5192066 == -6 ──────────────────────────────────────────────────────────────────────────────── + ⠏ | 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 [23.9 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) ⠼ | 5 | Calculation of maximum time weighted average concentrations (TWAs) ⠴ | 6 | Calculation of maximum time weighted average concentrations (TWAs) ⠦ | 7 | Calculation of maximum time weighted average concentrations (TWAs) ⠧ | 8 | Calculation of maximum time weighted average concentrations (TWAs) ✔ | 8 | Calculation of maximum time weighted average concentrations (TWAs) [7.4 s] + ⠏ | 0 | Summary ⠋ | 1 | Summary ✔ | 1 | Summary + ⠏ | 0 | Plotting ⠋ | 1 | Plotting ⠙ | 2 | Plotting ⠹ | 3 | Plotting ⠸ | 4 | Plotting ✔ | 4 | Plotting [0.3 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.9 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.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.4 s] ══ Results ═════════════════════════════════════════════════════════════════════ -Duration: 75.2 s +Duration: 74.6 s OK: 79 Failed: 1 Warnings: 0 -Skipped: 3 +Skipped: 2 diff --git a/tests/testthat/NAFTA_SOP_Appendix_B.txt b/tests/testthat/NAFTA_SOP_Appendix_B.txt index 54b70880..3842db91 100644 --- a/tests/testthat/NAFTA_SOP_Appendix_B.txt +++ b/tests/testthat/NAFTA_SOP_Appendix_B.txt @@ -12,10 +12,10 @@ parent_0 51.2430312 1.178492e-10 45.4036817 57.0823806 k_parent_sink 0.2531291 1.608492e-06 0.1935733 0.3310082 $IORE - Estimate Pr(>t) Lower Upper -parent_0 51.71052958 8.522722e-15 4.951371e+01 53.907348315 -k__iore_parent_sink 0.00134836 6.841092e-02 3.421381e-04 0.005313861 -N_parent 2.66146927 3.975823e-08 2.191012e+00 3.131926902 + Estimate Pr(>t) Lower Upper +parent_0 51.710529483 8.522723e-15 4.951371e+01 53.907348241 +k__iore_parent_sink 0.001348359 6.841094e-02 3.421379e-04 0.005313859 +N_parent 2.661469429 3.975823e-08 2.191012e+00 3.131927092 $DFOP Estimate Pr(>t) Lower Upper @@ -27,9 +27,9 @@ g 0.83380396 5.718367e-12 0.771816175 0.88153694 DTx values: DT50 DT90 DT50_rep -SFO 3 9 3 -IORE 1 28 9 -DFOP 2 40 54 +SFO 2.74 9.1 2.74 +IORE 1.37 28.5 8.57 +DFOP 2.17 39.9 54.40 Representative half-life: -[1] 8.573301 +[1] 8.573302 diff --git a/tests/testthat/NAFTA_SOP_Appendix_D.txt b/tests/testthat/NAFTA_SOP_Appendix_D.txt index d01accf2..8720a3b6 100644 --- a/tests/testthat/NAFTA_SOP_Appendix_D.txt +++ b/tests/testthat/NAFTA_SOP_Appendix_D.txt @@ -14,8 +14,8 @@ k_parent_sink 0.001703321 7.452357e-05 0.001108568 0.002617164 $IORE Estimate Pr(>t) Lower Upper parent_0 9.685291e+01 NA 8.752855e+01 1.061773e+02 -k__iore_parent_sink 8.403374e-14 NA 1.092054e-19 6.466412e-08 -N_parent 6.684458e+00 NA 3.538511e+00 9.830405e+00 +k__iore_parent_sink 8.403401e-14 NA 1.092058e-19 6.466429e-08 +N_parent 6.684457e+00 NA 3.538510e+00 9.830404e+00 $DFOP Estimate Pr(>t) Lower Upper @@ -27,9 +27,9 @@ g 2.881037e-01 1.313715e-04 1.783967e-01 4.299694e-01 DTx values: DT50 DT90 DT50_rep -SFO 407 1352 407 -IORE 541 5192066 1562968 -DFOP 429 2383 841 +SFO 407 1350 407 +IORE 541 5190000 1560000 +DFOP 429 2380 841 Representative half-life: [1] 841.4096 diff --git a/tests/testthat/test_nafta.R b/tests/testthat/test_nafta.R index a50d8f36..ad0f1d63 100644 --- a/tests/testthat/test_nafta.R +++ b/tests/testthat/test_nafta.R @@ -47,7 +47,7 @@ test_that("Test data from Appendix D are correctly evaluated", { # From Figure D.1 dtx_sop <- matrix(c(407, 541, 429, 1352, 5192066, 2383), nrow = 3, ncol = 2) - expect_equivalent(round(res$distimes[, 1:2]), dtx_sop) + expect_equivalent(round(res$distimes[, 1:2]), dtx_sop, tolerance = 0.00001) C0_sop <- c(SFO = 83.8, IORE = 96.9, DFOP = 97.6) C0_mkin <- sapply(res$parameters, function(x) x["parent_0", "Estimate"]) diff --git a/vignettes/web_only/NAFTA_examples.Rmd b/vignettes/web_only/NAFTA_examples.Rmd new file mode 100644 index 00000000..26a9240a --- /dev/null +++ b/vignettes/web_only/NAFTA_examples.Rmd @@ -0,0 +1,243 @@ +--- +title: "Evaluation of example datasets from Attachment 1 to the US EPA SOP for the NAFTA guidance" +author: "Johannes Ranke" +date: "`r Sys.Date()`" +output: + html_document: + toc: true + toc_float: + collapsed: false + mathjax: null + fig_retina: null +references: +- id: usepa2015 + title: Standard Operating Procedure for Using the NAFTA + Guidance to Calculate Representative Half-life Values and Characterizing + Pesticide Degradation + author: + - family: US EPA + type: report + issued: + year: 2015 + url: https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance +vignette: > + %\VignetteIndexEntry{Example evaluation of FOCUS Laboratory Data L1 to L3} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +# Introduction + +In this document, the example evaluations provided in Attachment 1 to the SOP +of US EPA for using the NAFTA guidance [@usepa2015] are repeated using mkin. +The original evaluations reported in the attachment were performed using PestDF +in version 0.8.4. Note that PestDF 0.8.13 is the version distributed at the US +EPA website today (2019-02-26). + +The datasets are now distributed with the mkin package. + +```{r, include = FALSE} +library(knitr) +opts_chunk$set(tidy = FALSE, cache = FALSE, fig.height = 7) +library("mkin", quietly = TRUE) +``` + +# Examples where DFOP did not converge with PestDF 0.8.4 + +In attachment 1, it is reported that the DFOP model does not converge for these +datasets when PestDF 0.8.4 was used. For all four datasets, the DFOP model can +be fitted with mkin (see below). The negative half-life given by PestDF 0.8.4 +for these fits appears to be the result of a bug. The results for the other +two models (SFO and IORE) are the same. + +## Example on page 5, upper panel + +```{r p5a} +p5a <- nafta(NAFTA_SOP_Attachment[["p5a"]]) +plot(p5a) +print(p5a) +``` + +## Example on page 5, lower panel + +```{r p5b} +p5b <- nafta(NAFTA_SOP_Attachment[["p5b"]]) +plot(p5b) +print(p5b) +``` + +## Example on page 6 + +```{r p6} +p6 <- nafta(NAFTA_SOP_Attachment[["p6"]]) +plot(p6) +print(p6) +``` + +## Example on page 7 + +```{r p7} +p7 <- nafta(NAFTA_SOP_Attachment[["p7"]]) +plot(p7) +print(p7) +``` + +# Examples where the representative half-life deviates from the observed DT50 + +## Example on page 8 + +For this dataset, the IORE fit does not converge when the default starting values +used by mkin for the IORE model are used. Therefore, a lower value for the rate +constant is used here. + +```{r p8} +p8 <- nafta(NAFTA_SOP_Attachment[["p8"]], parms.ini = c(k__iore_parent_sink = 1e-3)) +plot(p8) +print(p8) +``` + +# Examples where SFO was not selected for an abiotic study + +## Example on page 9, upper panel + +```{r p9a} +p9a <- nafta(NAFTA_SOP_Attachment[["p9a"]]) +plot(p9a) +print(p9a) +``` + +In this example, the residuals of the SFO indicate a lack of fit of this model, +so even if it was an abiotic experiment, the data do not suggest a simple +exponential decline. + +## Example on page 9, lower panel + +```{r p9b} +p9b <- nafta(NAFTA_SOP_Attachment[["p9b"]]) +plot(p9b) +print(p9b) +``` + +Here, mkin gives a longer slow DT50 for the DFOP model (17.8 days) than +PestDF (13.5 days). Presumably, this is related to the fact that +PestDF gives a negative value for the proportion of the fast degradation +which should be between 0 and 1, inclusive. This parameter is called +f in PestDF and g in mkin. In mkin, it is restricted to the interval from +0 to 1. + +## Example on page 10 + +```{r p10} +p10 <- nafta(NAFTA_SOP_Attachment[["p10"]]) +plot(p10) +print(p10) +``` + +Here, a value below N is given for the IORE model, because the data +suggests a faster decline towards the end of the experiment, which +appears physically rather unlikely in the case of a photolysis study. +It seems PestDF does not constrain N to values above zero, thus +the slight difference in IORE model parameters between PestDF and +mkin. + +# The DT50 was not observed during the study + +## Example on page 11 + +```{r p11} +p11 <- nafta(NAFTA_SOP_Attachment[["p11"]]) +plot(p11) +print(p11) +``` + +In this case, the DFOP fit reported for PestDF resulted +in a negative value for the slower rate constant, which is +not possible in mkin. The other results are in agreement. + +# N is less than 1 and the DFOP rate constants are like the SFO rate constant + +In the following three examples, the same results are obtained with mkin as +reported for PestDF. As in the case on page 10, the N values below 1 are deemed +unrealistic and appear to be the result of an overparameterisation. + + +## Example on page 12, upper panel + +```{r p12a} +p12a <- nafta(NAFTA_SOP_Attachment[["p12a"]]) +plot(p12a) +print(p12a) +``` + +## Example on page 12, lower panel + +```{r p12b} +p12b <- nafta(NAFTA_SOP_Attachment[["p12b"]]) +plot(p12b) +print(p12b) +``` + +## Example on page 13 + +```{r p13} +p13 <- nafta(NAFTA_SOP_Attachment[["p13"]]) +plot(p13) +print(p13) +``` + +# DT50 not observed in the study and DFOP problems in PestDF + +```{r p14} +p14 <- nafta(NAFTA_SOP_Attachment[["p14"]]) +plot(p14) +print(p14) +``` + +The slower rate constant reported by PestDF is negative, which is not +physically realistic, and not possible in mkin. The other fits give the same +results in mkin and PestDF. + +# N is less than 1 and DFOP fraction parameter is below zero + +```{r p15a} +p15a <- nafta(NAFTA_SOP_Attachment[["p15a"]]) +plot(p15a) +print(p15a) +``` + +```{r p15b} +p15b <- nafta(NAFTA_SOP_Attachment[["p15b"]]) +plot(p15b) +print(p15b) +``` + +In mkin, only the IORE fit is affected (deemed unrealistic), as the fraction +parameter of the DFOP model is restricted to the interval between 0 and 1 in +mkin. The SFO fits give the same results for both mkin and PestDF. + +# The DFOP fraction parameter is greater than 1 + +```{r p16} +p16 <- nafta(NAFTA_SOP_Attachment[["p16"]]) +plot(p16) +print(p16) +``` + +In PestDF, the DFOP fit seems to have stuck in a local minimum, as mkin finds +a solution with a much lower $\chi^2$ error level. As the half-life from the +slower rate constant of the DFOP model is larger than the IORE derived half-life, +the NAFTA recommendation obtained with mkin is to use the DFOP representative +half-life of 8.9 days. + +# Conclusions + +The results obtained with mkin deviate from the results obtained with PestDF +either in cases where one of the interpretive rules would apply, i.e. the +IORE parameter N is less than one or the DFOP k values obtained with PestDF are +equal to the SFO k values, or in cases where the DFOP model did not converge, +which often lead to negative rate constants returned by PestDF. + +Therefore, mkin appears to suitable for kinetic evaluations according to the +NAFTA guidance. + +# References -- cgit v1.2.1