From cf54ccca37d27480dbf8d59eb027300518f7ad75 Mon Sep 17 00:00:00 2001
From: Johannes Ranke Last change 31 January 2019
-(rebuilt 2023-04-20)
+(rebuilt 2023-05-19)
Source: vignettes/FOCUS_D.rmd
FOCUS_D.rmd
mkinparplot
function.
summary
method for mkinfit
objects.
summary(fit)
## mkin version used for fitting: 1.2.3
-## R version used for fitting: 4.2.3
-## Date of fit: Thu Apr 20 07:37:14 2023
-## Date of summary: Thu Apr 20 07:37:14 2023
+## mkin version used for fitting: 1.2.4
+## R version used for fitting: 4.3.0
+## Date of fit: Fri May 19 09:20:23 2023
+## Date of summary: Fri May 19 09:20:23 2023
##
## Equations:
## d_parent/dt = - k_parent * parent
@@ -248,7 +248,7 @@ the mkinparplot
function.
##
## Model predictions using solution type analytical
##
-## Fitted using 401 model solutions performed in 0.047 s
+## Fitted using 401 model solutions performed in 0.048 s
##
## Error model: Constant variance
##
@@ -292,10 +292,10 @@ the mkinparplot
function.
## Parameter correlation:
## parent_0 log_k_parent log_k_m1 f_parent_qlogis sigma
## parent_0 1.000e+00 5.174e-01 -1.688e-01 -5.471e-01 -1.172e-06
-## log_k_parent 5.174e-01 1.000e+00 -3.263e-01 -5.426e-01 -8.483e-07
-## log_k_m1 -1.688e-01 -3.263e-01 1.000e+00 7.478e-01 8.205e-07
+## log_k_parent 5.174e-01 1.000e+00 -3.263e-01 -5.426e-01 -8.479e-07
+## log_k_m1 -1.688e-01 -3.263e-01 1.000e+00 7.478e-01 8.211e-07
## f_parent_qlogis -5.471e-01 -5.426e-01 7.478e-01 1.000e+00 1.305e-06
-## sigma -1.172e-06 -8.483e-07 8.205e-07 1.305e-06 1.000e+00
+## sigma -1.172e-06 -8.479e-07 8.211e-07 1.305e-06 1.000e+00
##
## Backtransformed parameters:
## Confidence intervals for internally transformed parameters are asymmetric.
diff --git a/docs/articles/FOCUS_L.html b/docs/articles/FOCUS_L.html
index e47ed9d7..dabb16f2 100644
--- a/docs/articles/FOCUS_L.html
+++ b/docs/articles/FOCUS_L.html
@@ -33,7 +33,7 @@
@@ -134,8 +134,8 @@ to L3
Johannes
Ranke
- Last change 18 May 2022
-(rebuilt 2023-04-20)
+ Last change 18 May 2023
+(rebuilt 2023-05-19)
Source: vignettes/FOCUS_L.rmd
FOCUS_L.rmd
@@ -169,10 +169,10 @@ report.
-## mkin version used for fitting: 1.2.3
-## R version used for fitting: 4.2.3
-## Date of fit: Thu Apr 20 07:37:15 2023
-## Date of summary: Thu Apr 20 07:37:15 2023
+## mkin version used for fitting: 1.2.4
+## R version used for fitting: 4.3.0
+## Date of fit: Fri May 19 09:20:25 2023
+## Date of summary: Fri May 19 09:20:25 2023
##
## Equations:
## d_parent/dt = - k_parent * parent
@@ -276,17 +276,17 @@ objects.
## Warning in sqrt(1/diag(V)): NaNs produced
## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result
## is doubtful
-## mkin version used for fitting: 1.2.3
-## R version used for fitting: 4.2.3
-## Date of fit: Thu Apr 20 07:37:16 2023
-## Date of summary: Thu Apr 20 07:37:16 2023
+## mkin version used for fitting: 1.2.4
+## R version used for fitting: 4.3.0
+## Date of fit: Fri May 19 09:20:25 2023
+## Date of summary: Fri May 19 09:20:25 2023
##
## Equations:
## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
##
## Model predictions using solution type analytical
##
-## Fitted using 369 model solutions performed in 0.025 s
+## Fitted using 342 model solutions performed in 0.021 s
##
## Error model: Constant variance
##
@@ -314,22 +314,22 @@ objects.
##
## Results:
##
-## AIC BIC logLik
-## 95.88781 99.44929 -43.9439
+## AIC BIC logLik
+## 95.88782 99.44931 -43.94391
##
## Optimised, transformed parameters with symmetric confidence intervals:
## Estimate Std. Error Lower Upper
## parent_0 92.47 1.2820 89.720 95.220
-## log_alpha 13.78 NaN NaN NaN
-## log_beta 16.13 NaN NaN NaN
-## sigma 2.78 0.4598 1.794 3.766
+## log_alpha 13.20 NaN NaN NaN
+## log_beta 15.54 NaN NaN NaN
+## sigma 2.78 0.4607 1.792 3.768
##
## Parameter correlation:
-## parent_0 log_alpha log_beta sigma
-## parent_0 1.0000000 NaN NaN 0.0001671
-## log_alpha NaN 1 NaN NaN
-## log_beta NaN NaN 1 NaN
-## sigma 0.0001671 NaN NaN 1.0000000
+## parent_0 log_alpha log_beta sigma
+## parent_0 1.000000 NaN NaN 0.000603
+## log_alpha NaN 1 NaN NaN
+## log_beta NaN NaN 1 NaN
+## sigma 0.000603 NaN NaN 1.000000
##
## Backtransformed parameters:
## Confidence intervals for internally transformed parameters are asymmetric.
@@ -337,9 +337,9 @@ objects.
## for estimators of untransformed parameters.
## Estimate t value Pr(>t) Lower Upper
## parent_0 9.247e+01 NA NA 89.720 95.220
-## alpha 9.658e+05 NA NA NA NA
-## beta 1.010e+07 NA NA NA NA
-## sigma 2.780e+00 NA NA 1.794 3.766
+## alpha 5.386e+05 NA NA NA NA
+## beta 5.633e+06 NA NA NA NA
+## sigma 2.780e+00 NA NA 1.792 3.768
##
## FOCUS Chi2 error levels in percent:
## err.min n.optim df
@@ -347,8 +347,8 @@ objects.
## 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
@@ -427,17 +427,17 @@ kinetics.
summary(m.L2.FOMC, data = FALSE)
-## mkin version used for fitting: 1.2.3
-## R version used for fitting: 4.2.3
-## Date of fit: Thu Apr 20 07:37:16 2023
-## Date of summary: Thu Apr 20 07:37:16 2023
+## mkin version used for fitting: 1.2.4
+## R version used for fitting: 4.3.0
+## Date of fit: Fri May 19 09:20:25 2023
+## Date of summary: Fri May 19 09:20:25 2023
##
## Equations:
## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
##
## Model predictions using solution type analytical
##
-## Fitted using 239 model solutions performed in 0.015 s
+## Fitted using 239 model solutions performed in 0.013 s
##
## Error model: Constant variance
##
@@ -472,10 +472,10 @@ kinetics.
##
## Parameter correlation:
## parent_0 log_alpha log_beta sigma
-## parent_0 1.000e+00 -1.151e-01 -2.085e-01 -7.828e-09
-## log_alpha -1.151e-01 1.000e+00 9.741e-01 -1.602e-07
-## log_beta -2.085e-01 9.741e-01 1.000e+00 -1.372e-07
-## sigma -7.828e-09 -1.602e-07 -1.372e-07 1.000e+00
+## parent_0 1.000e+00 -1.151e-01 -2.085e-01 -7.436e-09
+## log_alpha -1.151e-01 1.000e+00 9.741e-01 -1.617e-07
+## log_beta -2.085e-01 9.741e-01 1.000e+00 -1.386e-07
+## sigma -7.436e-09 -1.617e-07 -1.386e-07 1.000e+00
##
## Backtransformed parameters:
## Confidence intervals for internally transformed parameters are asymmetric.
@@ -511,10 +511,10 @@ the data.
summary(m.L2.DFOP, data = FALSE)
-## mkin version used for fitting: 1.2.3
-## R version used for fitting: 4.2.3
-## Date of fit: Thu Apr 20 07:37:16 2023
-## Date of summary: Thu Apr 20 07:37:16 2023
+## mkin version used for fitting: 1.2.4
+## R version used for fitting: 4.3.0
+## Date of fit: Fri May 19 09:20:25 2023
+## Date of summary: Fri May 19 09:20:25 2023
##
## Equations:
## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
@@ -523,7 +523,7 @@ the data.
##
## Model predictions using solution type analytical
##
-## Fitted using 581 model solutions performed in 0.04 s
+## Fitted using 581 model solutions performed in 0.038 s
##
## Error model: Constant variance
##
@@ -554,18 +554,18 @@ the data.
## Optimised, transformed parameters with symmetric confidence intervals:
## Estimate Std. Error Lower Upper
## parent_0 93.950 9.998e-01 91.5900 96.3100
-## log_k1 3.112 1.842e+03 -4353.0000 4359.0000
+## log_k1 3.113 1.849e+03 -4369.0000 4375.0000
## log_k2 -1.088 6.285e-02 -1.2370 -0.9394
## g_qlogis -0.399 9.946e-02 -0.6342 -0.1638
## sigma 1.414 2.886e-01 0.7314 2.0960
##
## Parameter correlation:
## parent_0 log_k1 log_k2 g_qlogis sigma
-## parent_0 1.000e+00 6.783e-07 -3.390e-10 2.665e-01 -2.967e-10
-## log_k1 6.783e-07 1.000e+00 1.116e-04 -2.196e-04 -1.031e-05
-## log_k2 -3.390e-10 1.116e-04 1.000e+00 -7.903e-01 2.917e-09
-## g_qlogis 2.665e-01 -2.196e-04 -7.903e-01 1.000e+00 -4.408e-09
-## sigma -2.967e-10 -1.031e-05 2.917e-09 -4.408e-09 1.000e+00
+## parent_0 1.000e+00 6.763e-07 -8.944e-10 2.665e-01 -1.083e-09
+## log_k1 6.763e-07 1.000e+00 1.112e-04 -2.187e-04 -1.027e-05
+## log_k2 -8.944e-10 1.112e-04 1.000e+00 -7.903e-01 9.464e-09
+## g_qlogis 2.665e-01 -2.187e-04 -7.903e-01 1.000e+00 -1.532e-08
+## sigma -1.083e-09 -1.027e-05 9.464e-09 -1.532e-08 1.000e+00
##
## Backtransformed parameters:
## Confidence intervals for internally transformed parameters are asymmetric.
@@ -573,7 +573,7 @@ the data.
## for estimators of untransformed parameters.
## Estimate t value Pr(>t) Lower Upper
## parent_0 93.9500 9.397e+01 2.036e-12 91.5900 96.3100
-## k1 22.4800 5.553e-04 4.998e-01 0.0000 Inf
+## k1 22.4900 5.533e-04 4.998e-01 0.0000 Inf
## k2 0.3369 1.591e+01 4.697e-07 0.2904 0.3909
## g 0.4016 1.680e+01 3.238e-07 0.3466 0.4591
## sigma 1.4140 4.899e+00 8.776e-04 0.7314 2.0960
@@ -585,7 +585,7 @@ the data.
##
## Estimated disappearance times:
## DT50 DT90 DT50back DT50_k1 DT50_k2
-## parent 0.5335 5.311 1.599 0.03084 2.058
+## parent 0.5335 5.311 1.599 0.03083 2.058
Here, the DFOP model is clearly the best-fit model for dataset L2
based on the chi^2 error level criterion.
@@ -628,10 +628,10 @@ 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 used for fitting: 1.2.3
-## R version used for fitting: 4.2.3
-## Date of fit: Thu Apr 20 07:37:17 2023
-## Date of summary: Thu Apr 20 07:37:17 2023
+## mkin version used for fitting: 1.2.4
+## R version used for fitting: 4.3.0
+## Date of fit: Fri May 19 09:20:26 2023
+## Date of summary: Fri May 19 09:20:26 2023
##
## Equations:
## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
@@ -640,7 +640,7 @@ summary and plot functions working on mkinfit objects.
##
## Model predictions using solution type analytical
##
-## Fitted using 376 model solutions performed in 0.024 s
+## Fitted using 376 model solutions performed in 0.021 s
##
## Error model: Constant variance
##
@@ -678,11 +678,11 @@ summary and plot functions working on mkinfit objects.
##
## Parameter correlation:
## parent_0 log_k1 log_k2 g_qlogis sigma
-## parent_0 1.000e+00 1.732e-01 2.282e-02 4.009e-01 -9.664e-08
-## log_k1 1.732e-01 1.000e+00 4.945e-01 -5.809e-01 7.147e-07
+## parent_0 1.000e+00 1.732e-01 2.282e-02 4.009e-01 -9.696e-08
+## log_k1 1.732e-01 1.000e+00 4.945e-01 -5.809e-01 7.148e-07
## log_k2 2.282e-02 4.945e-01 1.000e+00 -6.812e-01 1.022e-06
-## g_qlogis 4.009e-01 -5.809e-01 -6.812e-01 1.000e+00 -7.926e-07
-## sigma -9.664e-08 7.147e-07 1.022e-06 -7.926e-07 1.000e+00
+## g_qlogis 4.009e-01 -5.809e-01 -6.812e-01 1.000e+00 -7.930e-07
+## sigma -9.696e-08 7.148e-07 1.022e-06 -7.930e-07 1.000e+00
##
## Backtransformed parameters:
## Confidence intervals for internally transformed parameters are asymmetric.
@@ -755,17 +755,17 @@ passes is slightly lower for the FOMC model. However, the difference
appears negligible.
summary(mm.L4[["SFO", 1]], data = FALSE)
-## mkin version used for fitting: 1.2.3
-## R version used for fitting: 4.2.3
-## Date of fit: Thu Apr 20 07:37:17 2023
-## Date of summary: Thu Apr 20 07:37:17 2023
+## mkin version used for fitting: 1.2.4
+## R version used for fitting: 4.3.0
+## Date of fit: Fri May 19 09:20:26 2023
+## Date of summary: Fri May 19 09:20:26 2023
##
## Equations:
## d_parent/dt = - k_parent * parent
##
## Model predictions using solution type analytical
##
-## Fitted using 142 model solutions performed in 0.009 s
+## Fitted using 142 model solutions performed in 0.008 s
##
## Error model: Constant variance
##
@@ -797,9 +797,9 @@ appears negligible.
##
## Parameter correlation:
## parent_0 log_k_parent sigma
-## parent_0 1.000e+00 5.938e-01 3.387e-07
-## log_k_parent 5.938e-01 1.000e+00 5.830e-07
-## sigma 3.387e-07 5.830e-07 1.000e+00
+## parent_0 1.000e+00 5.938e-01 3.430e-07
+## log_k_parent 5.938e-01 1.000e+00 5.885e-07
+## sigma 3.430e-07 5.885e-07 1.000e+00
##
## Backtransformed parameters:
## Confidence intervals for internally transformed parameters are asymmetric.
@@ -820,17 +820,17 @@ appears negligible.
## parent 106 352
summary(mm.L4[["FOMC", 1]], data = FALSE)
-## mkin version used for fitting: 1.2.3
-## R version used for fitting: 4.2.3
-## Date of fit: Thu Apr 20 07:37:17 2023
-## Date of summary: Thu Apr 20 07:37:17 2023
+## mkin version used for fitting: 1.2.4
+## R version used for fitting: 4.3.0
+## Date of fit: Fri May 19 09:20:26 2023
+## Date of summary: Fri May 19 09:20:26 2023
##
## Equations:
## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
##
## Model predictions using solution type analytical
##
-## Fitted using 224 model solutions performed in 0.014 s
+## Fitted using 224 model solutions performed in 0.012 s
##
## Error model: Constant variance
##
@@ -865,10 +865,10 @@ appears negligible.
##
## Parameter correlation:
## parent_0 log_alpha log_beta sigma
-## parent_0 1.000e+00 -4.696e-01 -5.543e-01 -2.468e-07
-## log_alpha -4.696e-01 1.000e+00 9.889e-01 2.478e-08
-## log_beta -5.543e-01 9.889e-01 1.000e+00 5.211e-08
-## sigma -2.468e-07 2.478e-08 5.211e-08 1.000e+00
+## parent_0 1.000e+00 -4.696e-01 -5.543e-01 -2.447e-07
+## log_alpha -4.696e-01 1.000e+00 9.889e-01 2.198e-08
+## log_beta -5.543e-01 9.889e-01 1.000e+00 4.923e-08
+## sigma -2.447e-07 2.198e-08 4.923e-08 1.000e+00
##
## Backtransformed parameters:
## Confidence intervals for internally transformed parameters are asymmetric.
diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-10-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-10-1.png
index 11706305..c732be75 100644
Binary files a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-10-1.png and b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-10-1.png differ
diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-6-1.png
index c3f55dd6..dfeb7907 100644
Binary files a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/docs/articles/index.html b/docs/articles/index.html
index 991f8994..7060b377 100644
--- a/docs/articles/index.html
+++ b/docs/articles/index.html
@@ -17,7 +17,7 @@
@@ -111,7 +111,7 @@
Example evaluation of FOCUS Laboratory Data L1 to L3
- Introduction to mkin
+ Short introduction to mkin
Testing hierarchical pathway kinetics with residue data on cyantraniliprole
diff --git a/docs/articles/mkin.html b/docs/articles/mkin.html
index 88c63bef..6213916b 100644
--- a/docs/articles/mkin.html
+++ b/docs/articles/mkin.html
@@ -5,13 +5,13 @@
-Introduction to mkin • mkin
+Short introduction to mkin • mkin
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+@media print {
+pre > code.sourceCode { white-space: pre-wrap; }
+pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
+}
+pre.numberSource code
+ { counter-reset: source-line 0; }
+pre.numberSource code > span
+ { position: relative; left: -4em; counter-increment: source-line; }
+pre.numberSource code > span > a:first-child::before
+ { content: counter(source-line);
+ position: relative; left: -1em; text-align: right; vertical-align: baseline;
+ border: none; display: inline-block;
+ -webkit-touch-callout: none; -webkit-user-select: none;
+ -khtml-user-select: none; -moz-user-select: none;
+ -ms-user-select: none; user-select: none;
+ padding: 0 4px; width: 4em;
+ color: #aaaaaa;
+ }
+pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
+div.sourceCode
+ { }
+@media screen {
+pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
+}
+code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+code span.at { color: #7d9029; } /* Attribute */
+code span.bn { color: #40a070; } /* BaseN */
+code span.bu { color: #008000; } /* BuiltIn */
+code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+code span.ch { color: #4070a0; } /* Char */
+code span.cn { color: #880000; } /* Constant */
+code span.co { color: #60a0b0; font-style: italic; } /* Comment */
+code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+code span.dt { color: #902000; } /* DataType */
+code span.dv { color: #40a070; } /* DecVal */
+code span.er { color: #ff0000; font-weight: bold; } /* Error */
+code span.ex { } /* Extension */
+code span.fl { color: #40a070; } /* Float */
+code span.fu { color: #06287e; } /* Function */
+code span.im { color: #008000; font-weight: bold; } /* Import */
+code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+code span.op { color: #666666; } /* Operator */
+code span.ot { color: #007020; } /* Other */
+code span.pp { color: #bc7a00; } /* Preprocessor */
+code span.sc { color: #4070a0; } /* SpecialChar */
+code span.ss { color: #bb6688; } /* SpecialString */
+code span.st { color: #4070a0; } /* String */
+code span.va { color: #19177c; } /* Variable */
+code span.vs { color: #4070a0; } /* VerbatimString */
+code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+
+
@@ -1350,206 +169,234 @@ div.csl-indent {
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Example evaluation of FOCUS Laboratory Data
L1 to L3
Johannes Ranke
-Last change 18 May 2022 (rebuilt 2023-02-17)
-
+Last change 18 May 2023 (rebuilt 2023-05-18)
+
+
+
+
-
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)
+= data.frame(
+ FOCUS_2006_L1 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))
+ <- mkin_wide_to_long(FOCUS_2006_L1) FOCUS_2006_L1_mkin
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
@@ -1559,12 +406,12 @@ 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 used for fitting: 1.2.2
-## R version used for fitting: 4.2.2
-## Date of fit: Fri Feb 17 20:04:32 2023
-## Date of summary: Fri Feb 17 20:04:32 2023
+<- mkinfit("SFO", FOCUS_2006_L1_mkin, quiet = TRUE)
+ m.L1.SFO summary(m.L1.SFO)
+## mkin version used for fitting: 1.2.4
+## R version used for fitting: 4.3.0
+## Date of fit: Thu May 18 11:38:11 2023
+## Date of summary: Thu May 18 11:38:11 2023
##
## Equations:
## d_parent/dt = - k_parent * parent
@@ -1647,27 +494,27 @@ summary(m.L1.SFO)
## 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 χ2 error level is
checked.
-m.L1.FOMC <- mkinfit("FOMC", FOCUS_2006_L1_mkin, quiet=TRUE)
+<- mkinfit("FOMC", FOCUS_2006_L1_mkin, quiet=TRUE) m.L1.FOMC
## Warning in mkinfit("FOMC", FOCUS_2006_L1_mkin, quiet = TRUE): Optimisation did not converge:
## false convergence (8)
-plot(m.L1.FOMC, show_errmin = TRUE, main = "FOCUS L1 - FOMC")
+plot(m.L1.FOMC, show_errmin = TRUE, main = "FOCUS L1 - FOMC")
-summary(m.L1.FOMC, data = FALSE)
+summary(m.L1.FOMC, data = FALSE)
## Warning in sqrt(diag(covar)): NaNs produced
## Warning in sqrt(1/diag(V)): NaNs produced
-## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result is
-## doubtful
-## mkin version used for fitting: 1.2.2
-## R version used for fitting: 4.2.2
-## Date of fit: Fri Feb 17 20:04:32 2023
-## Date of summary: Fri Feb 17 20:04:32 2023
+## Warning in cov2cor(ans$covar): diag(.) had 0 or NA entries; non-finite result
+## is doubtful
+## mkin version used for fitting: 1.2.4
+## R version used for fitting: 4.3.0
+## Date of fit: Thu May 18 11:38:11 2023
+## Date of summary: Thu May 18 11:38:11 2023
##
## Equations:
## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
@@ -1771,20 +618,20 @@ sponsored by the German Umweltbundesamt (Ranke
Laboratory Data L2
The following code defines example dataset L2 from the FOCUS kinetics
report, p. 287:
-FOCUS_2006_L2 = data.frame(
- t = rep(c(0, 1, 3, 7, 14, 28), each = 2),
- parent = c(96.1, 91.8, 41.4, 38.7,
- 19.3, 22.3, 4.6, 4.6,
- 2.6, 1.2, 0.3, 0.6))
-FOCUS_2006_L2_mkin <- mkin_wide_to_long(FOCUS_2006_L2)
+= data.frame(
+ FOCUS_2006_L2 t = rep(c(0, 1, 3, 7, 14, 28), each = 2),
+ parent = c(96.1, 91.8, 41.4, 38.7,
+ 19.3, 22.3, 4.6, 4.6,
+ 2.6, 1.2, 0.3, 0.6))
+ <- mkin_wide_to_long(FOCUS_2006_L2) FOCUS_2006_L2_mkin
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")
+<- mkinfit("SFO", FOCUS_2006_L2_mkin, quiet=TRUE)
+ m.L2.SFO plot(m.L2.SFO, show_residuals = TRUE, show_errmin = TRUE,
+main = "FOCUS L2 - SFO")
The χ2 error
level of 14% suggests that the model does not fit very well. This is
@@ -1805,22 +652,22 @@ kinetics.
FOMC fit for L2
For comparison, the FOMC model is fitted as well, and the χ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")
+<- mkinfit("FOMC", FOCUS_2006_L2_mkin, quiet = TRUE)
+ m.L2.FOMC plot(m.L2.FOMC, show_residuals = TRUE,
+main = "FOCUS L2 - FOMC")
-summary(m.L2.FOMC, data = FALSE)
-## mkin version used for fitting: 1.2.2
-## R version used for fitting: 4.2.2
-## Date of fit: Fri Feb 17 20:04:32 2023
-## Date of summary: Fri Feb 17 20:04:32 2023
+summary(m.L2.FOMC, data = FALSE)
+## mkin version used for fitting: 1.2.4
+## R version used for fitting: 4.3.0
+## Date of fit: Thu May 18 11:38:11 2023
+## Date of summary: Thu May 18 11:38:11 2023
##
## Equations:
## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
##
## Model predictions using solution type analytical
##
-## Fitted using 239 model solutions performed in 0.014 s
+## Fitted using 239 model solutions performed in 0.015 s
##
## Error model: Constant variance
##
@@ -1886,15 +733,15 @@ order to explain the data.
DFOP fit for L2
Fitting the four parameter DFOP model further reduces the χ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")
+<- mkinfit("DFOP", FOCUS_2006_L2_mkin, quiet = TRUE)
+ m.L2.DFOP plot(m.L2.DFOP, show_residuals = TRUE, show_errmin = TRUE,
+main = "FOCUS L2 - DFOP")
-summary(m.L2.DFOP, data = FALSE)
-## mkin version used for fitting: 1.2.2
-## R version used for fitting: 4.2.2
-## Date of fit: Fri Feb 17 20:04:32 2023
-## Date of summary: Fri Feb 17 20:04:32 2023
+summary(m.L2.DFOP, data = FALSE)
+## mkin version used for fitting: 1.2.4
+## R version used for fitting: 4.3.0
+## Date of fit: Thu May 18 11:38:11 2023
+## Date of summary: Thu May 18 11:38:11 2023
##
## Equations:
## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
@@ -1903,7 +750,7 @@ plot(m.L2.DFOP, show_residuals = TRUE, show_errmin = TRUE,
##
## Model predictions using solution type analytical
##
-## Fitted using 581 model solutions performed in 0.039 s
+## Fitted using 581 model solutions performed in 0.041 s
##
## Error model: Constant variance
##
@@ -1974,21 +821,21 @@ based on the chi^2 error level criterion.
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)
+= data.frame(
+ FOCUS_2006_L3 t = c(0, 3, 7, 14, 30, 60, 91, 120),
+ parent = c(97.8, 60, 51, 43, 35, 22, 15, 12))
+ <- mkin_wide_to_long(FOCUS_2006_L3) FOCUS_2006_L3_mkin
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
+<- mmkin(c("SFO", "FOMC", "DFOP"), cores = 1,
+ mm.L3 list("FOCUS L3" = FOCUS_2006_L3_mkin), quiet = TRUE)
+ plot(mm.L3)
+
The χ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
@@ -2003,11 +850,11 @@ 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 used for fitting: 1.2.2
-## R version used for fitting: 4.2.2
-## Date of fit: Fri Feb 17 20:04:33 2023
-## Date of summary: Fri Feb 17 20:04:33 2023
+summary(mm.L3[["DFOP", 1]])
+## mkin version used for fitting: 1.2.4
+## R version used for fitting: 4.3.0
+## Date of fit: Thu May 18 11:38:12 2023
+## Date of summary: Thu May 18 11:38:12 2023
##
## Equations:
## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
@@ -2016,7 +863,7 @@ summary and plot functions working on mkinfit objects.
##
## Model predictions using solution type analytical
##
-## Fitted using 376 model solutions performed in 0.023 s
+## Fitted using 376 model solutions performed in 0.024 s
##
## Error model: Constant variance
##
@@ -2090,8 +937,8 @@ summary and plot functions working on mkinfit objects.
## 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
@@ -2108,35 +955,35 @@ parameter g
is quite narrow.
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)
+= data.frame(
+ FOCUS_2006_L4 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))
+ <- mkin_wide_to_long(FOCUS_2006_L4) FOCUS_2006_L4_mkin
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
+<- mmkin(c("SFO", "FOMC"), cores = 1,
+ mm.L4 list("FOCUS L4" = FOCUS_2006_L4_mkin),
+ quiet = TRUE)
+ 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 used for fitting: 1.2.2
-## R version used for fitting: 4.2.2
-## Date of fit: Fri Feb 17 20:04:33 2023
-## Date of summary: Fri Feb 17 20:04:33 2023
+summary(mm.L4[["SFO", 1]], data = FALSE)
+## mkin version used for fitting: 1.2.4
+## R version used for fitting: 4.3.0
+## Date of fit: Thu May 18 11:38:12 2023
+## Date of summary: Thu May 18 11:38:12 2023
##
## Equations:
## d_parent/dt = - k_parent * parent
##
## Model predictions using solution type analytical
##
-## Fitted using 142 model solutions performed in 0.008 s
+## Fitted using 142 model solutions performed in 0.01 s
##
## Error model: Constant variance
##
@@ -2189,11 +1036,11 @@ negligible.
## Estimated disappearance times:
## DT50 DT90
## parent 106 352
-summary(mm.L4[["FOMC", 1]], data = FALSE)
-## mkin version used for fitting: 1.2.2
-## R version used for fitting: 4.2.2
-## Date of fit: Fri Feb 17 20:04:33 2023
-## Date of summary: Fri Feb 17 20:04:33 2023
+summary(mm.L4[["FOMC", 1]], data = FALSE)
+## mkin version used for fitting: 1.2.4
+## R version used for fitting: 4.3.0
+## Date of fit: Thu May 18 11:38:12 2023
+## Date of summary: Thu May 18 11:38:12 2023
##
## Equations:
## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
@@ -2272,69 +1119,8 @@ Validierung von Modellierungssoftware als Alternative zu ModelMaker
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/vignettes/FOCUS_L.rmd b/vignettes/FOCUS_L.rmd
index 2dafa74d..69105e92 100644
--- a/vignettes/FOCUS_L.rmd
+++ b/vignettes/FOCUS_L.rmd
@@ -1,14 +1,11 @@
---
title: "Example evaluation of FOCUS Laboratory Data L1 to L3"
author: "Johannes Ranke"
-date: Last change 18 May 2022 (rebuilt `r Sys.Date()`)
+date: Last change 18 May 2023 (rebuilt `r Sys.Date()`)
output:
- html_document:
+ html_vignette:
toc: true
- toc_float:
- collapsed: false
mathjax: null
- fig_retina: null
references:
- id: ranke2014
title: Prüfung und Validierung von Modellierungssoftware als Alternative zu
diff --git a/vignettes/mkin.html b/vignettes/mkin.html
index a16f3074..12b8671e 100644
--- a/vignettes/mkin.html
+++ b/vignettes/mkin.html
@@ -8,1376 +8,36 @@
+
-
-
-
-Introduction to mkin
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+@media print {
+pre > code.sourceCode { white-space: pre-wrap; }
+pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
+}
+pre.numberSource code
+ { counter-reset: source-line 0; }
+pre.numberSource code > span
+ { position: relative; left: -4em; counter-increment: source-line; }
+pre.numberSource code > span > a:first-child::before
+ { content: counter(source-line);
+ position: relative; left: -1em; text-align: right; vertical-align: baseline;
+ border: none; display: inline-block;
+ -webkit-touch-callout: none; -webkit-user-select: none;
+ -khtml-user-select: none; -moz-user-select: none;
+ -ms-user-select: none; user-select: none;
+ padding: 0 4px; width: 4em;
+ color: #aaaaaa;
+ }
+pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
+div.sourceCode
+ { }
+@media screen {
+pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
+}
+code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+code span.at { color: #7d9029; } /* Attribute */
+code span.bn { color: #40a070; } /* BaseN */
+code span.bu { color: #008000; } /* BuiltIn */
+code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+code span.ch { color: #4070a0; } /* Char */
+code span.cn { color: #880000; } /* Constant */
+code span.co { color: #60a0b0; font-style: italic; } /* Comment */
+code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+code span.dt { color: #902000; } /* DataType */
+code span.dv { color: #40a070; } /* DecVal */
+code span.er { color: #ff0000; font-weight: bold; } /* Error */
+code span.ex { } /* Extension */
+code span.fl { color: #40a070; } /* Float */
+code span.fu { color: #06287e; } /* Function */
+code span.im { color: #008000; font-weight: bold; } /* Import */
+code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+code span.op { color: #666666; } /* Operator */
+code span.ot { color: #007020; } /* Other */
+code span.pp { color: #bc7a00; } /* Preprocessor */
+code span.sc { color: #4070a0; } /* SpecialChar */
+code span.ss { color: #bb6688; } /* SpecialString */
+code span.st { color: #4070a0; } /* String */
+code span.va { color: #19177c; } /* Variable */
+code span.vs { color: #4070a0; } /* VerbatimString */
+code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+
+
@@ -1426,199 +178,223 @@ div.csl-indent {
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+Short introduction to mkin
+Johannes Ranke
+Last change 18 May 2023 (rebuilt 2023-05-19)
-
-
-
-
-
-
Wissenschaftlicher Berater, Kronacher
Str. 12, 79639 Grenzach-Wyhlen, Germany
Privatdozent at the
University of Freiburg
@@ -1633,34 +409,36 @@ nonlinear optimisation. The R
add-on package
this guidance from within R and calculates some statistical measures for
data series within one or more compartments, for parent and
metabolites.
-library("mkin", quietly = TRUE)
-# Define the kinetic model
-m_SFO_SFO_SFO <- mkinmod(parent = mkinsub("SFO", "M1"),
- M1 = mkinsub("SFO", "M2"),
- M2 = mkinsub("SFO"),
- use_of_ff = "max", quiet = TRUE)
-
-
-# Produce model predictions using some arbitrary parameters
-sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
-d_SFO_SFO_SFO <- mkinpredict(m_SFO_SFO_SFO,
- c(k_parent = 0.03,
- f_parent_to_M1 = 0.5, k_M1 = log(2)/100,
- f_M1_to_M2 = 0.9, k_M2 = log(2)/50),
- c(parent = 100, M1 = 0, M2 = 0),
- sampling_times)
-
-# Generate a dataset by adding normally distributed errors with
-# standard deviation 3, for two replicates at each sampling time
-d_SFO_SFO_SFO_err <- add_err(d_SFO_SFO_SFO, reps = 2,
- sdfunc = function(x) 3,
- n = 1, seed = 123456789 )
-
-# Fit the model to the dataset
-f_SFO_SFO_SFO <- mkinfit(m_SFO_SFO_SFO, d_SFO_SFO_SFO_err[[1]], quiet = TRUE)
-
-# Plot the results separately for parent and metabolites
-plot_sep(f_SFO_SFO_SFO, lpos = c("topright", "bottomright", "bottomright"))
+Code
+library("mkin", quietly = TRUE)
+# Define the kinetic model
+<- mkinmod(parent = mkinsub("SFO", "M1"),
+ m_SFO_SFO_SFO M1 = mkinsub("SFO", "M2"),
+ M2 = mkinsub("SFO"),
+ use_of_ff = "max", quiet = TRUE)
+
+
+# Produce model predictions using some arbitrary parameters
+= c(0, 1, 3, 7, 14, 28, 60, 90, 120)
+ sampling_times <- mkinpredict(m_SFO_SFO_SFO,
+ d_SFO_SFO_SFO c(k_parent = 0.03,
+ f_parent_to_M1 = 0.5, k_M1 = log(2)/100,
+ f_M1_to_M2 = 0.9, k_M2 = log(2)/50),
+ c(parent = 100, M1 = 0, M2 = 0),
+
+ sampling_times)
+# Generate a dataset by adding normally distributed errors with
+# standard deviation 3, for two replicates at each sampling time
+<- add_err(d_SFO_SFO_SFO, reps = 2,
+ d_SFO_SFO_SFO_err sdfunc = function(x) 3,
+ n = 1, seed = 123456789 )
+
+# Fit the model to the dataset
+<- mkinfit(m_SFO_SFO_SFO, d_SFO_SFO_SFO_err[[1]], quiet = TRUE)
+ f_SFO_SFO_SFO
+# Plot the results separately for parent and metabolites
+plot_sep(f_SFO_SFO_SFO, lpos = c("topright", "bottomright", "bottomright"))
+
@@ -1906,74 +684,8 @@ Sensitivity and Monte Carlo Analysis in R Using Package
-
-
-
-
-
-
-
-
-
-
-
-
-
-