diff options
27 files changed, 1207 insertions, 94 deletions
@@ -1,26 +1,34 @@ -# Export all names +# Export all names except for those starting with a dot exportPattern("^[^\\.]") -S3method(print, mkinds) + S3method(print, mkinmod) +S3method(print, mkinds) +S3method(print, nafta) + S3method(plot, mkinfit) +S3method(plot, mmkin) +S3method(plot, nafta) + S3method(summary, mkinfit) S3method(print, summary.mkinfit) + S3method(logLik, mkinfit) -S3method(plot, mmkin) S3method("[", mmkin) S3method(AIC, mmkin) + S3method(mkinpredict, mkinmod) S3method(mkinpredict, mkinfit) import( stats, - graphics, + graphics, FME, minpack.lm, rootSolve, inline, parallel ) + importFrom(deSolve, ode) importFrom(methods, signature) importFrom(R6, R6Class) @@ -1,4 +1,4 @@ -# mkin 0.9.48.1 (2019-02-21) +# mkin 0.9.48.1 (2019-02-22) - Add the function 'logLik.mkinfit' which makes it possible to calculate an AIC for mkinfit objects @@ -18,6 +18,8 @@ - Implement the logistic model (only tested for parent fits) +- 'nafta': Add evaluations according to the NAFTA guidance + # mkin 0.9.47.5 (2018-09-14) - Make the two-component error model stop in cases where it is inadequate to avoid nls crashes on windows diff --git a/R/nafta.R b/R/nafta.R new file mode 100644 index 00000000..102a9ad6 --- /dev/null +++ b/R/nafta.R @@ -0,0 +1,105 @@ +# Copyright (C) 2019 Johannes Ranke +# Contact: jranke@uni-bremen.de + +# This file is part of the R package mkin + +# mkin is free software: you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. + +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. + +# You should have received a copy of the GNU General Public License along with +# this program. If not, see <http://www.gnu.org/licenses/> + +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") + } + n <- nrow(subset(ds, !is.na(value))) + models <- c("SFO", "IORE", "DFOP") + + result <- list(title = title, data = ds) + result$mmkin <- mmkin(models, list(ds), quiet = TRUE) + + distimes <- lapply(result$mmkin, function(x) as.numeric(endpoints(x)$distimes["parent", ])) + + result$distimes <- matrix(NA, nrow = 3, ncol = 3, + dimnames = list(models, c("DT50", "DT90", "DT50_rep"))) + result$distimes["SFO", ] <- distimes[[1]][c(1, 2, 1)] + result$distimes["IORE", ] <- distimes[[2]][c(1, 2, 3)] + result$distimes["DFOP", ] <- distimes[[3]][c(1, 2, 4)] + + # Get parameters with statistics + result$parameters <- lapply(result$mmkin, function(x) { + summary(x)$bpar[, c(1, 4:6)] + }) + names(result$parameters) <- models + + # Compare the sum of squared residuals (SSR) to the upper bound of the + # confidence region of the SSR for the IORE model + result$S <- sapply(result$mmkin, function(x) x$ssr) + names(result$S) <- models + # Equation (3) on p. 3 + p <- 3 + result$S["IORE"] + result$S_c <- result$S[["IORE"]] * (1 + p/(n - p) * qf(0.5, p, n - p)) + + result$t_rep <- .evaluate_nafta_results(result$S, result$S_c, + result$distimes, quiet = quiet) + + class(result) <- "nafta" + return(result) +} + +plot.nafta <- function(x, legend = FALSE, main = "auto", ...) { + if (main == "auto") { + if (is.na(x$title)) main = "" + else main = x$title + } + plot(x$mmkin, ..., legend = legend, main = main) +} + +print.nafta <- function(x, quiet = TRUE, ...) { + cat("Parameters:\n") + 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)) + cat("\nRepresentative half-life:\n") + print(t_rep) +} + +.evaluate_nafta_results <- function(S, S_c, distimes, quiet = FALSE) { + t_SFO <- distimes["IORE", "DT50"] + t_IORE <- distimes["IORE", "DT50_rep"] + t_DFOP2 <- distimes["DFOP", "DT50_rep"] + + if (S["SFO"] < S_c) { + if (!quiet) { + message("S_SFO is lower than the critical value S_c, use the SFO model") + } + t_rep <- t_SFO + } else { + if (!quiet) { + message("The SFO model is rejected as S_SFO is equal or higher than the critical value S_c") + } + if (t_IORE < t_DFOP2) { + if (!quiet) { + message("The half-life obtained from the IORE model may be used") + } + t_rep <- t_IORE + } else { + if (!quiet) { + message("The representative half-life of the IORE model is longer than the one corresponding to the terminal degradation rate found with the DFOP model.") + message("The reprentative half-life obtained from the DFOP model may be used") + } + t_rep <- t_DFOP2 + } + } + return(t_rep) +} diff --git a/data/NAFTA_2015.rda b/data/NAFTA_2015.rda Binary files differnew file mode 100644 index 00000000..48183048 --- /dev/null +++ b/data/NAFTA_2015.rda diff --git a/docs/articles/FOCUS_D.html b/docs/articles/FOCUS_D.html index 38e59d9d..ad8413dc 100644 --- a/docs/articles/FOCUS_D.html +++ b/docs/articles/FOCUS_D.html @@ -163,8 +163,8 @@ <div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/summary">summary</a></span>(fit)</a></code></pre></div> <pre><code>## mkin version used for fitting: 0.9.48.1 ## R version used for fitting: 3.5.2 -## Date of fit: Fri Feb 22 09:51:20 2019 -## Date of summary: Fri Feb 22 09:51:21 2019 +## Date of fit: Fri Feb 22 20:48:30 2019 +## Date of summary: Fri Feb 22 20:48:31 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.693 s +## Fitted with method Port using 153 model solutions performed in 0.731 s ## ## Weighting: none ## diff --git a/docs/articles/FOCUS_L.html b/docs/articles/FOCUS_L.html index 13131315..17c7bf59 100644 --- a/docs/articles/FOCUS_L.html +++ b/docs/articles/FOCUS_L.html @@ -111,15 +111,15 @@ <a class="sourceLine" id="cb2-2" data-line-number="2"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/summary">summary</a></span>(m.L1.SFO)</a></code></pre></div> <pre><code>## mkin version used for fitting: 0.9.48.1 ## R version used for fitting: 3.5.2 -## Date of fit: Fri Feb 22 09:51:22 2019 -## Date of summary: Fri Feb 22 09:51:22 2019 +## Date of fit: Fri Feb 22 20:48:32 2019 +## Date of summary: Fri Feb 22 20:48:32 2019 ## ## Equations: ## d_parent/dt = - k_parent_sink * parent ## ## Model predictions using solution type analytical ## -## Fitted with method Port using 37 model solutions performed in 0.095 s +## Fitted with method Port using 37 model solutions performed in 0.105 s ## ## Weighting: none ## @@ -202,15 +202,15 @@ <div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/summary">summary</a></span>(m.L1.FOMC, <span class="dt">data =</span> <span class="ot">FALSE</span>)</a></code></pre></div> <pre><code>## mkin version used for fitting: 0.9.48.1 ## R version used for fitting: 3.5.2 -## Date of fit: Fri Feb 22 09:51:24 2019 -## Date of summary: Fri Feb 22 09:51:24 2019 +## Date of fit: Fri Feb 22 20:48:34 2019 +## Date of summary: Fri Feb 22 20:48:34 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.515 s +## Fitted with method Port using 611 model solutions performed in 1.604 s ## ## Weighting: none ## @@ -297,15 +297,15 @@ <div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/summary">summary</a></span>(m.L2.FOMC, <span class="dt">data =</span> <span class="ot">FALSE</span>)</a></code></pre></div> <pre><code>## mkin version used for fitting: 0.9.48.1 ## R version used for fitting: 3.5.2 -## Date of fit: Fri Feb 22 09:51:25 2019 -## Date of summary: Fri Feb 22 09:51:25 2019 +## Date of fit: Fri Feb 22 20:48:35 2019 +## Date of summary: Fri Feb 22 20:48:35 2019 ## ## Equations: ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent ## ## Model predictions using solution type analytical ## -## Fitted with method Port using 81 model solutions performed in 0.198 s +## Fitted with method Port using 81 model solutions performed in 0.216 s ## ## Weighting: none ## @@ -368,8 +368,8 @@ <div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb15-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/summary">summary</a></span>(m.L2.DFOP, <span class="dt">data =</span> <span class="ot">FALSE</span>)</a></code></pre></div> <pre><code>## mkin version used for fitting: 0.9.48.1 ## R version used for fitting: 3.5.2 -## Date of fit: Fri Feb 22 09:51:26 2019 -## Date of summary: Fri Feb 22 09:51:26 2019 +## Date of fit: Fri Feb 22 20:48:36 2019 +## Date of summary: Fri Feb 22 20:48:36 2019 ## ## Equations: ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * @@ -378,7 +378,7 @@ ## ## Model predictions using solution type analytical ## -## Fitted with method Port using 336 model solutions performed in 0.847 s +## Fitted with method Port using 336 model solutions performed in 0.864 s ## ## Weighting: none ## @@ -460,8 +460,8 @@ <div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/summary">summary</a></span>(mm.L3[[<span class="st">"DFOP"</span>, <span class="dv">1</span>]])</a></code></pre></div> <pre><code>## mkin version used for fitting: 0.9.48.1 ## R version used for fitting: 3.5.2 -## Date of fit: Fri Feb 22 09:51:27 2019 -## Date of summary: Fri Feb 22 09:51:27 2019 +## Date of fit: Fri Feb 22 20:48:37 2019 +## Date of summary: Fri Feb 22 20:48:38 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.347 s +## Fitted with method Port using 137 model solutions performed in 0.362 s ## ## Weighting: none ## @@ -561,15 +561,15 @@ <div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb26-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/summary">summary</a></span>(mm.L4[[<span class="st">"SFO"</span>, <span class="dv">1</span>]], <span class="dt">data =</span> <span class="ot">FALSE</span>)</a></code></pre></div> <pre><code>## mkin version used for fitting: 0.9.48.1 ## R version used for fitting: 3.5.2 -## Date of fit: Fri Feb 22 09:51:27 2019 -## Date of summary: Fri Feb 22 09:51:28 2019 +## Date of fit: Fri Feb 22 20:48:38 2019 +## Date of summary: Fri Feb 22 20:48:38 2019 ## ## Equations: ## d_parent/dt = - k_parent_sink * parent ## ## Model predictions using solution type analytical ## -## Fitted with method Port using 46 model solutions performed in 0.112 s +## Fitted with method Port using 46 model solutions performed in 0.123 s ## ## Weighting: none ## @@ -621,15 +621,15 @@ <div class="sourceCode" id="cb28"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb28-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/summary">summary</a></span>(mm.L4[[<span class="st">"FOMC"</span>, <span class="dv">1</span>]], <span class="dt">data =</span> <span class="ot">FALSE</span>)</a></code></pre></div> <pre><code>## mkin version used for fitting: 0.9.48.1 ## R version used for fitting: 3.5.2 -## Date of fit: Fri Feb 22 09:51:28 2019 -## Date of summary: Fri Feb 22 09:51:28 2019 +## Date of fit: Fri Feb 22 20:48:38 2019 +## Date of summary: Fri Feb 22 20:48:38 2019 ## ## Equations: ## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent ## ## Model predictions using solution type analytical ## -## Fitted with method Port using 66 model solutions performed in 0.165 s +## Fitted with method Port using 66 model solutions performed in 0.184 s ## ## Weighting: none ## diff --git a/docs/articles/web_only/compiled_models.html b/docs/articles/web_only/compiled_models.html index e9f8fa99..fbf2de33 100644 --- a/docs/articles/web_only/compiled_models.html +++ b/docs/articles/web_only/compiled_models.html @@ -126,14 +126,14 @@ <a class="sourceLine" id="cb5-16" data-line-number="16">}</a></code></pre></div> <pre><code>## Lade nötiges Paket: rbenchmark</code></pre> <pre><code>## test replications elapsed relative user.self sys.self -## 3 deSolve, compiled 3 2.336 1.000 2.335 0 -## 1 deSolve, not compiled 3 17.610 7.539 17.602 0 -## 2 Eigenvalue based 3 2.899 1.241 2.897 0 +## 3 deSolve, compiled 3 2.484 1.000 2.483 0 +## 1 deSolve, not compiled 3 17.963 7.231 17.951 0 +## 2 Eigenvalue based 3 3.146 1.267 3.144 0 ## user.child sys.child ## 3 0 0 ## 1 0 0 ## 2 0 0</code></pre> -<p>We see that using the compiled model is by a factor of around 8 faster than using the R version with the default ode solver, and it is even faster than the Eigenvalue based solution implemented in R which does not need iterative solution of the ODEs.</p> +<p>We see that using the compiled model is by a factor of around 7 faster than using the R version with the default ode solver, and it is even faster than the Eigenvalue based solution implemented in R which does not need iterative solution of the ODEs.</p> </div> <div id="model-that-can-not-be-solved-with-eigenvalues" class="section level2"> <h2 class="hasAnchor"> @@ -157,8 +157,8 @@ <a class="sourceLine" id="cb8-16" data-line-number="16">}</a></code></pre></div> <pre><code>## Successfully compiled differential equation model from auto-generated C code.</code></pre> <pre><code>## test replications elapsed relative user.self sys.self -## 2 deSolve, compiled 3 4.122 1.000 4.119 0 -## 1 deSolve, not compiled 3 37.359 9.063 37.343 0 +## 2 deSolve, compiled 3 4.232 1.000 4.226 0.004 +## 1 deSolve, not compiled 3 37.946 8.966 37.924 0.000 ## user.child sys.child ## 2 0 0 ## 1 0 0</code></pre> diff --git a/docs/news/index.html b/docs/news/index.html index 2e62819c..cd82d187 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -119,9 +119,9 @@ </div> - <div id="mkin-0-9-48-1-2019-02-21" class="section level1"> + <div id="mkin-0-9-48-1-2019-02-22" class="section level1"> <h1 class="page-header"> -<a href="#mkin-0-9-48-1-2019-02-21" class="anchor"></a>mkin 0.9.48.1 (2019-02-21)<small> Unreleased </small> +<a href="#mkin-0-9-48-1-2019-02-22" class="anchor"></a>mkin 0.9.48.1 (2019-02-22)<small> Unreleased </small> </h1> <ul> <li><p>Add the function ‘logLik.mkinfit’ which makes it possible to calculate an AIC for mkinfit objects</p></li> @@ -133,6 +133,7 @@ <li><p>‘tests/testthat/test_irls.R’: Test if the components of the error model used to generate the data can be reproduced with moderate accuracy</p></li> <li><p>Add the function ‘CAKE_export’ to facilitate cross-checking of results</p></li> <li><p>Implement the logistic model (only tested for parent fits)</p></li> +<li><p>‘nafta’: Add evaluations according to the NAFTA guidance</p></li> </ul> </div> <div id="mkin-0-9-47-5-2018-09-14" class="section level1"> @@ -676,7 +677,7 @@ <div id="tocnav"> <h2>Contents</h2> <ul class="nav nav-pills nav-stacked"> - <li><a href="#mkin-0-9-48-1-2019-02-21">0.9.48.1</a></li> + <li><a href="#mkin-0-9-48-1-2019-02-22">0.9.48.1</a></li> <li><a href="#mkin-0-9-47-5-2018-09-14">0.9.47.5</a></li> <li><a href="#mkin-0-9-47-3">0.9.47.3</a></li> <li><a href="#mkin-0-9-47-2-2018-07-19">0.9.47.2</a></li> diff --git a/docs/reference/Extract.mmkin.html b/docs/reference/Extract.mmkin.html index 20949a8f..e3285ed3 100644 --- a/docs/reference/Extract.mmkin.html +++ b/docs/reference/Extract.mmkin.html @@ -280,7 +280,7 @@ #> #> $time #> User System verstrichen -#> 0.197 0.000 0.197 +#> 0.201 0.000 0.200 #> #> $mkinmod #> <mkinmod> model generated with @@ -469,8 +469,8 @@ #> } #> return(mC) #> } -#> <bytecode: 0x55555920cf58> -#> <environment: 0x5555560a01f8> +#> <bytecode: 0x555559103bf0> +#> <environment: 0x55555a51ba10> #> #> $cost_notrans #> function (P) @@ -492,8 +492,8 @@ #> scaleVar = scaleVar) #> return(mC) #> } -#> <bytecode: 0x55555a322750> -#> <environment: 0x5555560a01f8> +#> <bytecode: 0x55555a537b00> +#> <environment: 0x55555a51ba10> #> #> $hessian_notrans #> parent_0 k_parent_sink @@ -560,7 +560,7 @@ #> 99.17407 #> #> $date -#> [1] "Fri Feb 22 09:49:27 2019" +#> [1] "Fri Feb 22 20:46:31 2019" #> #> $version #> [1] "0.9.48.1" diff --git a/docs/reference/NAFTA_2015_datasets-1.png b/docs/reference/NAFTA_2015_datasets-1.png Binary files differnew file mode 100644 index 00000000..c4f9f048 --- /dev/null +++ b/docs/reference/NAFTA_2015_datasets-1.png diff --git a/docs/reference/NAFTA_2015_datasets.html b/docs/reference/NAFTA_2015_datasets.html new file mode 100644 index 00000000..9ef56fb0 --- /dev/null +++ b/docs/reference/NAFTA_2015_datasets.html @@ -0,0 +1,213 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>Example datasets from the NAFTA guidance published 2015 — NAFTA_2015_datasets • mkin</title> + +<!-- jquery --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" /> +<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" /> + +<!-- clipboard.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script> + +<!-- sticky kit --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script> + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../pkgdown.js"></script> + + + +<meta property="og:title" content="Example datasets from the NAFTA guidance published 2015 — NAFTA_2015_datasets" /> + +<meta property="og:description" content="Data taken from US EPA (2015), p. 23." /> +<meta name="twitter:card" content="summary" /> + + + +<!-- mathjax --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + + </head> + + <body> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <span class="navbar-brand"> + <a class="navbar-link" href="../index.html">mkin</a> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.48.1</span> + </span> + </div> + + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Functions and data</a> +</li> +<li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> + Articles + + <span class="caret"></span> + </a> + <ul class="dropdown-menu" role="menu"> + <li> + <a href="../articles/mkin.html">Introduction to mkin</a> + </li> + <li> + <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a> + </li> + <li> + <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a> + </li> + <li> + <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> + </li> + <li> + <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a> + </li> + <li> + <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a> + </li> + </ul> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + + </ul> + + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + </header> + +<div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Example datasets from the NAFTA guidance published 2015</h1> + + <div class="hidden name"><code>NAFTA_2015_datasets.Rd</code></div> + </div> + + <div class="ref-description"> + + <p>Data taken from US EPA (2015), p. 23.</p> + + </div> + + <pre class="usage"><span class='no'>NAFTA_2015_datasets</span></pre> + + <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> + + <p>1 dataset with observations on the following variables.</p><dl class='dl-horizontal'> + <dt><code>name</code></dt><dd><p>a factor containing the name of the observed variable</p></dd> + <dt><code>time</code></dt><dd><p>a numeric vector containing time points</p></dd> + <dt><code>value</code></dt><dd><p>a numeric vector containing concentrations</p></dd> + </dl> + + <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2> + + <p>NAFTA (2011) Guidance for evaluating and calculating degradation kinetics + in environmental media. NAFTA Technical Working Group on Pesticides + <a href='https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/guidance-evaluating-and-calculating-degradation'>https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/guidance-evaluating-and-calculating-degradation</a> + accessed 2019-02-22</p> +<p>US EPA (2015) Standard Operating Procedure for Using the NAFTA Guidance to + Calculate Representative Half-life Values and Characterizing Pesticide + Degradation + <a href='https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance'>https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance</a></p> + + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'> <span class='no'>nafta_evaluation</span> <span class='kw'><-</span> <span class='fu'><a href='nafta.html'>nafta</a></span>(<span class='no'>MRID_555555</span>)</div><div class='output co'>#> <span class='message'>The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</span></div><div class='output co'>#> <span class='message'>The representative half-life of the IORE model is longer than the one corresponding to the terminal degradation rate found with the DFOP model.</span></div><div class='output co'>#> <span class='message'>The reprentative half-life obtained from the DFOP model may be used</span></div><div class='input'> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/print'>print</a></span>(<span class='no'>nafta_evaluation</span>)</div><div class='output co'>#> Parameters: +#> $SFO +#> Estimate Pr(>t) Lower Upper +#> parent_0 83.755751519 8.076390e-15 76.928220975 90.583282063 +#> 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 +#> +#> $DFOP +#> Estimate Pr(>t) Lower Upper +#> parent_0 9.755655e+01 4.439930e-13 8.884447e+01 1.062686e+02 +#> k1 4.240633e-02 3.554769e-02 1.414189e-02 1.271610e-01 +#> k2 8.237928e-04 2.060933e-02 3.172784e-04 2.138925e-03 +#> 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 +#> +#> Representative half-life: +#> [1] 841.4096</div><div class='input'> <span class='fu'><a href='https://www.rdocumentation.org/packages/graphics/topics/plot'>plot</a></span>(<span class='no'>nafta_evaluation</span>)</div><div class='img'><img src='NAFTA_2015_datasets-1.png' alt='' width='700' height='433' /></div></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + + <li><a href="#format">Format</a></li> + + <li><a href="#source">Source</a></li> + + <li><a href="#examples">Examples</a></li> + </ul> + + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p> +</div> + </footer> + </div> + + + + </body> +</html> + diff --git a/docs/reference/mccall81_245T.html b/docs/reference/mccall81_245T.html index 46de4255..7b3418de 100644 --- a/docs/reference/mccall81_245T.html +++ b/docs/reference/mccall81_245T.html @@ -160,8 +160,8 @@ <span class='kw'>anisole</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/list'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>))</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> </div><div class='input'> <span class='no'>fit.1</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO_SFO</span>, <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/subset'>subset</a></span>(<span class='no'>mccall81_245T</span>, <span class='no'>soil</span> <span class='kw'>==</span> <span class='st'>"Commerce"</span>), <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/summary'>summary</a></span>(<span class='no'>fit.1</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</div><div class='output co'>#> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Fri Feb 22 09:49:48 2019 -#> Date of summary: Fri Feb 22 09:49:48 2019 +#> Date of fit: Fri Feb 22 20:46:54 2019 +#> Date of summary: Fri Feb 22 20:46:54 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.837 s +#> Fitted with method Port using 574 model solutions performed in 4.461 s #> #> Weighting: none #> @@ -249,8 +249,8 @@ <span class='kw'>fixed_parms</span> <span class='kw'>=</span> <span class='st'>"k_phenol_sink"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/summary'>summary</a></span>(<span class='no'>fit.2</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</div><div class='output co'>#> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Fri Feb 22 09:49:50 2019 -#> Date of summary: Fri Feb 22 09:49:50 2019 +#> Date of fit: Fri Feb 22 20:46:56 2019 +#> Date of summary: Fri Feb 22 20:46:56 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.611 s +#> Fitted with method Port using 246 model solutions performed in 1.709 s #> #> Weighting: none #> diff --git a/docs/reference/mkinfit.html b/docs/reference/mkinfit.html index addb23e5..dfdddb25 100644 --- a/docs/reference/mkinfit.html +++ b/docs/reference/mkinfit.html @@ -438,15 +438,15 @@ <span class='no'>fit</span> <span class='kw'><-</span> <span class='fu'>mkinfit</span>(<span class='st'>"FOMC"</span>, <span class='no'>FOCUS_2006_C</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/summary'>summary</a></span>(<span class='no'>fit</span>)</div><div class='output co'>#> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Fri Feb 22 09:49:53 2019 -#> Date of summary: Fri Feb 22 09:49:53 2019 +#> Date of fit: Fri Feb 22 20:46:59 2019 +#> Date of summary: Fri Feb 22 20:46:59 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.159 s +#> Fitted with method Port using 64 model solutions performed in 0.185 s #> #> Weighting: none #> @@ -515,7 +515,7 @@ <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>))</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='co'># Fit the model to the FOCUS example dataset D using defaults</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/print'>print</a></span>(<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/system.time'>system.time</a></span>(<span class='no'>fit</span> <span class='kw'><-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"eigen"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)))</div><div class='output co'>#> User System verstrichen -#> 1.015 0.000 1.016 </div><div class='input'><span class='fu'><a href='https://www.rdocumentation.org/packages/stats/topics/coef'>coef</a></span>(<span class='no'>fit</span>)</div><div class='output co'>#> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink +#> 1.071 0.000 1.072 </div><div class='input'><span class='fu'><a href='https://www.rdocumentation.org/packages/stats/topics/coef'>coef</a></span>(<span class='no'>fit</span>)</div><div class='output co'>#> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink #> 99.59848 -3.03822 -2.98030 -5.24750 </div><div class='input'><span class='fu'><a href='endpoints.html'>endpoints</a></span>(<span class='no'>fit</span>)</div><div class='output co'>#> $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.821 0.000 0.822 </div><div class='input'><span class='fu'><a href='https://www.rdocumentation.org/packages/stats/topics/coef'>coef</a></span>(<span class='no'>fit.deSolve</span>)</div><div class='output co'>#> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink +#> 0.852 0.000 0.852 </div><div class='input'><span class='fu'><a href='https://www.rdocumentation.org/packages/stats/topics/coef'>coef</a></span>(<span class='no'>fit.deSolve</span>)</div><div class='output co'>#> parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink #> 99.59848 -3.03822 -2.98030 -5.24750 </div><div class='input'><span class='fu'><a href='endpoints.html'>endpoints</a></span>(<span class='no'>fit.deSolve</span>)</div><div class='output co'>#> $ff #> parent_sink parent_m1 m1_sink #> 0.485524 0.514476 1.000000 @@ -628,8 +628,8 @@ <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>), <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output co'>#> <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='no'>f.noweight</span> <span class='kw'><-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO.ff</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/summary'>summary</a></span>(<span class='no'>f.noweight</span>)</div><div class='output co'>#> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Fri Feb 22 09:50:05 2019 -#> Date of summary: Fri Feb 22 09:50:05 2019 +#> Date of fit: Fri Feb 22 20:47:11 2019 +#> Date of summary: Fri Feb 22 20:47:11 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.853 s +#> Fitted with method Port using 186 model solutions performed in 0.864 s #> #> Weighting: none #> @@ -745,8 +745,8 @@ #> 120 m1 33.31 28.78984 4.520e+00</div><div class='input'><span class='no'>f.irls</span> <span class='kw'><-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO.ff</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>reweight.method</span> <span class='kw'>=</span> <span class='st'>"obs"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/summary'>summary</a></span>(<span class='no'>f.irls</span>)</div><div class='output co'>#> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Fri Feb 22 09:50:07 2019 -#> Date of summary: Fri Feb 22 09:50:07 2019 +#> Date of fit: Fri Feb 22 20:47:14 2019 +#> Date of summary: Fri Feb 22 20:47:14 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.535 s +#> Fitted with method Port using 551 model solutions performed in 2.584 s #> #> Weighting: none #> @@ -867,8 +867,8 @@ #> 120 m1 33.31 28.80898 4.501e+00 2.722</div><div class='input'><span class='no'>f.w.mean</span> <span class='kw'><-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO.ff</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>weight</span> <span class='kw'>=</span> <span class='st'>"mean"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/summary'>summary</a></span>(<span class='no'>f.w.mean</span>)</div><div class='output co'>#> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Fri Feb 22 09:50:08 2019 -#> Date of summary: Fri Feb 22 09:50:08 2019 +#> Date of fit: Fri Feb 22 20:47:15 2019 +#> Date of summary: Fri Feb 22 20:47:15 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.717 s +#> Fitted with method Port using 155 model solutions performed in 0.716 s #> #> Weighting: mean #> @@ -985,8 +985,8 @@ <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/summary'>summary</a></span>(<span class='no'>f.w.value</span>)</div><div class='output co'>#> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Fri Feb 22 09:50:09 2019 -#> Date of summary: Fri Feb 22 09:50:09 2019 +#> Date of fit: Fri Feb 22 20:47:16 2019 +#> Date of summary: Fri Feb 22 20:47:16 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.796 s +#> Fitted with method Port using 174 model solutions performed in 0.83 s #> #> Weighting: manual #> @@ -1105,8 +1105,8 @@ <span class='no'>f.w.man</span> <span class='kw'><-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO.ff</span>, <span class='no'>dw</span>, <span class='kw'>err</span> <span class='kw'>=</span> <span class='st'>"err.man"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/summary'>summary</a></span>(<span class='no'>f.w.man</span>)</div><div class='output co'>#> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Fri Feb 22 09:50:11 2019 -#> Date of summary: Fri Feb 22 09:50:11 2019 +#> Date of fit: Fri Feb 22 20:47:17 2019 +#> Date of summary: Fri Feb 22 20:47:17 2019 #> #> Equations: #> d_parent/dt = - k_parent * parent @@ -1114,7 +1114,7 @@ #> #> Model predictions using solution type deSolve #> -#> Fitted with method Port using 270 model solutions performed in 1.325 s +#> Fitted with method Port using 270 model solutions performed in 1.286 s #> #> Weighting: manual #> @@ -1223,8 +1223,8 @@ <span class='kw'>reweight.method</span> <span class='kw'>=</span> <span class='st'>"obs"</span>) <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/summary'>summary</a></span>(<span class='no'>f.w.man.irls</span>)</div><div class='output co'>#> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Fri Feb 22 09:50:14 2019 -#> Date of summary: Fri Feb 22 09:50:14 2019 +#> Date of fit: Fri Feb 22 20:47:21 2019 +#> Date of summary: Fri Feb 22 20:47:21 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.303 s +#> Fitted with method Port using 692 model solutions performed in 3.38 s #> #> Weighting: manual #> diff --git a/docs/reference/mkinmod.html b/docs/reference/mkinmod.html index b2f290d1..64fba5e5 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 <span class='no'>SFO_SFO</span> <span class='kw'><-</span> <span class='fu'>mkinmod</span>( <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>, <span class='st'>"m1"</span>), <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>), <span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><div class='output co'>#> Compilation argument: -#> /usr/lib/R/bin/R CMD SHLIB file4d9c2c394c1.c 2> file4d9c2c394c1.c.err.txt +#> /usr/lib/R/bin/R CMD SHLIB file622753352edd.c 2> file622753352edd.c.err.txt #> Program source: #> 1: #include <R.h> #> 2: diff --git a/docs/reference/mkinpredict.html b/docs/reference/mkinpredict.html index 6f789fa4..2b4c33aa 100644 --- a/docs/reference/mkinpredict.html +++ b/docs/reference/mkinpredict.html @@ -325,17 +325,17 @@ <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fl'>100</span>, <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fl'>0</span>), <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/seq'>seq</a></span>(<span class='fl'>0</span>, <span class='fl'>20</span>, <span class='kw'>by</span> <span class='kw'>=</span> <span class='fl'>0.1</span>), <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"eigen"</span>)[<span class='fl'>201</span>,]))</div><div class='output co'>#> time parent m1 #> 201 20 4.978707 27.46227</div><div class='output co'>#> User System verstrichen -#> 0.003 0.000 0.003 </div><div class='input'> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/system.time'>system.time</a></span>( +#> 0.004 0.000 0.003 </div><div class='input'> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/system.time'>system.time</a></span>( <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/print'>print</a></span>(<span class='fu'>mkinpredict</span>(<span class='no'>SFO_SFO</span>, <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='kw'>k_parent_m1</span> <span class='kw'>=</span> <span class='fl'>0.05</span>, <span class='kw'>k_parent_sink</span> <span class='kw'>=</span> <span class='fl'>0.1</span>, <span class='kw'>k_m1_sink</span> <span class='kw'>=</span> <span class='fl'>0.01</span>), <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fl'>100</span>, <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fl'>0</span>), <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/seq'>seq</a></span>(<span class='fl'>0</span>, <span class='fl'>20</span>, <span class='kw'>by</span> <span class='kw'>=</span> <span class='fl'>0.1</span>), <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"deSolve"</span>)[<span class='fl'>201</span>,]))</div><div class='output co'>#> time parent m1 #> 201 20 4.978707 27.46227</div><div class='output co'>#> User System verstrichen -#> 0.001 0.000 0.002 </div><div class='input'> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/system.time'>system.time</a></span>( +#> 0.002 0.000 0.002 </div><div class='input'> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/system.time'>system.time</a></span>( <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/print'>print</a></span>(<span class='fu'>mkinpredict</span>(<span class='no'>SFO_SFO</span>, <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='kw'>k_parent_m1</span> <span class='kw'>=</span> <span class='fl'>0.05</span>, <span class='kw'>k_parent_sink</span> <span class='kw'>=</span> <span class='fl'>0.1</span>, <span class='kw'>k_m1_sink</span> <span class='kw'>=</span> <span class='fl'>0.01</span>), <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fl'>100</span>, <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fl'>0</span>), <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/seq'>seq</a></span>(<span class='fl'>0</span>, <span class='fl'>20</span>, <span class='kw'>by</span> <span class='kw'>=</span> <span class='fl'>0.1</span>), <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"deSolve"</span>, <span class='kw'>use_compiled</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)[<span class='fl'>201</span>,]))</div><div class='output co'>#> time parent m1 #> 201 20 4.978707 27.46227</div><div class='output co'>#> User System verstrichen -#> 0.042 0.000 0.042 </div><div class='input'> +#> 0.039 0.000 0.040 </div><div class='input'> </div><div class='input'> <span class='co'># Predict from a fitted model</span> <span class='no'>f</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_C</span>)</div><div class='output co'>#> 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 73a25ef2..71ec89e8 100644 --- a/docs/reference/mmkin.html +++ b/docs/reference/mmkin.html @@ -191,8 +191,8 @@ <span class='no'>time_1</span> <span class='kw'><-</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/system.time'>system.time</a></span>(<span class='no'>fits.4</span> <span class='kw'><-</span> <span class='fu'>mmkin</span>(<span class='no'>models</span>, <span class='no'>datasets</span>, <span class='kw'>cores</span> <span class='kw'>=</span> <span class='fl'>1</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)) <span class='no'>time_default</span></div><div class='output co'>#> User System verstrichen -#> 0.040 0.047 7.314 </div><div class='input'><span class='no'>time_1</span></div><div class='output co'>#> User System verstrichen -#> 22.751 0.000 22.766 </div><div class='input'> +#> 0.052 0.044 7.383 </div><div class='input'><span class='no'>time_1</span></div><div class='output co'>#> User System verstrichen +#> 23.652 0.004 23.672 </div><div class='input'> <span class='fu'><a href='endpoints.html'>endpoints</a></span>(<span class='no'>fits.0</span><span class='kw'>[[</span><span class='st'>"SFO_lin"</span>, <span class='fl'>2</span>]])</div><div class='output co'>#> $ff #> parent_M1 parent_sink M1_M2 M1_sink #> 0.7340480 0.2659520 0.7505686 0.2494314 diff --git a/docs/reference/nafta-1.png b/docs/reference/nafta-1.png Binary files differnew file mode 100644 index 00000000..c4f9f048 --- /dev/null +++ b/docs/reference/nafta-1.png diff --git a/docs/reference/nafta.html b/docs/reference/nafta.html new file mode 100644 index 00000000..c74c3939 --- /dev/null +++ b/docs/reference/nafta.html @@ -0,0 +1,239 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>Evaluate parent kinetics using the NAFTA guidance — nafta • mkin</title> + +<!-- jquery --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" /> +<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" /> + +<!-- clipboard.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script> + +<!-- sticky kit --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script> + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../pkgdown.js"></script> + + + +<meta property="og:title" content="Evaluate parent kinetics using the NAFTA guidance — nafta" /> + +<meta property="og:description" content="The function fits the SFO, IORE and DFOP models using + mmkin and returns an object of class + nafta that has methods for printing and plotting." /> +<meta name="twitter:card" content="summary" /> + + + +<!-- mathjax --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + + </head> + + <body> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <span class="navbar-brand"> + <a class="navbar-link" href="../index.html">mkin</a> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.48.1</span> + </span> + </div> + + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Functions and data</a> +</li> +<li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> + Articles + + <span class="caret"></span> + </a> + <ul class="dropdown-menu" role="menu"> + <li> + <a href="../articles/mkin.html">Introduction to mkin</a> + </li> + <li> + <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a> + </li> + <li> + <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a> + </li> + <li> + <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> + </li> + <li> + <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a> + </li> + <li> + <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a> + </li> + </ul> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + + </ul> + + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + </header> + +<div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Evaluate parent kinetics using the NAFTA guidance</h1> + + <div class="hidden name"><code>nafta.Rd</code></div> + </div> + + <div class="ref-description"> + + <p>The function fits the SFO, IORE and DFOP models using + <code><a href='mmkin.html'>mmkin</a></code> and returns an object of class + <code>nafta</code> that has methods for printing and plotting.</p> + + </div> + + <pre class="usage"><span class='fu'>nafta</span>(<span class='no'>ds</span>, <span class='kw'>title</span> <span class='kw'>=</span> <span class='fl'>NA</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> + <table class="ref-arguments"> + <colgroup><col class="name" /><col class="desc" /></colgroup> + <tr> + <th>ds</th> + <td><p>A dataframe that must contain one variable called "time" with the time + values specified by the <code>time</code> argument, one column called "name" with + the grouping of the observed values, and finally one column of observed + values called "value".</p></td> + </tr> + <tr> + <th>title</th> + <td><p>Optional title of the dataset</p></td> + </tr> + <tr> + <th>quiet</th> + <td><p>Should the evaluation text be shown?</p></td> + </tr> + </table> + + <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> + + <p>An list of class <code>nafta</code>. The list element named "mmkin" is the + <code><a href='mmkin.html'>mmkin</a></code> object containing the fits of the three models. + The list element named "title" contains the title of the dataset used. + The list element "data" contains the dataset used in the fits.</p> + + <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2> + + <p>NAFTA (2011) Guidance for evaluating and calculating degradation kinetics + in environmental media. NAFTA Technical Working Group on Pesticides + <a href='https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/guidance-evaluating-and-calculating-degradation'>https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/guidance-evaluating-and-calculating-degradation</a> + accessed 2019-02-22</p> +<p>US EPA (2015) Standard Operating Procedure for Using the NAFTA Guidance to + Calculate Representative Half-life Values and Characterizing Pesticide + Degradation + <a href='https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance'>https://www.epa.gov/pesticide-science-and-assessing-pesticide-risks/standard-operating-procedure-using-nafta-guidance</a></p> + + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'> <span class='no'>nafta_evaluation</span> <span class='kw'><-</span> <span class='fu'>nafta</span>(<span class='no'>MRID_555555</span>)</div><div class='output co'>#> <span class='message'>The SFO model is rejected as S_SFO is equal or higher than the critical value S_c</span></div><div class='output co'>#> <span class='message'>The representative half-life of the IORE model is longer than the one corresponding to the terminal degradation rate found with the DFOP model.</span></div><div class='output co'>#> <span class='message'>The reprentative half-life obtained from the DFOP model may be used</span></div><div class='input'> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/print'>print</a></span>(<span class='no'>nafta_evaluation</span>)</div><div class='output co'>#> Parameters: +#> $SFO +#> Estimate Pr(>t) Lower Upper +#> parent_0 83.755751519 8.076390e-15 76.928220975 90.583282063 +#> 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 +#> +#> $DFOP +#> Estimate Pr(>t) Lower Upper +#> parent_0 9.755655e+01 4.439930e-13 8.884447e+01 1.062686e+02 +#> k1 4.240633e-02 3.554769e-02 1.414189e-02 1.271610e-01 +#> k2 8.237928e-04 2.060933e-02 3.172784e-04 2.138925e-03 +#> 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 +#> +#> Representative half-life: +#> [1] 841.4096</div><div class='input'> <span class='fu'><a href='https://www.rdocumentation.org/packages/graphics/topics/plot'>plot</a></span>(<span class='no'>nafta_evaluation</span>)</div><div class='img'><img src='nafta-1.png' alt='' width='700' height='433' /></div></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + <li><a href="#arguments">Arguments</a></li> + + <li><a href="#value">Value</a></li> + + <li><a href="#source">Source</a></li> + + <li><a href="#examples">Examples</a></li> + </ul> + + <h2>Author</h2> + <p>Johannes Ranke</p> + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p> +</div> + </footer> + </div> + + + + </body> +</html> + diff --git a/docs/reference/plot.nafta.html b/docs/reference/plot.nafta.html new file mode 100644 index 00000000..ccc98b23 --- /dev/null +++ b/docs/reference/plot.nafta.html @@ -0,0 +1,190 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>Plot the results of the three models used in the NAFTA scheme — plot.nafta • mkin</title> + +<!-- jquery --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" /> +<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" /> + +<!-- clipboard.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script> + +<!-- sticky kit --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script> + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../pkgdown.js"></script> + + + +<meta property="og:title" content="Plot the results of the three models used in the NAFTA scheme — plot.nafta" /> + +<meta property="og:description" content="Calls plot.mmkin." /> +<meta name="twitter:card" content="summary" /> + + + +<!-- mathjax --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + + </head> + + <body> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <span class="navbar-brand"> + <a class="navbar-link" href="../index.html">mkin</a> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.48.1</span> + </span> + </div> + + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Functions and data</a> +</li> +<li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> + Articles + + <span class="caret"></span> + </a> + <ul class="dropdown-menu" role="menu"> + <li> + <a href="../articles/mkin.html">Introduction to mkin</a> + </li> + <li> + <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a> + </li> + <li> + <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a> + </li> + <li> + <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> + </li> + <li> + <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a> + </li> + <li> + <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a> + </li> + </ul> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + + </ul> + + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + </header> + +<div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Plot the results of the three models used in the NAFTA scheme</h1> + + <div class="hidden name"><code>plot.nafta.Rd</code></div> + </div> + + <div class="ref-description"> + + <p>Calls <code><a href='plot.mmkin.html'>plot.mmkin</a></code>.</p> + + </div> + + <pre class="usage"># S3 method for nafta +plot(x, legend = FALSE, main = "auto", …)</pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> + <table class="ref-arguments"> + <colgroup><col class="name" /><col class="desc" /></colgroup> + <tr> + <th>x</th> + <td><p>An object of class <code><a href='nafta.html'>nafta</a></code>.</p></td> + </tr> + <tr> + <th>legend</th> + <td><p>Should a legend be added?</p></td> + </tr> + <tr> + <th>main</th> + <td><p>Possibility to override the main title of the plot.</p></td> + </tr> + <tr> + <th>…</th> + <td><p>Further arguments passed to <code><a href='plot.mmkin.html'>plot.mmkin</a></code>.</p></td> + </tr> + </table> + + <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> + + <p>The function is called for its side effect.</p> + + + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + <li><a href="#arguments">Arguments</a></li> + + <li><a href="#value">Value</a></li> + </ul> + + <h2>Author</h2> + <p>Johannes Ranke</p> + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p> +</div> + </footer> + </div> + + + + </body> +</html> + diff --git a/docs/reference/print.nafta.html b/docs/reference/print.nafta.html new file mode 100644 index 00000000..dc9373f7 --- /dev/null +++ b/docs/reference/print.nafta.html @@ -0,0 +1,178 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<title>Print nafta objects — print.nafta • mkin</title> + +<!-- jquery --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" /> +<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" /> + +<!-- clipboard.js --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script> + +<!-- sticky kit --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script> + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../pkgdown.js"></script> + + + +<meta property="og:title" content="Print nafta objects — print.nafta" /> + +<meta property="og:description" content="Print nafta objects." /> +<meta name="twitter:card" content="summary" /> + + + +<!-- mathjax --> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script> +<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script> + +<!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--> + + + </head> + + <body> + <div class="container template-reference-topic"> + <header> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <span class="navbar-brand"> + <a class="navbar-link" href="../index.html">mkin</a> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.48.1</span> + </span> + </div> + + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Functions and data</a> +</li> +<li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> + Articles + + <span class="caret"></span> + </a> + <ul class="dropdown-menu" role="menu"> + <li> + <a href="../articles/mkin.html">Introduction to mkin</a> + </li> + <li> + <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a> + </li> + <li> + <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a> + </li> + <li> + <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> + </li> + <li> + <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a> + </li> + <li> + <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a> + </li> + </ul> +</li> +<li> + <a href="../news/index.html">News</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + + </ul> + + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + </header> + +<div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Print nafta objects</h1> + + <div class="hidden name"><code>print.nafta.Rd</code></div> + </div> + + <div class="ref-description"> + + <p>Print nafta objects.</p> + + </div> + + <pre class="usage"><span class='co'># S3 method for nafta</span> +<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/print'>print</a></span>(<span class='no'>x</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='no'>...</span>)</pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> + <table class="ref-arguments"> + <colgroup><col class="name" /><col class="desc" /></colgroup> + <tr> + <th>x</th> + <td><p>An <code><a href='nafta.html'>nafta</a></code> object.</p></td> + </tr> + <tr> + <th>quiet</th> + <td><p>Should the evaluation text be shown?</p></td> + </tr> + <tr> + <th>…</th> + <td><p>Not used.</p></td> + </tr> + </table> + + + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + <li><a href="#arguments">Arguments</a></li> + </ul> + + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p> +</div> + </footer> + </div> + + + + </body> +</html> + diff --git a/docs/reference/summary.mkinfit.html b/docs/reference/summary.mkinfit.html index 1543c328..39ef962c 100644 --- a/docs/reference/summary.mkinfit.html +++ b/docs/reference/summary.mkinfit.html @@ -208,15 +208,15 @@ <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <pre class="examples"><div class='input'> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/summary'>summary</a></span>(<span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='fu'><a href='mkinmod.html'>mkinmod</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>)), <span class='no'>FOCUS_2006_A</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>))</div><div class='output co'>#> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Fri Feb 22 09:51:06 2019 -#> Date of summary: Fri Feb 22 09:51:06 2019 +#> Date of fit: Fri Feb 22 20:48:16 2019 +#> Date of summary: Fri Feb 22 20:48:16 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.086 s +#> Fitted with method Port using 35 model solutions performed in 0.088 s #> #> Weighting: none #> diff --git a/docs/reference/transform_odeparms.html b/docs/reference/transform_odeparms.html index 65a6b4ee..9d18fbb2 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 <span class='no'>fit</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/summary'>summary</a></span>(<span class='no'>fit</span>, <span class='kw'>data</span><span class='kw'>=</span><span class='fl'>FALSE</span>) <span class='co'># See transformed and backtransformed parameters</span></div><div class='output co'>#> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Fri Feb 22 09:51:14 2019 -#> Date of summary: Fri Feb 22 09:51:14 2019 +#> Date of fit: Fri Feb 22 20:48:24 2019 +#> Date of summary: Fri Feb 22 20:48:24 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.775 s +#> Fitted with method Port using 153 model solutions performed in 0.717 s #> #> Weighting: none #> @@ -278,8 +278,8 @@ The transformation of sets of formation fractions is fragile, as it supposes </div><div class='input'><span class='no'>fit.2</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>transform_rates</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/summary'>summary</a></span>(<span class='no'>fit.2</span>, <span class='kw'>data</span><span class='kw'>=</span><span class='fl'>FALSE</span>)</div><div class='output co'>#> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Fri Feb 22 09:51:16 2019 -#> Date of summary: Fri Feb 22 09:51:16 2019 +#> Date of fit: Fri Feb 22 20:48:26 2019 +#> Date of summary: Fri Feb 22 20:48:26 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.584 s +#> Fitted with method Port using 350 model solutions performed in 1.661 s #> #> Weighting: none #> @@ -366,8 +366,8 @@ The transformation of sets of formation fractions is fragile, as it supposes <span class='no'>fit.ff</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO.ff</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/summary'>summary</a></span>(<span class='no'>fit.ff</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</div><div class='output co'>#> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Fri Feb 22 09:51:17 2019 -#> Date of summary: Fri Feb 22 09:51:17 2019 +#> Date of fit: Fri Feb 22 20:48:27 2019 +#> Date of summary: Fri Feb 22 20:48:27 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.858 s +#> Fitted with method Port using 186 model solutions performed in 0.871 s #> #> Weighting: none #> @@ -450,8 +450,8 @@ The transformation of sets of formation fractions is fragile, as it supposes <span class='no'>fit.ff.2</span> <span class='kw'><-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO.ff.2</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>) <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/summary'>summary</a></span>(<span class='no'>fit.ff.2</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</div><div class='output co'>#> mkin version used for fitting: 0.9.48.1 #> R version used for fitting: 3.5.2 -#> Date of fit: Fri Feb 22 09:51:18 2019 -#> Date of summary: Fri Feb 22 09:51:18 2019 +#> Date of fit: Fri Feb 22 20:48:28 2019 +#> Date of summary: Fri Feb 22 20:48:28 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.47 s +#> Fitted with method Port using 104 model solutions performed in 0.484 s #> #> Weighting: none #> diff --git a/man/NAFTA_2015_datasets.Rd b/man/NAFTA_2015_datasets.Rd new file mode 100644 index 00000000..4ca494ee --- /dev/null +++ b/man/NAFTA_2015_datasets.Rd @@ -0,0 +1,35 @@ +\name{NAFTA_2015_datasets} +\alias{MRID_555555} +\docType{data} +\title{ +Example datasets from the NAFTA guidance published 2015 +} +\description{ +Data taken from US EPA (2015), p. 23. +} +\usage{NAFTA_2015_datasets} +\format{ + 1 dataset with observations on the following variables. + \describe{ + \item{\code{name}}{a factor containing the name of the observed variable} + \item{\code{time}}{a numeric vector containing time points} + \item{\code{value}}{a numeric vector containing concentrations} + } +} +\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_evaluation <- nafta(MRID_555555) + print(nafta_evaluation) + plot(nafta_evaluation) +} +\keyword{datasets} diff --git a/man/nafta.Rd b/man/nafta.Rd new file mode 100644 index 00000000..cd06e02b --- /dev/null +++ b/man/nafta.Rd @@ -0,0 +1,48 @@ +\name{nafta} +\alias{nafta} +\title{ +Evaluate parent kinetics using the NAFTA guidance +} +\usage{ +nafta(ds, title = NA, quiet = FALSE) +} +\description{ + The function fits the SFO, IORE and DFOP models using + \code{\link{mmkin}} and returns an object of class + \code{nafta} that has methods for printing and plotting. +} +\arguments{ + \item{ds}{ + A dataframe that must contain one variable called "time" with the time + values specified by the \code{time} argument, one column called "name" with + the grouping of the observed values, and finally one column of observed + values called "value". + } + \item{title}{ Optional title of the dataset } + \item{quiet}{ Should the evaluation text be shown? } +} +\value{ + An list of class \code{nafta}. The list element named "mmkin" is the + \code{\link{mmkin}} object containing the fits of the three models. + The list element named "title" contains the title of the dataset used. + The list element "data" contains the dataset used in the fits. +} +\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_evaluation <- nafta(MRID_555555) + print(nafta_evaluation) + plot(nafta_evaluation) +} +\author{ + Johannes Ranke +} diff --git a/man/plot.nafta.Rd b/man/plot.nafta.Rd new file mode 100644 index 00000000..a3dfdbae --- /dev/null +++ b/man/plot.nafta.Rd @@ -0,0 +1,31 @@ +\name{plot.nafta} +\alias{plot.nafta} +\title{ + Plot the results of the three models used in the NAFTA scheme +} +\description{ + Calls \code{\link{plot.mmkin}}. +} +\usage{ +\method{plot}{nafta}(x, legend = FALSE, main = "auto", \dots) +} +\arguments{ + \item{x}{ + An object of class \code{\link{nafta}}. + } + \item{legend}{ + Should a legend be added? + } + \item{main}{ + Possibility to override the main title of the plot. + } + \item{\dots}{ + Further arguments passed to \code{\link{plot.mmkin}}. + } +} +\value{ + The function is called for its side effect. +} +\author{ + Johannes Ranke +} diff --git a/man/print.nafta.Rd b/man/print.nafta.Rd new file mode 100644 index 00000000..4ae4c8b2 --- /dev/null +++ b/man/print.nafta.Rd @@ -0,0 +1,22 @@ +\name{print.nafta} +\alias{print.nafta} +\title{ + Print nafta objects +} +\description{ + Print nafta objects. +} +\usage{ + \method{print}{nafta}(x, quiet = TRUE, ...) +} +\arguments{ + \item{x}{ + An \code{\link{nafta}} object. + } + \item{quiet}{ + Should the evaluation text be shown? + } + \item{\dots}{ + Not used. + } +} diff --git a/tests/testthat/test_nafta.R b/tests/testthat/test_nafta.R new file mode 100644 index 00000000..7d650ad8 --- /dev/null +++ b/tests/testthat/test_nafta.R @@ -0,0 +1,41 @@ +# Copyright (C) 2019 Johannes Ranke +# Contact: jranke@uni-bremen.de + +# This file is part of the R package mkin + +# mkin is free software: you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. + +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. + +# You should have received a copy of the GNU General Public License along with +# this program. If not, see <http://www.gnu.org/licenses/> + +library(testthat) +library(mkin) + +context("Evaluations according to the NAFTA guidance from 2015") + +test_that("Data for more than one compound are rejected", + expect_error(nafta(FOCUS_2006_D))) + +test_that("Test data from Appendix D are correctly evaluated", { + expect_message(res <- nafta(MRID_555555, "MRID 555555")) + + # From Figure D.1 + dtx_sop <- matrix(c(407, 541, 429, 1352, 5192066, 2383), nrow = 3, ncol = 2) + expect_equivalent(res$distimes[, 1:2], dtx_sop, tolerance = 1, + scale = 1) + C0_sop <- c(SFO = 83.8, IORE = 96.9, DFOP = 97.6) + C0_mkin <- sapply(res$parameters, function(x) x["parent_0", "Estimate"]) + expect_equivalent(C0_mkin, C0_sop, scale = 1, tolerance = 0.1) + + expect_equal(round(res$S_c), 717) + expect_equal(signif(res$S[["SFO"]], 3), 1.38e+3) + expect_equal(round(res$t_rep), 841) +}) |