From ccc70e82af4ba435f0a71ba1ae4e0e92045c3852 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 5 May 2017 12:46:31 +0200 Subject: Static docs except articles rebuilt with current pkgdown --- vignettes/FOCUS_D.html | 20 ++++---- vignettes/FOCUS_L.html | 106 ++++++++++++++++++++--------------------- vignettes/FOCUS_Z.pdf | Bin 239559 -> 240270 bytes vignettes/compiled_models.html | 24 ++++++---- 4 files changed, 78 insertions(+), 72 deletions(-) (limited to 'vignettes') diff --git a/vignettes/FOCUS_D.html b/vignettes/FOCUS_D.html index 40edec94..5da77efa 100644 --- a/vignettes/FOCUS_D.html +++ b/vignettes/FOCUS_D.html @@ -4,14 +4,14 @@ - + - + Example evaluation of FOCUS Example Dataset D @@ -21,7 +21,7 @@ - + @@ -119,7 +119,7 @@ $(document).ready(function () {

Example evaluation of FOCUS Example Dataset D

Johannes Ranke

-

2016-11-18

+

2017-05-05

@@ -196,10 +196,10 @@ $(document).ready(function () {

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

summary(fit)
-
## mkin version:    0.9.44.9000 
-## R version:       3.3.2 
-## Date of fit:     Fri Nov 18 22:48:53 2016 
-## Date of summary: Fri Nov 18 22:48:54 2016 
+
## mkin version:    0.9.45 
+## R version:       3.4.0 
+## Date of fit:     Fri May  5 12:14:00 2017 
+## Date of summary: Fri May  5 12:14:00 2017 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent
@@ -207,7 +207,7 @@ $(document).ready(function () {
 ## 
 ## Model predictions using solution type deSolve 
 ## 
-## Fitted with method Port using 153 model solutions performed in 0.64 s
+## Fitted with method Port using 153 model solutions performed in 1.033 s
 ## 
 ## Weighting: none
 ## 
@@ -241,7 +241,7 @@ $(document).ready(function () {
 ## parent_0           1.00000            0.6075        -0.06625       -0.1701
 ## log_k_parent_sink  0.60752            1.0000        -0.08740       -0.6253
 ## log_k_parent_m1   -0.06625           -0.0874         1.00000        0.4716
-## log_k_m1_sink     -0.17006           -0.6253         0.47163        1.0000
+## log_k_m1_sink     -0.17006           -0.6253         0.47164        1.0000
 ## 
 ## Residual standard error: 3.211 on 36 degrees of freedom
 ## 
diff --git a/vignettes/FOCUS_L.html b/vignettes/FOCUS_L.html
index 315f3d98..fd531133 100644
--- a/vignettes/FOCUS_L.html
+++ b/vignettes/FOCUS_L.html
@@ -4,14 +4,14 @@
 
 
 
-
+
 
 
 
 
 
 
-
+
 
 Example evaluation of FOCUS Laboratory Data L1 to L3
 
@@ -24,7 +24,7 @@
 
 
 
-
+
 
 
 
@@ -223,7 +223,7 @@ div.tocify {
 
 

Example evaluation of FOCUS Laboratory Data L1 to L3

Johannes Ranke

-

2016-11-18

+

2017-05-05

@@ -242,17 +242,17 @@ FOCUS_2006_L1_mkin <- mkin_wide_to_long(FOCUS_2006_L1)

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)
-
## mkin version:    0.9.44.9000 
-## R version:       3.3.2 
-## Date of fit:     Fri Nov 18 22:48:55 2016 
-## Date of summary: Fri Nov 18 22:48:55 2016 
+
## mkin version:    0.9.45 
+## R version:       3.4.0 
+## Date of fit:     Fri May  5 12:14:02 2017 
+## Date of summary: Fri May  5 12:14:02 2017 
 ## 
 ## 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.087 s
+## Fitted with method Port using 37 model solutions performed in 0.263 s
 ## 
 ## Weighting: none
 ## 
@@ -333,12 +333,12 @@ summary(m.L1.SFO)
## Warning in mkinfit("FOMC", FOCUS_2006_L1_mkin, quiet = TRUE): Optimisation by method Port did not converge.
 ## Convergence code is 1
plot(m.L1.FOMC, show_errmin = TRUE, main = "FOCUS L1 - FOMC")
-

+

summary(m.L1.FOMC, data = FALSE)
-
## mkin version:    0.9.44.9000 
-## R version:       3.3.2 
-## Date of fit:     Fri Nov 18 22:48:55 2016 
-## Date of summary: Fri Nov 18 22:48:55 2016 
+
## mkin version:    0.9.45 
+## R version:       3.4.0 
+## Date of fit:     Fri May  5 12:14:03 2017 
+## Date of summary: Fri May  5 12:14:03 2017 
 ## 
 ## 
 ## Warning: Optimisation by method Port did not converge.
@@ -350,7 +350,7 @@ summary(m.L1.SFO)
## ## Model predictions using solution type analytical ## -## Fitted with method Port using 188 model solutions performed in 0.413 s +## Fitted with method Port using 155 model solutions performed in 0.439 s ## ## Weighting: none ## @@ -370,16 +370,16 @@ summary(m.L1.SFO)
## None ## ## Optimised, transformed parameters with symmetric confidence intervals: -## Estimate Std. Error Lower Upper -## parent_0 92.47 1.422 89.44 95.50 -## log_alpha 15.43 15.080 -16.71 47.58 -## log_beta 17.78 15.090 -14.37 49.93 +## Estimate Std. Error Lower Upper +## parent_0 92.47 1.449 89.38 95.56 +## log_alpha 11.35 435.800 -917.60 940.30 +## log_beta 13.70 435.800 -915.20 942.60 ## ## Parameter correlation: ## parent_0 log_alpha log_beta -## parent_0 1.0000 0.1129 0.1112 -## log_alpha 0.1129 1.0000 1.0000 -## log_beta 0.1112 1.0000 1.0000 +## parent_0 1.0000 0.2209 0.2208 +## log_alpha 0.2209 1.0000 1.0000 +## log_beta 0.2208 1.0000 1.0000 ## ## Residual standard error: 3.045 on 15 degrees of freedom ## @@ -387,10 +387,10 @@ summary(m.L1.SFO)
## Confidence intervals for internally transformed parameters are asymmetric. ## t-test (unrealistically) based on the assumption of normal distribution ## for estimators of untransformed parameters. -## Estimate t value Pr(>t) Lower Upper -## parent_0 9.247e+01 65.150 4.044e-20 8.944e+01 9.550e+01 -## alpha 5.044e+06 1.271 1.115e-01 5.510e-08 4.618e+20 -## beta 5.276e+07 1.259 1.137e-01 5.732e-07 4.857e+21 +## Estimate t value Pr(>t) Lower Upper +## parent_0 92.47 63.33000 6.183e-20 89.38 95.56 +## alpha 85190.00 0.03367 4.868e-01 0.00 Inf +## beta 891000.00 0.03367 4.868e-01 0.00 Inf ## ## Chi2 error levels in percent: ## err.min n.optim df @@ -398,8 +398,8 @@ summary(m.L1.SFO)
## parent 3.619 3 6 ## ## Estimated disappearance times: -## DT50 DT90 DT50back -## parent 7.25 24.08 7.25 +## DT50 DT90 DT50back +## parent 7.249 24.08 7.249

We get a warning that the default optimisation algorithm Port did not converge, which is an indication that the model is overparameterised, i.e. contains too many parameters that are ill-defined as a consequence.

And in fact, due to the higher number of parameters, and the lower number of degrees of freedom of the fit, the χ2 error level is actually higher for the FOMC model (3.6%) than for the SFO model (3.4%). Additionally, the parameters log_alpha and log_beta internally fitted in the model have excessive confidence intervals, that span more than 25 orders of magnitude (!) when backtransformed to the scale of alpha and beta. Also, the t-test for significant difference from zero does not indicate such a significant difference, with p-values greater than 0.1, and finally, the parameter correlation of log_alpha and log_beta is 1.000, clearly indicating that the model is overparameterised.

The χ2 error levels reported in Appendix 3 and Appendix 7 to the FOCUS kinetics report are rounded to integer percentages and partly deviate by one percentage point from the results calculated by mkin. The reason for this is not known. However, mkin gives the same χ2 error levels as the kinfit package and the calculation routines of the kinfit package have been extensively compared to the results obtained by the KinGUI software, as documented in the kinfit package vignette. KinGUI was the first widely used standard package in this field. Also, the calculation of χ2 error levels was compared with KinGUII, CAKE and DegKin manager in a project sponsored by the German Umweltbundesamt (Ranke 2014).

@@ -432,17 +432,17 @@ plot(m.L2.FOMC, show_residuals = TRUE, main = "FOCUS L2 - FOMC")

summary(m.L2.FOMC, data = FALSE)
-
## mkin version:    0.9.44.9000 
-## R version:       3.3.2 
-## Date of fit:     Fri Nov 18 22:48:56 2016 
-## Date of summary: Fri Nov 18 22:48:56 2016 
+
## mkin version:    0.9.45 
+## R version:       3.4.0 
+## Date of fit:     Fri May  5 12:14:04 2017 
+## Date of summary: Fri May  5 12:14:04 2017 
 ## 
 ## 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.177 s
+## Fitted with method Port using 81 model solutions performed in 0.171 s
 ## 
 ## Weighting: none
 ## 
@@ -502,10 +502,10 @@ plot(m.L2.DFOP, show_residuals = TRUE, show_errmin = TRUE,
      main = "FOCUS L2 - DFOP")

summary(m.L2.DFOP, data = FALSE)
-
## mkin version:    0.9.44.9000 
-## R version:       3.3.2 
-## Date of fit:     Fri Nov 18 22:48:57 2016 
-## Date of summary: Fri Nov 18 22:48:57 2016 
+
## mkin version:    0.9.45 
+## R version:       3.4.0 
+## Date of fit:     Fri May  5 12:14:05 2017 
+## Date of summary: Fri May  5 12:14:05 2017 
 ## 
 ## Equations:
 ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -514,7 +514,7 @@ plot(m.L2.DFOP, show_residuals = TRUE, show_errmin = TRUE,
 ## 
 ## Model predictions using solution type analytical 
 ## 
-## Fitted with method Port using 336 model solutions performed in 0.747 s
+## Fitted with method Port using 336 model solutions performed in 0.742 s
 ## 
 ## Weighting: none
 ## 
@@ -591,10 +591,10 @@ plot(mm.L3)

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]])
-
## mkin version:    0.9.44.9000 
-## R version:       3.3.2 
-## Date of fit:     Fri Nov 18 22:48:57 2016 
-## Date of summary: Fri Nov 18 22:48:57 2016 
+
## mkin version:    0.9.45 
+## R version:       3.4.0 
+## Date of fit:     Fri May  5 12:14:06 2017 
+## Date of summary: Fri May  5 12:14:06 2017 
 ## 
 ## Equations:
 ## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -603,7 +603,7 @@ plot(mm.L3)
## ## Model predictions using solution type analytical ## -## Fitted with method Port using 137 model solutions performed in 0.307 s +## Fitted with method Port using 137 model solutions performed in 0.348 s ## ## Weighting: none ## @@ -691,17 +691,17 @@ plot(mm.L4)

The χ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 χ2 test passes is slightly lower for the FOMC model. However, the difference appears negligible.

summary(mm.L4[["SFO", 1]], data = FALSE)
-
## mkin version:    0.9.44.9000 
-## R version:       3.3.2 
-## Date of fit:     Fri Nov 18 22:48:58 2016 
-## Date of summary: Fri Nov 18 22:48:58 2016 
+
## mkin version:    0.9.45 
+## R version:       3.4.0 
+## Date of fit:     Fri May  5 12:14:06 2017 
+## Date of summary: Fri May  5 12:14:06 2017 
 ## 
 ## 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.098 s
+## Fitted with method Port using 46 model solutions performed in 0.096 s
 ## 
 ## Weighting: none
 ## 
@@ -751,17 +751,17 @@ plot(mm.L4)
## DT50 DT90 ## parent 106 352
summary(mm.L4[["FOMC", 1]], data = FALSE)
-
## mkin version:    0.9.44.9000 
-## R version:       3.3.2 
-## Date of fit:     Fri Nov 18 22:48:58 2016 
-## Date of summary: Fri Nov 18 22:48:58 2016 
+
## mkin version:    0.9.45 
+## R version:       3.4.0 
+## Date of fit:     Fri May  5 12:14:06 2017 
+## Date of summary: Fri May  5 12:14:06 2017 
 ## 
 ## 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.142 s
+## Fitted with method Port using 66 model solutions performed in 0.138 s
 ## 
 ## Weighting: none
 ## 
diff --git a/vignettes/FOCUS_Z.pdf b/vignettes/FOCUS_Z.pdf
index fd313555..8a87e874 100644
Binary files a/vignettes/FOCUS_Z.pdf and b/vignettes/FOCUS_Z.pdf differ
diff --git a/vignettes/compiled_models.html b/vignettes/compiled_models.html
index 53c5647f..67d0f658 100644
--- a/vignettes/compiled_models.html
+++ b/vignettes/compiled_models.html
@@ -229,8 +229,13 @@ div.tocify {
 
##            gcc 
 ## "/usr/bin/gcc"

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

-
library("mkin")
-SFO_SFO <- mkinmod(
+
library("mkin")
+
## Loading required package: minpack.lm
+
## Loading required package: rootSolve
+
## Loading required package: inline
+
## Loading required package: methods
+
## Loading required package: parallel
+
SFO_SFO <- mkinmod(
   parent = mkinsub("SFO", "m1"),
   m1 = mkinsub("SFO"))
## Successfully compiled differential equation model from auto-generated C code.
@@ -251,15 +256,16 @@ SFO_SFO <- mkinmod( factor_SFO_SFO <- NA print("R package benchmark is not available") }
+
## Loading required package: rbenchmark
##                    test replications elapsed relative user.self sys.self
-## 3     deSolve, compiled            3   2.742    1.000     2.740    0.000
-## 1 deSolve, not compiled            3  24.467    8.923    24.344    0.124
-## 2      Eigenvalue based            3   3.050    1.112     3.044    0.004
+## 3     deSolve, compiled            3   2.040    1.000     2.040        0
+## 1 deSolve, not compiled            3  14.622    7.168    14.624        0
+## 2      Eigenvalue based            3   2.478    1.215     2.480        0
 ##   user.child sys.child
 ## 3          0         0
 ## 1          0         0
 ## 2          0         0
-

We see that using the compiled model is by a factor of around 9 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.

+

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.

Model that can not be solved with Eigenvalues

@@ -282,12 +288,12 @@ SFO_SFO <- mkinmod( }
## Successfully compiled differential equation model from auto-generated C code.
##                    test replications elapsed relative user.self sys.self
-## 2     deSolve, compiled            3   4.038    1.000     4.036    0.000
-## 1 deSolve, not compiled            3  55.209   13.672    54.888    0.324
+## 2     deSolve, compiled            3   3.500    1.000     3.500        0
+## 1 deSolve, not compiled            3  29.932    8.552    29.932        0
 ##   user.child sys.child
 ## 2          0         0
 ## 1          0         0
-

Here we get a performance benefit of a factor of 14 using the version of the differential equation model compiled from C code!

+

Here we get a performance benefit of a factor of 9 using the version of the differential equation model compiled from C code!

This vignette was built with mkin 0.9.45 on

## R version 3.4.0 (2017-04-21)
 ## Platform: x86_64-pc-linux-gnu (64-bit)
-- 
cgit v1.2.1