From cf54ccca37d27480dbf8d59eb027300518f7ad75 Mon Sep 17 00:00:00 2001
From: Johannes Ranke Example evaluation of FOCUS Example Dataset
D
Johannes Ranke
-Last change 31 January 2019 (rebuilt 2023-02-17)
+Last change 31 January 2019 (rebuilt 2023-05-18)
@@ -434,8 +434,8 @@ be compiled from auto-generated C code.
We do the fitting without progress report
(quiet = TRUE
).
fit <- mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE)
-## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE): Observations with value
-## of zero were removed from the data
+## Warning in mkinfit(SFO_SFO, FOCUS_2006_D, quiet = TRUE): Observations with
+## value of zero were removed from the data
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
@@ -449,10 +449,10 @@ the mkinparplot
function.
A comprehensive report of the results is obtained using the
summary
method for mkinfit
objects.
summary(fit)
-## mkin version used for fitting: 1.2.2
-## R version used for fitting: 4.2.2
-## Date of fit: Fri Feb 17 20:04:31 2023
-## Date of summary: Fri Feb 17 20:04:31 2023
+## mkin version used for fitting: 1.2.4
+## R version used for fitting: 4.3.0
+## Date of fit: Thu May 18 11:39:03 2023
+## Date of summary: Thu May 18 11:39:03 2023
##
## Equations:
## d_parent/dt = - k_parent * parent
@@ -460,7 +460,7 @@ the mkinparplot
function.
##
## Model predictions using solution type analytical
##
-## Fitted using 401 model solutions performed in 0.048 s
+## Fitted using 401 model solutions performed in 0.053 s
##
## Error model: Constant variance
##
diff --git a/vignettes/FOCUS_L.html b/vignettes/FOCUS_L.html
index ed150c0a..bd1fa16e 100644
--- a/vignettes/FOCUS_L.html
+++ b/vignettes/FOCUS_L.html
@@ -8,1299 +8,26 @@
+
-
-
-
-Example evaluation of FOCUS Laboratory Data L1 to L3
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+@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
-
-
-
-
-
-
-
-
-
-
-
-
-
-