aboutsummaryrefslogtreecommitdiff
path: root/docs/articles/mkin.html
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-10-15 12:53:23 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2020-10-15 12:53:23 +0200
commit5b1179f0daff9077e1370065f9b9f03a2d0e0450 (patch)
tree01f30f5763c279b942458843939d4f02be6ca455 /docs/articles/mkin.html
parent272aba066f0d7502e319b7e7f14009318cd44348 (diff)
Update online docs for release version
Diffstat (limited to 'docs/articles/mkin.html')
-rw-r--r--docs/articles/mkin.html60
1 files changed, 32 insertions, 28 deletions
diff --git a/docs/articles/mkin.html b/docs/articles/mkin.html
index 5f858d57..0c417f13 100644
--- a/docs/articles/mkin.html
+++ b/docs/articles/mkin.html
@@ -31,7 +31,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">mkin</a>
- <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.2</span>
+ <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.9.50.3</span>
</span>
</div>
@@ -68,6 +68,9 @@
<li>
<a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a>
</li>
+ <li>
+ <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a>
+ </li>
</ul>
</li>
<li>
@@ -76,7 +79,7 @@
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
- <a href="http://github.com/jranke/mkin/">
+ <a href="https://github.com/jranke/mkin/">
<span class="fab fa fab fa-github fa-lg"></span>
</a>
@@ -97,49 +100,50 @@
<h1 data-toc-skip>Introduction to mkin</h1>
<h4 class="author">Johannes Ranke</h4>
- <h4 class="date">2020-05-27</h4>
+ <h4 class="date">2020-10-15</h4>
- <small class="dont-index">Source: <a href="http://github.com/jranke/mkin/blob/master/vignettes/mkin.Rmd"><code>vignettes/mkin.Rmd</code></a></small>
- <div class="hidden name"><code>mkin.Rmd</code></div>
+ <small class="dont-index">Source: <a href="https://github.com/jranke/mkin/blob/master/vignettes/mkin.rmd"><code>vignettes/mkin.rmd</code></a></small>
+ <div class="hidden name"><code>mkin.rmd</code></div>
</div>
-<p><a href="http://www.jrwb.de">Wissenschaftlicher Berater, Kronacher Str. 12, 79639 Grenzach-Wyhlen, Germany</a><br><a href="http://chem.uft.uni-bremen.de/ranke">Privatdozent at the University of Bremen</a></p>
+<p><a href="https://www.jrwb.de">Wissenschaftlicher Berater, Kronacher Str. 12, 79639 Grenzach-Wyhlen, Germany</a><br><a href="http://chem.uft.uni-bremen.de/ranke/">Privatdozent at the University of Bremen</a></p>
<div id="abstract" class="section level1">
<h1 class="hasAnchor">
<a href="#abstract" class="anchor"></a>Abstract</h1>
<p>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 <code>R</code> add-on package <code>mkin</code> 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.</p>
-<div class="sourceCode" id="cb1"><html><body><pre class="r"><span class="fu"><a href="https://rdrr.io/r/base/library.html">library</a></span>(<span class="st">"mkin"</span>, <span class="kw">quietly</span> <span class="kw">=</span> <span class="fl">TRUE</span>)
+<div class="sourceCode" id="cb1"><pre class="downlit">
+<span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="st"><a href="https://pkgdown.jrwb.de/mkin/">"mkin"</a></span>, quietly <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span>
<span class="co"># Define the kinetic model</span>
-<span class="no">m_SFO_SFO_SFO</span> <span class="kw">&lt;-</span> <span class="fu"><a href="../reference/mkinmod.html">mkinmod</a></span>(<span class="kw">parent</span> <span class="kw">=</span> <span class="fu"><a href="../reference/mkinsub.html">mkinsub</a></span>(<span class="st">"SFO"</span>, <span class="st">"M1"</span>),
- <span class="kw">M1</span> <span class="kw">=</span> <span class="fu"><a href="../reference/mkinsub.html">mkinsub</a></span>(<span class="st">"SFO"</span>, <span class="st">"M2"</span>),
- <span class="kw">M2</span> <span class="kw">=</span> <span class="fu"><a href="../reference/mkinsub.html">mkinsub</a></span>(<span class="st">"SFO"</span>),
- <span class="kw">use_of_ff</span> <span class="kw">=</span> <span class="st">"max"</span>, <span class="kw">quiet</span> <span class="kw">=</span> <span class="fl">TRUE</span>)
+<span class="va">m_SFO_SFO_SFO</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>parent <span class="op">=</span> <span class="fu"><a href="../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M1"</span><span class="op">)</span>,
+ M1 <span class="op">=</span> <span class="fu"><a href="../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M2"</span><span class="op">)</span>,
+ M2 <span class="op">=</span> <span class="fu"><a href="../reference/mkinsub.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>,
+ use_of_ff <span class="op">=</span> <span class="st">"max"</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span>
<span class="co"># Produce model predictions using some arbitrary parameters</span>
-<span class="no">sampling_times</span> <span class="kw">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="fl">0</span>, <span class="fl">1</span>, <span class="fl">3</span>, <span class="fl">7</span>, <span class="fl">14</span>, <span class="fl">28</span>, <span class="fl">60</span>, <span class="fl">90</span>, <span class="fl">120</span>)
-<span class="no">d_SFO_SFO_SFO</span> <span class="kw">&lt;-</span> <span class="fu"><a href="../reference/mkinpredict.html">mkinpredict</a></span>(<span class="no">m_SFO_SFO_SFO</span>,
- <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="kw">k_parent</span> <span class="kw">=</span> <span class="fl">0.03</span>,
- <span class="kw">f_parent_to_M1</span> <span class="kw">=</span> <span class="fl">0.5</span>, <span class="kw">k_M1</span> <span class="kw">=</span> <span class="fu"><a href="https://rdrr.io/r/base/Log.html">log</a></span>(<span class="fl">2</span>)/<span class="fl">100</span>,
- <span class="kw">f_M1_to_M2</span> <span class="kw">=</span> <span class="fl">0.9</span>, <span class="kw">k_M2</span> <span class="kw">=</span> <span class="fu"><a href="https://rdrr.io/r/base/Log.html">log</a></span>(<span class="fl">2</span>)/<span class="fl">50</span>),
- <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="kw">parent</span> <span class="kw">=</span> <span class="fl">100</span>, <span class="kw">M1</span> <span class="kw">=</span> <span class="fl">0</span>, <span class="kw">M2</span> <span class="kw">=</span> <span class="fl">0</span>),
- <span class="no">sampling_times</span>)
+<span class="va">sampling_times</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fl">0</span>, <span class="fl">1</span>, <span class="fl">3</span>, <span class="fl">7</span>, <span class="fl">14</span>, <span class="fl">28</span>, <span class="fl">60</span>, <span class="fl">90</span>, <span class="fl">120</span><span class="op">)</span>
+<span class="va">d_SFO_SFO_SFO</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mkinpredict.html">mkinpredict</a></span><span class="op">(</span><span class="va">m_SFO_SFO_SFO</span>,
+ <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span>k_parent <span class="op">=</span> <span class="fl">0.03</span>,
+ f_parent_to_M1 <span class="op">=</span> <span class="fl">0.5</span>, k_M1 <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/Log.html">log</a></span><span class="op">(</span><span class="fl">2</span><span class="op">)</span><span class="op">/</span><span class="fl">100</span>,
+ f_M1_to_M2 <span class="op">=</span> <span class="fl">0.9</span>, k_M2 <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/Log.html">log</a></span><span class="op">(</span><span class="fl">2</span><span class="op">)</span><span class="op">/</span><span class="fl">50</span><span class="op">)</span>,
+ <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span>parent <span class="op">=</span> <span class="fl">100</span>, M1 <span class="op">=</span> <span class="fl">0</span>, M2 <span class="op">=</span> <span class="fl">0</span><span class="op">)</span>,
+ <span class="va">sampling_times</span><span class="op">)</span>
<span class="co"># Generate a dataset by adding normally distributed errors with</span>
<span class="co"># standard deviation 3, for two replicates at each sampling time</span>
-<span class="no">d_SFO_SFO_SFO_err</span> <span class="kw">&lt;-</span> <span class="fu"><a href="../reference/add_err.html">add_err</a></span>(<span class="no">d_SFO_SFO_SFO</span>, <span class="kw">reps</span> <span class="kw">=</span> <span class="fl">2</span>,
- <span class="kw">sdfunc</span> <span class="kw">=</span> <span class="kw">function</span>(<span class="no">x</span>) <span class="fl">3</span>,
- <span class="kw">n</span> <span class="kw">=</span> <span class="fl">1</span>, <span class="kw">seed</span> <span class="kw">=</span> <span class="fl">123456789</span> )
+<span class="va">d_SFO_SFO_SFO_err</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/add_err.html">add_err</a></span><span class="op">(</span><span class="va">d_SFO_SFO_SFO</span>, reps <span class="op">=</span> <span class="fl">2</span>,
+ sdfunc <span class="op">=</span> <span class="kw">function</span><span class="op">(</span><span class="va">x</span><span class="op">)</span> <span class="fl">3</span>,
+ n <span class="op">=</span> <span class="fl">1</span>, seed <span class="op">=</span> <span class="fl">123456789</span> <span class="op">)</span>
<span class="co"># Fit the model to the dataset</span>
-<span class="no">f_SFO_SFO_SFO</span> <span class="kw">&lt;-</span> <span class="fu"><a href="../reference/mkinfit.html">mkinfit</a></span>(<span class="no">m_SFO_SFO_SFO</span>, <span class="no">d_SFO_SFO_SFO_err</span><span class="kw">[[</span><span class="fl">1</span>]], <span class="kw">quiet</span> <span class="kw">=</span> <span class="fl">TRUE</span>)
+<span class="va">f_SFO_SFO_SFO</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">m_SFO_SFO_SFO</span>, <span class="va">d_SFO_SFO_SFO_err</span><span class="op">[[</span><span class="fl">1</span><span class="op">]</span><span class="op">]</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span>
<span class="co"># Plot the results separately for parent and metabolites</span>
-<span class="fu"><a href="../reference/plot.mkinfit.html">plot_sep</a></span>(<span class="no">f_SFO_SFO_SFO</span>, <span class="kw">lpos</span> <span class="kw">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span>(<span class="st">"topright"</span>, <span class="st">"bottomright"</span>, <span class="st">"bottomright"</span>))</pre></body></html></div>
-<p><img src="../docs/articles/mkin_files/figure-html/unnamed-chunk-2-1.png" width="768"></p>
+<span class="fu"><a href="../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">f_SFO_SFO_SFO</span>, lpos <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"topright"</span>, <span class="st">"bottomright"</span>, <span class="st">"bottomright"</span><span class="op">)</span><span class="op">)</span></pre></div>
+<p><img src="mkin_files/figure-html/unnamed-chunk-2-1.png" width="768"></p>
</div>
<div id="background" class="section level1">
<h1 class="hasAnchor">
@@ -147,7 +151,7 @@
<p>Many approaches are possible regarding the evaluation of chemical degradation data.</p>
<p>The <code>mkin</code> package <span class="citation">(Ranke 2019)</span> implements the approach recommended in the kinetics report provided by the FOrum for Co-ordination of pesticide fate models and their USe <span class="citation">(FOCUS Work Group on Degradation Kinetics 2006, 2014)</span> for simple decline data series, data series with transformation products, commonly termed metabolites, and for data series for 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.</p>
<p>When the first <code>mkin</code> code was published in 2010, the most commonly used tools for fitting more complex kinetic degradation models to experimental data were KinGUI <span class="citation">(Schäfer et al. 2007)</span>, 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.</p>
-<p>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 (see <em>e.g.</em> <a href="http://cgit.jrwb.de/mkin/commit/?id=30cbb4092f6d2d3beff5800603374a0d009ad770">the initial commit on 11 May 2010</a>), where the code is still occasionally updated.</p>
+<p>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 (see <em>e.g.</em> <a href="https://cgit.jrwb.de/mkin/commit/?id=30cbb4092f6d2d3beff5800603374a0d009ad770">the initial commit on 11 May 2010</a>), where the code is still occasionally updated.</p>
<p>At that time, the R package <code>FME</code> (Flexible Modelling Environment) <span class="citation">(Soetaert and Petzoldt 2010)</span> was already available, and provided a good basis for developing a package specifically tailored to the task. The remaining challenge was to make it as easy as possible for the users (including the author of this vignette) to specify the system of differential equations and to include the output requested by the FOCUS guidance, such as the relative standard deviation that has to be assumed for the residuals, such that the <span class="math inline">\(\chi^2\)</span> goodness-of-fit test as defined by the FOCUS kinetics workgroup would pass using an significance level <span class="math inline">\(\alpha\)</span> of 0.05. This relative error, expressed as a percentage, is often termed <span class="math inline">\(\chi^2\)</span> error level or similar.</p>
<p>Also, <code>mkin</code> introduced using analytical solutions for parent only kinetics for improved optimization speed. Later, Eigenvalue based solutions were introduced to <code>mkin</code> for the case of linear differential equations (<em>i.e.</em> where the FOMC or DFOP models were not used for the parent compound), greatly improving the optimization speed for these cases. This, however, has become somehow obsolete, as the use of compiled code described below gives even smaller execution times.</p>
<p>The possibility to specify back-reactions and a biphasic model (SFORB) for metabolites were present in <code>mkin</code> from the very beginning.</p>
@@ -157,7 +161,7 @@
<p>Soon after the publication of <code>mkin</code>, two derived tools were published, namely KinGUII (available from Bayer Crop Science) and CAKE (commissioned to Tessella by Syngenta), which added a graphical user interface (GUI), and added fitting by iteratively reweighted least squares (IRLS) and characterisation of likely parameter distributions by Markov Chain Monte Carlo (MCMC) sampling.</p>
<p>CAKE focuses on a smooth use experience, sacrificing some flexibility in the model definition, originally allowing only two primary metabolites in parallel. The current version 3.3 of CAKE release in March 2016 uses a basic scheme for up to six metabolites in a flexible arrangement, but does not support back-reactions (non-instantaneous equilibria) or biphasic kinetics for metabolites.</p>
<p>KinGUI offers an even more flexible widget for specifying complex kinetic models. Back-reactions (non-instantaneous equilibria) were supported early on, but until 2014, only simple first-order models could be specified for transformation products. Starting with KinGUII version 2.1, biphasic modelling of metabolites was also available in KinGUII.</p>
-<p>A further graphical user interface (GUI) that has recently been brought to a decent degree of maturity is the browser based GUI named <code>gmkin</code>. Please see its <a href="https://pkgdown.jrwb.de/gmkin">documentation page</a> and <a href="https://pkgdown.jrwb.de/gmkin/articles/gmkin_manual.html">manual</a> for further information.</p>
+<p>A further graphical user interface (GUI) that has recently been brought to a decent degree of maturity is the browser based GUI named <code>gmkin</code>. Please see its <a href="https://pkgdown.jrwb.de/gmkin/">documentation page</a> and <a href="https://pkgdown.jrwb.de/gmkin/articles/gmkin_manual.html">manual</a> for further information.</p>
<p>A comparison of scope, usability and numerical results obtained with these tools has been recently been published by <span class="citation">Ranke, Wöltjen, and Meinecke (2018)</span>.</p>
</div>
<div id="recent-developments" class="section level2">
@@ -223,7 +227,7 @@
<p>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 <em>Proceedings of the Xiii Symposium Pesticide Chemistry</em>, edited by Del Re A. A. M., Capri E., Fragoulis G., and Trevisan M., 916–23. Piacenza.</p>
</div>
<div id="ref-soetaert2010">
-<p>Soetaert, Karline, and Thomas Petzoldt. 2010. “Inverse Modelling, Sensitivity and Monte Carlo Analysis in R Using Package FME.” <em>Journal of Statistical Software</em> 33 (3): 1–28. <a href="http://www.jstatsoft.org/v33/i03/" class="uri">http://www.jstatsoft.org/v33/i03/</a>.</p>
+<p>Soetaert, Karline, and Thomas Petzoldt. 2010. “Inverse Modelling, Sensitivity and Monte Carlo Analysis in R Using Package FME.” <em>Journal of Statistical Software</em> 33 (3): 1–28. <a href="https://www.jstatsoft.org/v33/i03/" class="uri">https://www.jstatsoft.org/v33/i03/</a>.</p>
</div>
</div>
</div>
@@ -244,7 +248,7 @@
</div>
<div class="pkgdown">
- <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p>
+ <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>
</footer>

Contact - Imprint