From d0a358a8f4fd03c95536409523e492eb15726f44 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 4 Mar 2019 10:12:43 +0100 Subject: Review tests and examples based on winbuilder results Static documentation rebuilt by pkgdown --- docs/articles/FOCUS_D.html | 24 +- docs/articles/FOCUS_L.html | 154 ++++---- docs/articles/mkin.html | 66 ++-- docs/articles/twa.html | 2 +- docs/articles/web_only/FOCUS_Z.html | 174 ++++----- docs/articles/web_only/NAFTA_examples.html | 533 +++++++++++++++------------- docs/articles/web_only/compiled_models.html | 86 ++--- 7 files changed, 539 insertions(+), 500 deletions(-) (limited to 'docs/articles') diff --git a/docs/articles/FOCUS_D.html b/docs/articles/FOCUS_D.html index e01fd46d..fabb567a 100644 --- a/docs/articles/FOCUS_D.html +++ b/docs/articles/FOCUS_D.html @@ -88,7 +88,7 @@

Example evaluation of FOCUS Example Dataset D

Johannes Ranke

-

2019-02-26

+

2019-03-04

@@ -98,8 +98,8 @@

This is just a very simple vignette showing how to fit a degradation model for a parent compound with one transformation product using mkin. After loading the library we look at the data. We have observed concentrations in the column named value at the times specified in column time for the two observed variables named parent and m1.

-
library(mkin, quietly = TRUE)
-print(FOCUS_2006_D)
+
library(mkin, quietly = TRUE)
+print(FOCUS_2006_D)
##      name time  value
 ## 1  parent    0  99.46
 ## 2  parent    0 102.04
@@ -147,27 +147,27 @@
 ## 44     m1  120  33.31

Next we specify the degradation model: The parent compound degrades with simple first-order kinetics (SFO) to one metabolite named m1, which also degrades with SFO kinetics.

The call to mkinmod returns a degradation model. The differential equations represented in R code can be found in the character vector $diffs of the mkinmod object. If a C compiler (gcc) is installed and functional, the differential equation model will be compiled from auto-generated C code.

-
SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"))
+
SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1"), m1 = mkinsub("SFO"))
## Successfully compiled differential equation model from auto-generated C code.
-
print(SFO_SFO$diffs)
+
print(SFO_SFO$diffs)
##                                                       parent 
 ## "d_parent = - k_parent_sink * parent - k_parent_m1 * parent" 
 ##                                                           m1 
 ##             "d_m1 = + k_parent_m1 * parent - k_m1_sink * m1"

We do the fitting without progress report (quiet = TRUE).

-
fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE)
+
fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE)

A plot of the fit including a residual plot for both observed variables is obtained using the plot_sep method for mkinfit objects, which shows separate graphs for all compounds and their residuals.

-
plot_sep(fit, lpos = c("topright", "bottomright"))
+
plot_sep(fit, lpos = c("topright", "bottomright"))

Confidence intervals for the parameter estimates are obtained using the mkinparplot function.

-
mkinparplot(fit)
+
mkinparplot(fit)

A comprehensive report of the results is obtained using the summary method for mkinfit objects.

-
summary(fit)
+
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 21:09:15 2019 
-## Date of summary: Tue Feb 26 21:09:15 2019 
+## Date of fit:     Mon Mar  4 10:09:33 2019 
+## Date of summary: Mon Mar  4 10:09:33 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent
@@ -175,7 +175,7 @@
 ## 
 ## Model predictions using solution type deSolve 
 ## 
-## Fitted with method Port using 153 model solutions performed in 0.712 s
+## Fitted with method Port using 153 model solutions performed in 0.687 s
 ## 
 ## Weighting: none
 ## 
diff --git a/docs/articles/FOCUS_L.html b/docs/articles/FOCUS_L.html
index aeded526..7157f973 100644
--- a/docs/articles/FOCUS_L.html
+++ b/docs/articles/FOCUS_L.html
@@ -88,7 +88,7 @@
       

Example evaluation of FOCUS Laboratory Data L1 to L3

Johannes Ranke

-

2019-02-26

+

2019-03-04

@@ -101,28 +101,28 @@

Laboratory Data L1

The following code defines example dataset L1 from the FOCUS kinetics report, p. 284:

-
library("mkin", quietly = TRUE)
-FOCUS_2006_L1 = data.frame(
-  t = rep(c(0, 1, 2, 3, 5, 7, 14, 21, 30), each = 2),
-  parent = c(88.3, 91.4, 85.6, 84.5, 78.9, 77.6,
-             72.0, 71.9, 50.3, 59.4, 47.0, 45.1,
-             27.7, 27.3, 10.0, 10.4, 2.9, 4.0))
-FOCUS_2006_L1_mkin <- mkin_wide_to_long(FOCUS_2006_L1)
+
library("mkin", quietly = TRUE)
+FOCUS_2006_L1 = data.frame(
+  t = rep(c(0, 1, 2, 3, 5, 7, 14, 21, 30), each = 2),
+  parent = c(88.3, 91.4, 85.6, 84.5, 78.9, 77.6,
+             72.0, 71.9, 50.3, 59.4, 47.0, 45.1,
+             27.7, 27.3, 10.0, 10.4, 2.9, 4.0))
+FOCUS_2006_L1_mkin <- mkin_wide_to_long(FOCUS_2006_L1)

Here we use the assumptions of simple first order (SFO), the case of declining rate constant over time (FOMC) and the case of two different phases of the kinetics (DFOP). For a more detailed discussion of the models, please see the FOCUS kinetics report.

Since mkin version 0.9-32 (July 2014), we can use shorthand notation like "SFO" for parent only degradation models. The following two lines fit the model and produce the summary report of the model fit. This covers the numerical analysis given in the FOCUS report.

-
m.L1.SFO <- mkinfit("SFO", FOCUS_2006_L1_mkin, quiet = TRUE)
-summary(m.L1.SFO)
+
m.L1.SFO <- mkinfit("SFO", FOCUS_2006_L1_mkin, quiet = TRUE)
+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 21:09:17 2019 
-## Date of summary: Tue Feb 26 21:09:17 2019 
+## Date of fit:     Mon Mar  4 10:09:35 2019 
+## Date of summary: Mon Mar  4 10:09:35 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.096 s
+## Fitted with method Port using 37 model solutions performed in 0.102 s
 ## 
 ## Weighting: none
 ## 
@@ -193,27 +193,27 @@
 ##    30   parent      2.9     5.251  -2.3513
 ##    30   parent      4.0     5.251  -1.2513

A plot of the fit is obtained with the plot function for mkinfit objects.

-
plot(m.L1.SFO, show_errmin = TRUE, main = "FOCUS L1 - SFO")
+
plot(m.L1.SFO, show_errmin = TRUE, main = "FOCUS L1 - SFO")

The residual plot can be easily obtained by

-
mkinresplot(m.L1.SFO, ylab = "Observed", xlab = "Time")
+
mkinresplot(m.L1.SFO, ylab = "Observed", xlab = "Time")

For comparison, the FOMC model is fitted as well, and the \(\chi^2\) error level is checked.

-
m.L1.FOMC <- mkinfit("FOMC", FOCUS_2006_L1_mkin, quiet=TRUE)
-plot(m.L1.FOMC, show_errmin = TRUE, main = "FOCUS L1 - FOMC")
+
m.L1.FOMC <- mkinfit("FOMC", FOCUS_2006_L1_mkin, quiet=TRUE)
+plot(m.L1.FOMC, show_errmin = TRUE, main = "FOCUS L1 - FOMC")

-
summary(m.L1.FOMC, data = FALSE)
+
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 21:09:19 2019 
-## Date of summary: Tue Feb 26 21:09:19 2019 
+## Date of fit:     Mon Mar  4 10:09:36 2019 
+## Date of summary: Mon Mar  4 10:09:36 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.539 s
+## Fitted with method Port using 611 model solutions performed in 1.508 s
 ## 
 ## Weighting: none
 ## 
@@ -271,19 +271,19 @@
 

Laboratory Data L2

The following code defines example dataset L2 from the FOCUS kinetics report, p. 287:

- +

SFO fit for L2

Again, the SFO model is fitted and the result is plotted. The residual plot can be obtained simply by adding the argument show_residuals to the plot command.

-
m.L2.SFO <- mkinfit("SFO", FOCUS_2006_L2_mkin, quiet=TRUE)
-plot(m.L2.SFO, show_residuals = TRUE, show_errmin = TRUE,
-     main = "FOCUS L2 - SFO")
+
m.L2.SFO <- mkinfit("SFO", FOCUS_2006_L2_mkin, quiet=TRUE)
+plot(m.L2.SFO, show_residuals = TRUE, show_errmin = TRUE,
+     main = "FOCUS L2 - SFO")

The \(\chi^2\) error level of 14% suggests that the model does not fit very well. This is also obvious from the plots of the fit, in which we have included the residual plot.

In the FOCUS kinetics report, it is stated that there is no apparent systematic error observed from the residual plot up to the measured DT90 (approximately at day 5), and there is an underestimation beyond that point.

@@ -293,22 +293,22 @@

FOMC fit for L2

For comparison, the FOMC model is fitted as well, and the \(\chi^2\) error level is checked.

-
m.L2.FOMC <- mkinfit("FOMC", FOCUS_2006_L2_mkin, quiet = TRUE)
-plot(m.L2.FOMC, show_residuals = TRUE,
-     main = "FOCUS L2 - FOMC")
+
m.L2.FOMC <- mkinfit("FOMC", FOCUS_2006_L2_mkin, quiet = TRUE)
+plot(m.L2.FOMC, show_residuals = TRUE,
+     main = "FOCUS L2 - FOMC")

-
summary(m.L2.FOMC, data = FALSE)
+
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 21:09:19 2019 
-## Date of summary: Tue Feb 26 21:09:19 2019 
+## Date of fit:     Mon Mar  4 10:09:37 2019 
+## Date of summary: Mon Mar  4 10:09:37 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.199 s
+## Fitted with method Port using 81 model solutions performed in 0.196 s
 ## 
 ## Weighting: none
 ## 
@@ -364,15 +364,17 @@
 

DFOP fit for L2

Fitting the four parameter DFOP model further reduces the \(\chi^2\) error level.

-
m.L2.DFOP <- mkinfit("DFOP", FOCUS_2006_L2_mkin, quiet = TRUE)
-plot(m.L2.DFOP, show_residuals = TRUE, show_errmin = TRUE,
-     main = "FOCUS L2 - DFOP")
+
m.L2.DFOP <- mkinfit("DFOP", FOCUS_2006_L2_mkin, quiet = TRUE)
+plot(m.L2.DFOP, show_residuals = TRUE, show_errmin = TRUE,
+     main = "FOCUS L2 - DFOP")

-
summary(m.L2.DFOP, data = FALSE)
+
summary(m.L2.DFOP, data = FALSE)
+
## Warning in summary.mkinfit(m.L2.DFOP, data = FALSE): Could not estimate
+## covariance matrix; singular system.
## mkin version used for fitting:    0.9.48.1 
 ## R version used for fitting:       3.5.2 
-## Date of fit:     Tue Feb 26 21:09:20 2019 
-## Date of summary: Tue Feb 26 21:09:20 2019 
+## Date of fit:     Mon Mar  4 10:09:38 2019 
+## Date of summary: Mon Mar  4 10:09:38 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -381,7 +383,7 @@
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 336 model solutions performed in 0.844 s
+## Fitted with method Port using 336 model solutions performed in 0.841 s
 ## 
 ## Weighting: none
 ## 
@@ -409,10 +411,8 @@
 ## log_k2    -1.0880         NA    NA    NA
 ## g_ilr     -0.2821         NA    NA    NA
 ## 
-## Parameter correlation:
-
## Warning in print.summary.mkinfit(x): Could not estimate covariance matrix; singular system:
-
## Could not estimate covariance matrix; singular system:
-## 
+## Parameter correlation:
+## Could not estimate covariance matrix; singular system.
 ## Residual standard error: 1.732 on 8 degrees of freedom
 ## 
 ## Backtransformed parameters:
@@ -440,18 +440,18 @@
 

Laboratory Data L3

The following code defines example dataset L3 from the FOCUS kinetics report, p. 290.

-
FOCUS_2006_L3 = data.frame(
-  t = c(0, 3, 7, 14, 30, 60, 91, 120),
-  parent = c(97.8, 60, 51, 43, 35, 22, 15, 12))
-FOCUS_2006_L3_mkin <- mkin_wide_to_long(FOCUS_2006_L3)
+
FOCUS_2006_L3 = data.frame(
+  t = c(0, 3, 7, 14, 30, 60, 91, 120),
+  parent = c(97.8, 60, 51, 43, 35, 22, 15, 12))
+FOCUS_2006_L3_mkin <- mkin_wide_to_long(FOCUS_2006_L3)

Fit multiple models

As of mkin version 0.9-39 (June 2015), we can fit several models to one or more datasets in one call to the function mmkin. The datasets have to be passed in a list, in this case a named list holding only the L3 dataset prepared above.

-
# Only use one core here, not to offend the CRAN checks
-mm.L3 <- mmkin(c("SFO", "FOMC", "DFOP"), cores = 1,
-               list("FOCUS L3" = FOCUS_2006_L3_mkin), quiet = TRUE)
-plot(mm.L3)
+
# Only use one core here, not to offend the CRAN checks
+mm.L3 <- mmkin(c("SFO", "FOMC", "DFOP"), cores = 1,
+               list("FOCUS L3" = FOCUS_2006_L3_mkin), quiet = TRUE)
+plot(mm.L3)

The \(\chi^2\) error level of 21% as well as the plot suggest that the SFO model does not fit very well. The FOMC model performs better, with an error level at which the \(\chi^2\) test passes of 7%. Fitting the four parameter DFOP model further reduces the \(\chi^2\) error level considerably.

@@ -460,11 +460,11 @@ Accessing mmkin objects

The objects returned by mmkin are arranged like a matrix, with models as a row index and datasets as a column index.

We can extract the summary and plot for e.g. the DFOP fit, using square brackets for indexing which will result in the use of the summary and plot functions working on mkinfit objects.

-
summary(mm.L3[["DFOP", 1]])
+
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 21:09:21 2019 
-## Date of summary: Tue Feb 26 21:09:22 2019 
+## Date of fit:     Mon Mar  4 10:09:39 2019 
+## Date of summary: Mon Mar  4 10:09:39 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -473,7 +473,7 @@
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 137 model solutions performed in 0.344 s
+## Fitted with method Port using 137 model solutions performed in 0.343 s
 ## 
 ## Weighting: none
 ## 
@@ -539,7 +539,7 @@
 ##    60   parent     22.0     23.26 -1.25919
 ##    91   parent     15.0     15.18 -0.18181
 ##   120   parent     12.0     10.19  1.81395
-
plot(mm.L3[["DFOP", 1]], show_errmin = TRUE)
+
plot(mm.L3[["DFOP", 1]], show_errmin = TRUE)

Here, a look to the model plot, the confidence intervals of the parameters and the correlation matrix suggest that the parameter estimates are reliable, and the DFOP model can be used as the best-fit model based on the \(\chi^2\) error level criterion for laboratory data L3.

This is also an example where the standard t-test for the parameter g_ilr is misleading, as it tests for a significant difference from zero. In this case, zero appears to be the correct value for this parameter, and the confidence interval for the backtransformed parameter g is quite narrow.

@@ -549,23 +549,23 @@

Laboratory Data L4

The following code defines example dataset L4 from the FOCUS kinetics report, p. 293:

-
FOCUS_2006_L4 = data.frame(
-  t = c(0, 3, 7, 14, 30, 60, 91, 120),
-  parent = c(96.6, 96.3, 94.3, 88.8, 74.9, 59.9, 53.5, 49.0))
-FOCUS_2006_L4_mkin <- mkin_wide_to_long(FOCUS_2006_L4)
+
FOCUS_2006_L4 = data.frame(
+  t = c(0, 3, 7, 14, 30, 60, 91, 120),
+  parent = c(96.6, 96.3, 94.3, 88.8, 74.9, 59.9, 53.5, 49.0))
+FOCUS_2006_L4_mkin <- mkin_wide_to_long(FOCUS_2006_L4)

Fits of the SFO and FOMC models, plots and summaries are produced below:

-
# Only use one core here, not to offend the CRAN checks
-mm.L4 <- mmkin(c("SFO", "FOMC"), cores = 1,
-               list("FOCUS L4" = FOCUS_2006_L4_mkin),
-               quiet = TRUE)
-plot(mm.L4)
+
# Only use one core here, not to offend the CRAN checks
+mm.L4 <- mmkin(c("SFO", "FOMC"), cores = 1,
+               list("FOCUS L4" = FOCUS_2006_L4_mkin),
+               quiet = TRUE)
+plot(mm.L4)

The \(\chi^2\) error level of 3.3% as well as the plot suggest that the SFO model fits very well. The error level at which the \(\chi^2\) test passes is slightly lower for the FOMC model. However, the difference appears negligible.

-
summary(mm.L4[["SFO", 1]], data = FALSE)
+
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 21:09:22 2019 
-## Date of summary: Tue Feb 26 21:09:22 2019 
+## Date of fit:     Mon Mar  4 10:09:40 2019 
+## Date of summary: Mon Mar  4 10:09:40 2019 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent
@@ -621,18 +621,18 @@
 ## Estimated disappearance times:
 ##        DT50 DT90
 ## parent  106  352
-
summary(mm.L4[["FOMC", 1]], data = FALSE)
+
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 21:09:22 2019 
-## Date of summary: Tue Feb 26 21:09:22 2019 
+## Date of fit:     Mon Mar  4 10:09:40 2019 
+## Date of summary: Mon Mar  4 10:09:40 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.163 s
+## Fitted with method Port using 66 model solutions performed in 0.162 s
 ## 
 ## Weighting: none
 ## 
diff --git a/docs/articles/mkin.html b/docs/articles/mkin.html
index d5d5e3bf..93ad4b56 100644
--- a/docs/articles/mkin.html
+++ b/docs/articles/mkin.html
@@ -88,7 +88,7 @@
       

Introduction to mkin

Johannes Ranke

-

2019-02-26

+

2019-03-04

@@ -102,41 +102,41 @@

Abstract

In the regulatory evaluation of chemical substances like plant protection products (pesticides), biocides and other chemicals, degradation data play an important role. For the evaluation of pesticide degradation experiments, detailed guidance has been developed, based on nonlinear optimisation. The R add-on package mkin (Ranke 2016) implements fitting some of the models recommended in this guidance from within R and calculates some statistical measures for data series within one or more compartments, for parent and metabolites.

- +

Background

Many approaches are possible regarding the evaluation of chemical degradation data.

-

The now deprecated kinfit package (Ranke 2015) in R (R Development Core Team 2016) implements the approach recommended in the kinetics report provided by the FOrum for Co-ordination of pesticide fate models and their USe (FOCUS Work Group on Degradation Kinetics 2006; 2014) for simple data series for one parent compound in one compartment.

+

The now deprecated kinfit package (Ranke 2015) in R (R Development Core Team 2016) implements the approach recommended in the kinetics report provided by the FOrum for Co-ordination of pesticide fate models and their USe (FOCUS Work Group on Degradation Kinetics 2006, 2014) for simple data series for one parent compound in one compartment.

The mkin package (Ranke 2016) extends this approach to data series with transformation products, commonly termed metabolites, and to more than one compartment. It is also possible to include back reactions, so equilibrium reactions and equilibrium partitioning can be specified, although this oftentimes leads to an overparameterisation of the model.

When the first mkin code was published in 2010, the most commonly used tools for fitting more complex kinetic degradation models to experimental data were KinGUI (Schäfer et al. 2007), a MATLAB based tool with a graphical user interface that was specifically tailored to the task and included some output as proposed by the FOCUS Kinetics Workgroup, and ModelMaker, a general purpose compartment based tool providing infrastructure for fitting dynamic simulation models based on differential equations to data.

The code was first uploaded to the BerliOS platform. When this was taken down, the version control history was imported into the R-Forge site, where the code is still mirrored today (see e.g. the initial commit on 11 May 2010).

@@ -194,9 +194,6 @@

———. 2014. Generic Guidance for Estimating Persistence and Degradation Kinetics from Environmental Fate Studies on Pesticides in Eu Registration. 1.1 ed. http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics.

-
-

R Development Core Team. 2016. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org.

-

Ranke, J. 2015. ‘Kinfit‘: Routines for Fitting Simple Kinetic Models to Chemical Degradation Data. https://CRAN.R-project.org/package=kinfit.

@@ -209,6 +206,9 @@

———. 2015. “To T-Test or Not to T-Test, That Is the Question.” In XV Symposium on Pesticide Chemistry 2-4 September 2015. Piacenza. http://chem.uft.uni-bremen.de/ranke/posters/piacenza_2015.pdf.

+
+

R Development Core Team. 2016. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org.

+

Schäfer, D., B. Mikolasch, P. Rainbird, and B. Harvey. 2007. “KinGUI: A New Kinetic Software Tool for Evaluations According to FOCUS Degradation Kinetics.” In Proceedings of the Xiii Symposium Pesticide Chemistry, edited by Del Re A. A. M., Capri E., Fragoulis G., and Trevisan M., 916–23. Piacenza.

diff --git a/docs/articles/twa.html b/docs/articles/twa.html index af8dbd4e..f58814e3 100644 --- a/docs/articles/twa.html +++ b/docs/articles/twa.html @@ -88,7 +88,7 @@

Calculation of time weighted average concentrations with mkin

Johannes Ranke

-

2019-02-26

+

2019-03-04

diff --git a/docs/articles/web_only/FOCUS_Z.html b/docs/articles/web_only/FOCUS_Z.html index 1926662a..79e39e55 100644 --- a/docs/articles/web_only/FOCUS_Z.html +++ b/docs/articles/web_only/FOCUS_Z.html @@ -88,7 +88,7 @@

Example evaluation of FOCUS dataset Z

Johannes Ranke

-

2019-02-26

+

2019-03-04

@@ -102,33 +102,35 @@

The data

The following code defines the example dataset from Appendix 7 to the FOCUS kinetics report (FOCUS Work Group on Degradation Kinetics 2014, 354).

-
library(mkin, quietly = TRUE)
-LOD = 0.5
-FOCUS_2006_Z = data.frame(
-  t = c(0, 0.04, 0.125, 0.29, 0.54, 1, 2, 3, 4, 7, 10, 14, 21,
-        42, 61, 96, 124),
-  Z0 = c(100, 81.7, 70.4, 51.1, 41.2, 6.6, 4.6, 3.9, 4.6, 4.3, 6.8,
-         2.9, 3.5, 5.3, 4.4, 1.2, 0.7),
-  Z1 = c(0, 18.3, 29.6, 46.3, 55.1, 65.7, 39.1, 36, 15.3, 5.6, 1.1,
-         1.6, 0.6, 0.5 * LOD, NA, NA, NA),
-  Z2 = c(0, NA, 0.5 * LOD, 2.6, 3.8, 15.3, 37.2, 31.7, 35.6, 14.5,
-         0.8, 2.1, 1.9, 0.5 * LOD, NA, NA, NA),
-  Z3 = c(0, NA, NA, NA, NA, 0.5 * LOD, 9.2, 13.1, 22.3, 28.4, 32.5,
-         25.2, 17.2, 4.8, 4.5, 2.8, 4.4))
-
-FOCUS_2006_Z_mkin <- mkin_wide_to_long(FOCUS_2006_Z)
+
library(mkin, quietly = TRUE)
+LOD = 0.5
+FOCUS_2006_Z = data.frame(
+  t = c(0, 0.04, 0.125, 0.29, 0.54, 1, 2, 3, 4, 7, 10, 14, 21,
+        42, 61, 96, 124),
+  Z0 = c(100, 81.7, 70.4, 51.1, 41.2, 6.6, 4.6, 3.9, 4.6, 4.3, 6.8,
+         2.9, 3.5, 5.3, 4.4, 1.2, 0.7),
+  Z1 = c(0, 18.3, 29.6, 46.3, 55.1, 65.7, 39.1, 36, 15.3, 5.6, 1.1,
+         1.6, 0.6, 0.5 * LOD, NA, NA, NA),
+  Z2 = c(0, NA, 0.5 * LOD, 2.6, 3.8, 15.3, 37.2, 31.7, 35.6, 14.5,
+         0.8, 2.1, 1.9, 0.5 * LOD, NA, NA, NA),
+  Z3 = c(0, NA, NA, NA, NA, 0.5 * LOD, 9.2, 13.1, 22.3, 28.4, 32.5,
+         25.2, 17.2, 4.8, 4.5, 2.8, 4.4))
+
+FOCUS_2006_Z_mkin <- mkin_wide_to_long(FOCUS_2006_Z)

Parent and one metabolite

The next step is to set up the models used for the kinetic analysis. As the simultaneous fit of parent and the first metabolite is usually straightforward, Step 1 (SFO for parent only) is skipped here. We start with the model 2a, with formation and decline of metabolite Z1 and the pathway from parent directly to sink included (default in mkin).

-
Z.2a <- mkinmod(Z0 = mkinsub("SFO", "Z1"),
-                Z1 = mkinsub("SFO"))
+
Z.2a <- mkinmod(Z0 = mkinsub("SFO", "Z1"),
+                Z1 = mkinsub("SFO"))
## Successfully compiled differential equation model from auto-generated C code.
-
m.Z.2a <- mkinfit(Z.2a, FOCUS_2006_Z_mkin, quiet = TRUE)
-plot_sep(m.Z.2a)
+
m.Z.2a <- mkinfit(Z.2a, FOCUS_2006_Z_mkin, quiet = TRUE)
+plot_sep(m.Z.2a)

-
summary(m.Z.2a, data = FALSE)$bpar
+
summary(m.Z.2a, data = FALSE)$bpar
+
## Warning in summary.mkinfit(m.Z.2a, data = FALSE): Could not estimate
+## covariance matrix; singular system.
##             Estimate se_notrans    t value     Pr(>t) Lower Upper
 ## Z0_0      9.7015e+01   3.553140 2.7304e+01 1.6793e-21    NA    NA
 ## k_Z0_sink 1.2790e-11   0.226895 5.6368e-11 5.0000e-01    NA    NA
@@ -136,14 +138,16 @@
 ## k_Z1_sink 4.8212e-01   0.065854 7.3212e+00 3.5520e-08    NA    NA

As obvious from the parameter summary (the component of the summary), the kinetic rate constant from parent compound Z to sink is very small and the t-test for this parameter suggests that it is not significantly different from zero. This suggests, in agreement with the analysis in the FOCUS kinetics report, to simplify the model by removing the pathway to sink.

A similar result can be obtained when formation fractions are used in the model formulation:

- +
## Successfully compiled differential equation model from auto-generated C code.
-
m.Z.2a.ff <- mkinfit(Z.2a.ff, FOCUS_2006_Z_mkin, quiet = TRUE)
-plot_sep(m.Z.2a.ff)
+
m.Z.2a.ff <- mkinfit(Z.2a.ff, FOCUS_2006_Z_mkin, quiet = TRUE)
+plot_sep(m.Z.2a.ff)

-
summary(m.Z.2a.ff, data = FALSE)$bpar
+
summary(m.Z.2a.ff, data = FALSE)$bpar
+
## Warning in summary.mkinfit(m.Z.2a.ff, data = FALSE): Could not estimate
+## covariance matrix; singular system.
##            Estimate se_notrans t value     Pr(>t) Lower Upper
 ## Z0_0       97.01488   3.553145 27.3039 1.6793e-21    NA    NA
 ## k_Z0        2.23601   0.216849 10.3114 3.6623e-11    NA    NA
@@ -152,13 +156,13 @@
 

Here, the ilr transformed formation fraction fitted in the model takes a very large value, and the backtransformed formation fraction from parent Z to Z1 is practically unity. Here, the covariance matrix used for the calculation of confidence intervals is not returned as the model is overparameterised.

A simplified model is obtained by removing the pathway to the sink.

In the following, we use the parameterisation with formation fractions in order to be able to compare with the results in the FOCUS guidance, and as it makes it easier to use parameters obtained in a previous fit when adding a further metabolite.

-
Z.3 <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
-               Z1 = mkinsub("SFO"), use_of_ff = "max")
+
Z.3 <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
+               Z1 = mkinsub("SFO"), use_of_ff = "max")
## Successfully compiled differential equation model from auto-generated C code.
-
m.Z.3 <- mkinfit(Z.3, FOCUS_2006_Z_mkin, quiet = TRUE)
-plot_sep(m.Z.3)
+
m.Z.3 <- mkinfit(Z.3, FOCUS_2006_Z_mkin, quiet = TRUE)
+plot_sep(m.Z.3)

-
summary(m.Z.3, data = FALSE)$bpar
+
summary(m.Z.3, data = FALSE)$bpar
##      Estimate se_notrans t value     Pr(>t)    Lower   Upper
 ## Z0_0 97.01488   2.681772  36.176 2.3636e-25 91.52152 102.508
 ## k_Z0  2.23601   0.146861  15.225 2.2464e-15  1.95453   2.558
@@ -169,28 +173,28 @@
 

Metabolites Z2 and Z3

As suggested in the FOCUS report, the pathway to sink was removed for metabolite Z1 as well in the next step. While this step appears questionable on the basis of the above results, it is followed here for the purpose of comparison. Also, in the FOCUS report, it is assumed that there is additional empirical evidence that Z1 quickly and exclusively hydrolyses to Z2.

-
Z.5 <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
-               Z1 = mkinsub("SFO", "Z2", sink = FALSE),
-               Z2 = mkinsub("SFO"), use_of_ff = "max")
+
Z.5 <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
+               Z1 = mkinsub("SFO", "Z2", sink = FALSE),
+               Z2 = mkinsub("SFO"), use_of_ff = "max")
## Successfully compiled differential equation model from auto-generated C code.
-
m.Z.5 <- mkinfit(Z.5, FOCUS_2006_Z_mkin, quiet = TRUE)
-plot_sep(m.Z.5)
+
m.Z.5 <- mkinfit(Z.5, FOCUS_2006_Z_mkin, quiet = TRUE)
+plot_sep(m.Z.5)

Finally, metabolite Z3 is added to the model. We use the optimised differential equation parameter values from the previous fit in order to accelerate the optimization.

-
Z.FOCUS <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
-                   Z1 = mkinsub("SFO", "Z2", sink = FALSE),
-                   Z2 = mkinsub("SFO", "Z3"),
-                   Z3 = mkinsub("SFO"),
-                   use_of_ff = "max")
+
Z.FOCUS <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
+                   Z1 = mkinsub("SFO", "Z2", sink = FALSE),
+                   Z2 = mkinsub("SFO", "Z3"),
+                   Z3 = mkinsub("SFO"),
+                   use_of_ff = "max")
## Successfully compiled differential equation model from auto-generated C code.
- +
## Warning in mkinfit(Z.FOCUS, FOCUS_2006_Z_mkin, parms.ini = m.Z.5$bparms.ode, : Optimisation by method Port did not converge:
 ## false convergence (8)
-
plot_sep(m.Z.FOCUS)
+
plot_sep(m.Z.FOCUS)

-
summary(m.Z.FOCUS, data = FALSE)$bpar
+
summary(m.Z.FOCUS, data = FALSE)$bpar
##             Estimate se_notrans t value     Pr(>t)     Lower      Upper
 ## Z0_0       96.837112   2.058861 47.0343 5.5877e-44 92.703779 100.970445
 ## k_Z0        2.215368   0.118098 18.7587 7.6563e-25  1.990525   2.465609
@@ -198,7 +202,7 @@
 ## k_Z2        0.451617   0.044214 10.2144 3.1133e-14  0.371034   0.549702
 ## k_Z3        0.058693   0.014296  4.1056 7.2924e-05  0.035994   0.095705
 ## f_Z2_to_Z3  0.471516   0.057057  8.2639 2.8156e-11  0.360381   0.585548
-
endpoints(m.Z.FOCUS)
+
endpoints(m.Z.FOCUS)
## $ff
 ##   Z2_Z3 Z2_sink 
 ## 0.47152 0.52848 
@@ -219,61 +223,63 @@
 Using the SFORB model
 

As the FOCUS report states, there is a certain tailing of the time course of metabolite Z3. Also, the time course of the parent compound is not fitted very well using the SFO model, as residues at a certain low level remain.

Therefore, an additional model is offered here, using the single first-order reversible binding (SFORB) model for metabolite Z3. As expected, the \(\chi^2\) error level is lower for metabolite Z3 using this model and the graphical fit for Z3 is improved. However, the covariance matrix is not returned.

-
Z.mkin.1 <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
-                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
-                    Z2 = mkinsub("SFO", "Z3"),
-                    Z3 = mkinsub("SFORB"))
+
Z.mkin.1 <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
+                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
+                    Z2 = mkinsub("SFO", "Z3"),
+                    Z3 = mkinsub("SFORB"))
## Successfully compiled differential equation model from auto-generated C code.
-
m.Z.mkin.1 <- mkinfit(Z.mkin.1, FOCUS_2006_Z_mkin, quiet = TRUE)
-plot_sep(m.Z.mkin.1)
+
m.Z.mkin.1 <- mkinfit(Z.mkin.1, FOCUS_2006_Z_mkin, quiet = TRUE)
+plot_sep(m.Z.mkin.1)

-
summary(m.Z.mkin.1, data = FALSE)$cov.unscaled
+
summary(m.Z.mkin.1, data = FALSE)$cov.unscaled
+
## Warning in summary.mkinfit(m.Z.mkin.1, data = FALSE): Could not estimate
+## covariance matrix; singular system.
## NULL

Therefore, a further stepwise model building is performed starting from the stage of parent and two metabolites, starting from the assumption that the model fit for the parent compound can be improved by using the SFORB model.

-
Z.mkin.3 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
-                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
-                    Z2 = mkinsub("SFO"))
+
Z.mkin.3 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
+                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
+                    Z2 = mkinsub("SFO"))
## Successfully compiled differential equation model from auto-generated C code.
-
m.Z.mkin.3 <- mkinfit(Z.mkin.3, FOCUS_2006_Z_mkin, quiet = TRUE)
-plot_sep(m.Z.mkin.3)
+
m.Z.mkin.3 <- mkinfit(Z.mkin.3, FOCUS_2006_Z_mkin, quiet = TRUE)
+plot_sep(m.Z.mkin.3)

This results in a much better representation of the behaviour of the parent compound Z0.

Finally, Z3 is added as well. These models appear overparameterised (no covariance matrix returned) if the sink for Z1 is left in the models.

-
Z.mkin.4 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
-                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
-                    Z2 = mkinsub("SFO", "Z3"),
-                    Z3 = mkinsub("SFO"))
+
Z.mkin.4 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
+                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
+                    Z2 = mkinsub("SFO", "Z3"),
+                    Z3 = mkinsub("SFO"))
## Successfully compiled differential equation model from auto-generated C code.
- +

The error level of the fit, but especially of metabolite Z3, can be improved if the SFORB model is chosen for this metabolite, as this model is capable of representing the tailing of the metabolite decline phase.

-
Z.mkin.5 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
-                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
-                    Z2 = mkinsub("SFO", "Z3"),
-                    Z3 = mkinsub("SFORB"))
+
Z.mkin.5 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
+                    Z1 = mkinsub("SFO", "Z2", sink = FALSE),
+                    Z2 = mkinsub("SFO", "Z3"),
+                    Z3 = mkinsub("SFORB"))
## Successfully compiled differential equation model from auto-generated C code.
- +

The summary view of the backtransformed parameters shows that we get no confidence intervals due to overparameterisation. As the optimized is excessively small, it seems reasonable to fix it to zero.

-
m.Z.mkin.5a <- mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin,
-                       parms.ini = c(m.Z.mkin.5$bparms.ode[1:7],
-                                     k_Z3_bound_free = 0),
-                       fixed_parms = "k_Z3_bound_free",
-                       quiet = TRUE)
-plot_sep(m.Z.mkin.5a)
+
m.Z.mkin.5a <- mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin,
+                       parms.ini = c(m.Z.mkin.5$bparms.ode[1:7],
+                                     k_Z3_bound_free = 0),
+                       fixed_parms = "k_Z3_bound_free",
+                       quiet = TRUE)
+plot_sep(m.Z.mkin.5a)

As expected, the residual plots for Z0 and Z3 are more random than in the case of the all SFO model for which they were shown above. In conclusion, the model is proposed as the best-fit model for the dataset from Appendix 7 of the FOCUS report.

A graphical representation of the confidence intervals can finally be obtained.

-
mkinparplot(m.Z.mkin.5a)
+
mkinparplot(m.Z.mkin.5a)

The endpoints obtained with this model are

-
endpoints(m.Z.mkin.5a)
+
endpoints(m.Z.mkin.5a)
## $ff
 ##   Z0_free_Z1        Z1_Z2      Z2_sink   Z2_Z3_free Z3_free_sink 
 ##      1.00000      1.00000      0.46344      0.53656      1.00000 
diff --git a/docs/articles/web_only/NAFTA_examples.html b/docs/articles/web_only/NAFTA_examples.html
index cae0cd6b..db1fc478 100644
--- a/docs/articles/web_only/NAFTA_examples.html
+++ b/docs/articles/web_only/NAFTA_examples.html
@@ -88,7 +88,7 @@
       

Evaluation of example datasets from Attachment 1 to the US EPA SOP for the NAFTA guidance

Johannes Ranke

-

2019-02-26

+

2019-03-04

@@ -110,12 +110,14 @@

Example on page 5, upper panel

-
p5a <- nafta(NAFTA_SOP_Attachment[["p5a"]])
+
p5a <- nafta(NAFTA_SOP_Attachment[["p5a"]])
+
## Warning in summary.mkinfit(x): Could not estimate covariance matrix;
+## singular system.
## 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)
+
plot(p5a)

-
print(p5a)
+
print(p5a)
## Sums of squares:
 ##       SFO      IORE      DFOP 
 ## 465.21753  56.27506  32.06401 
@@ -125,22 +127,22 @@
 ## 
 ## 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
+##               Estimate   Pr(>t)  Lower   Upper
+## parent_0       95.8401 1.10e-21 92.121 99.5597
+## k_parent_sink   0.0102 1.71e-12  0.009  0.0117
 ## 
 ## $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
+##                     Estimate   Pr(>t)    Lower    Upper
+## parent_0            1.01e+02 2.37e-26 9.89e+01 1.03e+02
+## k__iore_parent_sink 1.54e-05 8.73e-02 3.48e-06 6.85e-05
+## N_parent            2.57e+00 1.14e-11 2.22e+00 2.92e+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
+##          Estimate   Pr(>t) Lower Upper
+## parent_0 9.99e+01 4.33e-27    NA    NA
+## k1       2.67e-02 3.17e-05    NA    NA
+## k2       2.16e-12 5.00e-01    NA    NA
+## g        6.47e-01 2.13e-05    NA    NA
 ## 
 ## 
 ## DTx values:
@@ -155,12 +157,14 @@
 

Example on page 5, lower panel

-
p5b <- nafta(NAFTA_SOP_Attachment[["p5b"]])
+
p5b <- nafta(NAFTA_SOP_Attachment[["p5b"]])
+
## Warning in summary.mkinfit(x): Could not estimate covariance matrix;
+## singular system.
## 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)
+
plot(p5b)

-
print(p5b)
+
print(p5b)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 94.81123 10.10936  7.55871 
@@ -170,22 +174,22 @@
 ## 
 ## 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
+##               Estimate   Pr(>t)    Lower    Upper
+## parent_0        96.497 2.62e-25 94.77653 98.21774
+## k_parent_sink    0.008 1.35e-14  0.00736  0.00871
 ## 
 ## $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
+##                     Estimate   Pr(>t)    Lower    Upper
+## parent_0            9.85e+01 1.02e-29 9.78e+01 9.93e+01
+## k__iore_parent_sink 1.53e-04 1.15e-02 6.60e-05 3.56e-04
+## N_parent            1.94e+00 8.18e-13 1.74e+00 2.14e+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
+##          Estimate   Pr(>t) Lower Upper
+## parent_0 9.84e+01 1.90e-28    NA    NA
+## k1       1.55e-02 2.83e-03    NA    NA
+## k2       8.17e-12 5.00e-01    NA    NA
+## g        6.89e-01 1.31e-02    NA    NA
 ## 
 ## 
 ## DTx values:
@@ -200,12 +204,14 @@
 

Example on page 6

-
p6 <- nafta(NAFTA_SOP_Attachment[["p6"]])
+
p6 <- nafta(NAFTA_SOP_Attachment[["p6"]])
+
## Warning in summary.mkinfit(x): Could not estimate covariance matrix;
+## singular system.
## 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)
+
plot(p6)

-
print(p6)
+
print(p6)
## Sums of squares:
 ##       SFO      IORE      DFOP 
 ## 188.45361  51.00699  42.46931 
@@ -215,22 +221,22 @@
 ## 
 ## 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
+##               Estimate   Pr(>t)   Lower   Upper
+## parent_0       94.7759 1.25e-24 92.2558 97.2960
+## k_parent_sink   0.0179 2.35e-16  0.0166  0.0194
 ## 
 ## $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
+##                     Estimate   Pr(>t)    Lower    Upper
+## parent_0            97.12446 5.62e-27 95.49343 98.75549
+## k__iore_parent_sink  0.00252 3.54e-03  0.00126  0.00502
+## N_parent             1.49587 6.13e-13  1.32380  1.66794
 ## 
 ## $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
+##          Estimate   Pr(>t) Lower Upper
+## parent_0 9.66e+01 4.17e-26    NA    NA
+## k1       2.55e-02 2.12e-05    NA    NA
+## k2       3.09e-11 5.00e-01    NA    NA
+## g        8.61e-01 2.10e-05    NA    NA
 ## 
 ## 
 ## DTx values:
@@ -245,12 +251,14 @@
 

Example on page 7

-
p7 <- nafta(NAFTA_SOP_Attachment[["p7"]])
+
p7 <- nafta(NAFTA_SOP_Attachment[["p7"]])
+
## Warning in summary.mkinfit(x): Could not estimate covariance matrix;
+## singular system.
## 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)
+
plot(p7)

-
print(p7)
+
print(p7)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 3661.661 3195.030 3174.145 
@@ -260,22 +268,22 @@
 ## 
 ## 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
+##               Estimate   Pr(>t)    Lower    Upper
+## parent_0      96.41796 1.52e-53 93.29554 99.54038
+## k_parent_sink  0.00735 3.59e-21  0.00641  0.00842
 ## 
 ## $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
+##                     Estimate   Pr(>t)    Lower    Upper
+## parent_0            9.92e+01 7.33e-49 9.53e+01 1.03e+02
+## k__iore_parent_sink 1.60e-05 3.47e-01 9.98e-08 2.57e-03
+## N_parent            2.45e+00 6.14e-05 1.26e+00 3.63e+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
+##          Estimate   Pr(>t) Lower Upper
+## parent_0 9.89e+01 8.13e-48    NA    NA
+## k1       1.81e-02 2.20e-01    NA    NA
+## k2       3.28e-10 5.00e-01    NA    NA
+## g        6.06e-01 2.60e-01    NA    NA
 ## 
 ## 
 ## DTx values:
@@ -295,12 +303,17 @@
 

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))
+
p8 <- nafta(NAFTA_SOP_Attachment[["p8"]], parms.ini = c(k__iore_parent_sink = 1e-3))
+
## Warning in summary.mkinfit(x): Could not estimate covariance matrix;
+## singular system.
+
+## Warning in summary.mkinfit(x): Could not estimate covariance matrix;
+## singular system.
## 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)
+
plot(p8)

-
print(p8)
+
print(p8)
## Sums of squares:
 ##       SFO      IORE      DFOP 
 ## 1996.9408  444.9237  547.5616 
@@ -310,31 +323,31 @@
 ## 
 ## 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
+##                     Estimate Pr(>t) Lower Upper
+## parent_0            88.16549     NA    NA    NA
+## k__iore_parent_sink  0.00100     NA    NA    NA
+## k_parent_sink        0.00803     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
+##                     Estimate   Pr(>t)    Lower    Upper
+## parent_0            9.77e+01 1.05e-35 9.44e+01 1.01e+02
+## k__iore_parent_sink 6.14e-05 2.76e-02 2.21e-05 1.71e-04
+## N_parent            2.27e+00 6.00e-19 2.02e+00 2.53e+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
+##                     Estimate Pr(>t) Lower Upper
+## parent_0            95.70619     NA    NA    NA
+## k__iore_parent_sink  0.00100     NA    NA    NA
+## k1                   0.02500     NA    NA    NA
+## k2                   0.00273     NA    NA    NA
+## g                    0.58835     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
+## DFOP 55.6  517    253.5
 ## 
 ## Representative half-life:
 ## [1] 201.0316
@@ -346,12 +359,14 @@

Example on page 9, upper panel

-
p9a <- nafta(NAFTA_SOP_Attachment[["p9a"]])
+
p9a <- nafta(NAFTA_SOP_Attachment[["p9a"]])
+
## Warning in summary.mkinfit(x): Could not estimate covariance matrix;
+## singular system.
## 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)
+
plot(p9a)

-
print(p9a)
+
print(p9a)
## Sums of squares:
 ##       SFO      IORE      DFOP 
 ## 839.35238  88.57064   9.93363 
@@ -361,22 +376,22 @@
 ## 
 ## 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
+##               Estimate   Pr(>t)   Lower   Upper
+## parent_0       88.1933 1.12e-12 79.7671 96.6195
+## k_parent_sink   0.0409 9.50e-08  0.0326  0.0513
 ## 
 ## $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
+##                     Estimate   Pr(>t)    Lower    Upper
+## parent_0            9.89e+01 5.16e-17 9.50e+01 1.03e+02
+## k__iore_parent_sink 1.93e-05 1.48e-01 2.65e-06 1.40e-04
+## N_parent            2.91e+00 3.74e-09 2.43e+00 3.39e+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
+##          Estimate   Pr(>t) Lower Upper
+## parent_0 9.85e+01 1.31e-21    NA    NA
+## k1       1.38e-01 3.63e-09    NA    NA
+## k2       6.02e-13 5.00e-01    NA    NA
+## g        6.52e-01 1.50e-10    NA    NA
 ## 
 ## 
 ## DTx values:
@@ -392,12 +407,14 @@
 

Example on page 9, lower panel

-
p9b <- nafta(NAFTA_SOP_Attachment[["p9b"]])
+
p9b <- nafta(NAFTA_SOP_Attachment[["p9b"]])
+
## Warning in summary.mkinfit(x): Could not estimate covariance matrix;
+## singular system.
## 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)
+
plot(p9b)

-
print(p9b)
+
print(p9b)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 35.64867 23.22334 35.64867 
@@ -407,22 +424,22 @@
 ## 
 ## 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
+##               Estimate   Pr(>t)   Lower  Upper
+## parent_0       94.7123 2.21e-20 93.0673 96.357
+## k_parent_sink   0.0389 1.48e-14  0.0369  0.041
 ## 
 ## $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
+##                     Estimate   Pr(>t)   Lower  Upper
+## parent_0              93.863 2.91e-19 92.2996 95.426
+## k__iore_parent_sink    0.127 2.73e-02  0.0457  0.354
+## N_parent               0.711 3.13e-05  0.4605  0.961
 ## 
 ## $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
+##          Estimate Pr(>t) Lower Upper
+## parent_0  94.7123     NA    NA    NA
+## k1         0.0389     NA    NA    NA
+## k2         0.0389     NA    NA    NA
+## g          0.7742     NA    NA    NA
 ## 
 ## 
 ## DTx values:
@@ -438,12 +455,14 @@
 

Example on page 10

-
p10 <- nafta(NAFTA_SOP_Attachment[["p10"]])
+
p10 <- nafta(NAFTA_SOP_Attachment[["p10"]])
+
## Warning in summary.mkinfit(x): Could not estimate covariance matrix;
+## singular system.
## 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)
+
plot(p10)

-
print(p10)
+
print(p10)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 899.4089 336.4348 899.4089 
@@ -453,29 +472,29 @@
 ## 
 ## 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
+##               Estimate   Pr(>t)   Lower    Upper
+## parent_0      101.7315 4.95e-11 90.9683 112.4947
+## k_parent_sink   0.0495 3.40e-07  0.0393   0.0624
 ## 
 ## $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
+##                     Estimate   Pr(>t)  Lower   Upper
+## parent_0               96.86 2.71e-12 89.884 103.826
+## k__iore_parent_sink     2.96 1.31e-01  0.461  19.020
+## N_parent                0.00 5.00e-01 -0.473   0.473
 ## 
 ## $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
+##          Estimate Pr(>t) Lower Upper
+## parent_0 101.7315     NA    NA    NA
+## k1         0.0495     NA    NA    NA
+## k2         0.0495     NA    NA    NA
+## g          0.6634     NA    NA    NA
 ## 
 ## 
 ## DTx values:
 ##      DT50 DT90 DT50_rep
-## SFO  14.0 46.5    14.00
+## SFO  14.0 46.5    13.99
 ## IORE 16.4 29.4     8.86
-## DFOP 14.0 46.5    14.00
+## DFOP 14.0 46.5    13.99
 ## 
 ## Representative half-life:
 ## [1] 8.862193
@@ -488,12 +507,14 @@

Example on page 11

-
p11 <- nafta(NAFTA_SOP_Attachment[["p11"]])
+
p11 <- nafta(NAFTA_SOP_Attachment[["p11"]])
+
## Warning in summary.mkinfit(x): Could not estimate covariance matrix;
+## singular system.
## 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)
+
plot(p11)

-
print(p11)
+
print(p11)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 579.6805 204.7932 144.7783 
@@ -503,22 +524,22 @@
 ## 
 ## 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
+##               Estimate   Pr(>t)    Lower    Upper
+## parent_0      96.15820 1.56e-13 89.91373 1.02e+02
+## k_parent_sink  0.00321 5.27e-05  0.00218 4.71e-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
+##                     Estimate Pr(>t)    Lower    Upper
+## parent_0            1.05e+02     NA 9.80e+01 1.11e+02
+## k__iore_parent_sink 3.11e-17     NA 6.88e-25 1.41e-09
+## N_parent            8.36e+00     NA 4.40e+00 1.23e+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
+##          Estimate   Pr(>t) Lower Upper
+## parent_0 1.05e+02 7.50e-13    NA    NA
+## k1       4.41e-02 3.34e-02    NA    NA
+## k2       7.25e-13 5.00e-01    NA    NA
+## g        3.22e-01 7.87e-03    NA    NA
 ## 
 ## 
 ## DTx values:
@@ -539,12 +560,14 @@
 

Example on page 12, upper panel

-
p12a <- nafta(NAFTA_SOP_Attachment[["p12a"]])
+
p12a <- nafta(NAFTA_SOP_Attachment[["p12a"]])
+
## Warning in summary.mkinfit(x): Could not estimate covariance matrix;
+## singular system.
## 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)
+
plot(p12a)

-
print(p12a)
+
print(p12a)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 695.4440 220.0685 695.4440 
@@ -554,22 +577,22 @@
 ## 
 ## 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
+##               Estimate   Pr(>t)  Lower   Upper
+## parent_0       100.521 5.61e-12 91.687 109.355
+## k_parent_sink    0.124 7.24e-08  0.102   0.152
 ## 
 ## $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
+##                     Estimate   Pr(>t)   Lower   Upper
+## parent_0              96.823 1.24e-13 91.5691 102.078
+## k__iore_parent_sink    2.436 3.89e-02  0.7854   7.556
+## N_parent               0.263 3.64e-02 -0.0288   0.554
 ## 
 ## $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
+##          Estimate Pr(>t) Lower Upper
+## parent_0  100.521     NA    NA    NA
+## k1          0.124     NA    NA    NA
+## k2          0.124     NA    NA    NA
+## g           0.877     NA    NA    NA
 ## 
 ## 
 ## DTx values:
@@ -584,12 +607,14 @@
 

Example on page 12, lower panel

-
p12b <- nafta(NAFTA_SOP_Attachment[["p12b"]])
+
p12b <- nafta(NAFTA_SOP_Attachment[["p12b"]])
+
## Warning in summary.mkinfit(x): Could not estimate covariance matrix;
+## singular system.
## 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)
+
plot(p12b)

-
print(p12b)
+
print(p12b)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 58.90242 19.06353 58.90242 
@@ -599,29 +624,29 @@
 ## 
 ## 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
+##               Estimate   Pr(>t)   Lower    Upper
+## parent_0       97.6840 5.36e-05 86.3205 109.0475
+## k_parent_sink   0.0589 9.87e-04  0.0432   0.0803
 ## 
 ## $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
+##                     Estimate   Pr(>t)   Lower  Upper
+## parent_0              95.523 0.000386 84.0963 106.95
+## k__iore_parent_sink    0.333 0.170886  0.0103  10.80
+## N_parent               0.568 0.054881 -0.3161   1.45
 ## 
 ## $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
+##          Estimate Pr(>t) Lower Upper
+## parent_0  97.6840     NA    NA    NA
+## k1         0.0589     NA    NA    NA
+## k2         0.0589     NA    NA    NA
+## g          0.6902     NA    NA    NA
 ## 
 ## 
 ## DTx values:
 ##      DT50 DT90 DT50_rep
-## SFO  11.8 39.1    11.80
+## SFO  11.8 39.1    11.76
 ## IORE 12.9 31.4     9.46
-## DFOP 11.8 39.1    11.80
+## DFOP 11.8 39.1    11.76
 ## 
 ## Representative half-life:
 ## [1] 9.461912
@@ -629,12 +654,14 @@

Example on page 13

-
p13 <- nafta(NAFTA_SOP_Attachment[["p13"]])
+
p13 <- nafta(NAFTA_SOP_Attachment[["p13"]])
+
## Warning in summary.mkinfit(x): Could not estimate covariance matrix;
+## singular system.
## 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)
+
plot(p13)

-
print(p13)
+
print(p13)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 174.5971 142.3951 174.5971 
@@ -644,22 +671,22 @@
 ## 
 ## 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
+##               Estimate   Pr(>t)   Lower    Upper
+## parent_0      92.73500 1.45e-17 89.3891 96.08094
+## k_parent_sink  0.00258 2.63e-09  0.0022  0.00303
 ## 
 ## $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
+##                     Estimate   Pr(>t)    Lower Upper
+## parent_0             91.6016 2.93e-16 88.08711 95.12
+## k__iore_parent_sink   0.0396 2.81e-01  0.00102  1.53
+## N_parent              0.3541 1.97e-01 -0.51943  1.23
 ## 
 ## $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
+##          Estimate Pr(>t) Lower Upper
+## parent_0 92.73500     NA    NA    NA
+## k1        0.00258     NA    NA    NA
+## k2        0.00258     NA    NA    NA
+## g         0.00442     NA    NA    NA
 ## 
 ## 
 ## DTx values:
@@ -675,12 +702,14 @@
 

DT50 not observed in the study and DFOP problems in PestDF

-
p14 <- nafta(NAFTA_SOP_Attachment[["p14"]])
+
p14 <- nafta(NAFTA_SOP_Attachment[["p14"]])
+
## Warning in summary.mkinfit(x): Could not estimate covariance matrix;
+## singular system.
## 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)
+
plot(p14)

-
print(p14)
+
print(p14)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 48.43249 28.67746 27.26248 
@@ -690,22 +719,22 @@
 ## 
 ## 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
+##               Estimate   Pr(>t)    Lower    Upper
+## parent_0      99.47124 1.71e-31 98.37313 1.01e+02
+## k_parent_sink  0.00279 2.22e-15  0.00255 3.05e-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
+##                     Estimate Pr(>t)    Lower    Upper
+## parent_0            1.00e+02     NA 9.93e+01 1.01e+02
+## k__iore_parent_sink 9.44e-08     NA 6.81e-11 1.31e-04
+## N_parent            3.31e+00     NA 1.69e+00 4.93e+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
+##          Estimate   Pr(>t) Lower Upper
+## parent_0 1.00e+02 2.70e-28    NA    NA
+## k1       9.53e-03 3.39e-01    NA    NA
+## k2       9.19e-12 5.00e-01    NA    NA
+## g        3.98e-01 3.92e-01    NA    NA
 ## 
 ## 
 ## DTx values:
@@ -721,12 +750,14 @@
 

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

-
p15a <- nafta(NAFTA_SOP_Attachment[["p15a"]])
+
p15a <- nafta(NAFTA_SOP_Attachment[["p15a"]])
+
## Warning in summary.mkinfit(x): Could not estimate covariance matrix;
+## singular system.
## 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)
+
plot(p15a)

-
print(p15a)
+
print(p15a)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 245.5248 135.0132 245.5248 
@@ -736,22 +767,22 @@
 ## 
 ## 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
+##               Estimate   Pr(>t)    Lower    Upper
+## parent_0      97.96751 4.98e-16 94.03829 101.8967
+## k_parent_sink  0.00952 5.24e-09  0.00813   0.0112
 ## 
 ## $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
+##                     Estimate   Pr(>t)   Lower  Upper
+## parent_0              95.874 8.30e-16 92.5802 99.167
+## k__iore_parent_sink    0.629 2.39e-01  0.0316 12.519
+## N_parent               0.000 5.00e-01 -0.7219  0.722
 ## 
 ## $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
+##          Estimate Pr(>t) Lower Upper
+## parent_0 97.96752     NA    NA    NA
+## k1        0.00952     NA    NA    NA
+## k2        0.00952     NA    NA    NA
+## g         0.17247     NA    NA    NA
 ## 
 ## 
 ## DTx values:
@@ -762,12 +793,14 @@
 ## 
 ## Representative half-life:
 ## [1] 41.32749
-
p15b <- nafta(NAFTA_SOP_Attachment[["p15b"]])
+
p15b <- nafta(NAFTA_SOP_Attachment[["p15b"]])
+
## Warning in summary.mkinfit(x): Could not estimate covariance matrix;
+## singular system.
## 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)
+
plot(p15b)

-
print(p15b)
+
print(p15b)
## Sums of squares:
 ##       SFO      IORE      DFOP 
 ## 106.91629  68.55574 106.91629 
@@ -777,29 +810,29 @@
 ## 
 ## 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
+##               Estimate   Pr(>t)    Lower    Upper
+## parent_0      1.01e+02 4.99e-18 98.12761 1.04e+02
+## k_parent_sink 4.86e-03 1.76e-10  0.00432 5.46e-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
+##                     Estimate   Pr(>t)    Lower Upper
+## parent_0               99.83 4.49e-17 97.19753 102.5
+## k__iore_parent_sink     0.38 3.41e-01  0.00206  70.0
+## N_parent                0.00 5.00e-01 -1.20105   1.2
 ## 
 ## $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
+##          Estimate Pr(>t) Lower Upper
+## parent_0 1.01e+02     NA    NA    NA
+## k1       4.86e-03     NA    NA    NA
+## k2       4.86e-03     NA    NA    NA
+## g        1.50e-01     NA    NA    NA
 ## 
 ## 
 ## DTx values:
 ##      DT50 DT90 DT50_rep
-## SFO   143  474    143.0
+## SFO   143  474    142.7
 ## IORE  131  236     71.2
-## DFOP  143  474    143.0
+## DFOP  143  474    142.7
 ## 
 ## Representative half-life:
 ## [1] 71.18014
@@ -808,14 +841,14 @@

The DFOP fraction parameter is greater than 1

-
p16 <- nafta(NAFTA_SOP_Attachment[["p16"]])
+
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)
+
plot(p16)

-
print(p16)
+
print(p16)
## Sums of squares:
 ##      SFO     IORE     DFOP 
 ## 3831.804 2062.008 1550.980 
@@ -825,22 +858,22 @@
 ## 
 ## 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
+##               Estimate   Pr(>t)  Lower  Upper
+## parent_0        71.953 3.92e-14 61.087 82.819
+## k_parent_sink    0.159 2.27e-06  0.111  0.229
 ## 
 ## $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
+##                     Estimate   Pr(>t)    Lower    Upper
+## parent_0            8.74e+01 1.74e-16 7.71e+01 97.70701
+## k__iore_parent_sink 4.55e-04 2.28e-01 3.01e-05  0.00688
+## N_parent            2.70e+00 1.87e-08 1.97e+00  3.42611
 ## 
 ## $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
+##          Estimate Pr(>t)   Lower  Upper
+## parent_0  88.5333     NA 79.3673 97.699
+## k1        18.5562     NA  0.0000    Inf
+## k2         0.0776     NA  0.0471  0.128
+## g          0.4733     NA  0.3138  0.639
 ## 
 ## 
 ## DTx values:
diff --git a/docs/articles/web_only/compiled_models.html b/docs/articles/web_only/compiled_models.html
index 3d49d262..1d96ea76 100644
--- a/docs/articles/web_only/compiled_models.html
+++ b/docs/articles/web_only/compiled_models.html
@@ -88,7 +88,7 @@
       

Performance benefit by using compiled model definitions in mkin

Johannes Ranke

-

2019-02-26

+

2019-03-04

@@ -101,37 +101,37 @@

Model that can also be solved with Eigenvalues

This evaluation is taken from the example section of mkinfit. When using an mkin version equal to or greater than 0.9-36 and a C compiler (gcc) is available, you will see a message that the model is being compiled from autogenerated C code when defining a model using mkinmod. The mkinmod() function checks for presence of the gcc compiler using

-
Sys.which("gcc")
+
Sys.which("gcc")
##            gcc 
 ## "/usr/bin/gcc"

First, we build a simple degradation model for a parent compound with one metabolite.

-
library("mkin", quietly = TRUE)
-SFO_SFO <- mkinmod(
-  parent = mkinsub("SFO", "m1"),
-  m1 = mkinsub("SFO"))
+
library("mkin", quietly = TRUE)
+SFO_SFO <- mkinmod(
+  parent = mkinsub("SFO", "m1"),
+  m1 = mkinsub("SFO"))
## Successfully compiled differential equation model from auto-generated C code.

We can compare the performance of the Eigenvalue based solution against the compiled version and the R implementation of the differential equations using the benchmark package.

- +
## Lade nötiges Paket: rbenchmark
##                    test replications elapsed relative user.self sys.self
-## 3     deSolve, compiled            3   2.309    1.000     2.307        0
-## 1 deSolve, not compiled            3  17.535    7.594    17.527        0
-## 2      Eigenvalue based            3   2.846    1.233     2.844        0
+## 3     deSolve, compiled            3   2.313    1.000     2.312        0
+## 1 deSolve, not compiled            3  17.602    7.610    17.595        0
+## 2      Eigenvalue based            3   2.853    1.233     2.851        0
 ##   user.child sys.child
 ## 3          0         0
 ## 1          0         0
@@ -142,26 +142,26 @@
 

Model that can not be solved with Eigenvalues

This evaluation is also taken from the example section of mkinfit.

-
if (require(rbenchmark)) {
-  FOMC_SFO <- mkinmod(
-    parent = mkinsub("FOMC", "m1"),
-    m1 = mkinsub( "SFO"))
-
-  b.2 <- benchmark(
-    "deSolve, not compiled" = mkinfit(FOMC_SFO, FOCUS_2006_D,
-                                      use_compiled = FALSE, quiet = TRUE),
-    "deSolve, compiled" = mkinfit(FOMC_SFO, FOCUS_2006_D, quiet = TRUE),
-    replications = 3)
-  print(b.2)
-  factor_FOMC_SFO <- round(b.2["1", "relative"])
-} else {
-  factor_FOMC_SFO <- NA
-  print("R package benchmark is not available")
-}
+
if (require(rbenchmark)) {
+  FOMC_SFO <- mkinmod(
+    parent = mkinsub("FOMC", "m1"),
+    m1 = mkinsub( "SFO"))
+
+  b.2 <- benchmark(
+    "deSolve, not compiled" = mkinfit(FOMC_SFO, FOCUS_2006_D,
+                                      use_compiled = FALSE, quiet = TRUE),
+    "deSolve, compiled" = mkinfit(FOMC_SFO, FOCUS_2006_D, quiet = TRUE),
+    replications = 3)
+  print(b.2)
+  factor_FOMC_SFO <- round(b.2["1", "relative"])
+} else {
+  factor_FOMC_SFO <- NA
+  print("R package benchmark is not available")
+}
## Successfully compiled differential equation model from auto-generated C code.
##                    test replications elapsed relative user.self sys.self
-## 2     deSolve, compiled            3   4.071    1.000     4.069        0
-## 1 deSolve, not compiled            3  37.139    9.123    37.123        0
+## 2     deSolve, compiled            3   4.049    1.000     4.047        0
+## 1 deSolve, not compiled            3  37.135    9.171    37.119        0
 ##   user.child sys.child
 ## 2          0         0
 ## 1          0         0
-- cgit v1.2.1