diff options
Diffstat (limited to 'docs/articles/mkin.html')
-rw-r--r-- | docs/articles/mkin.html | 398 |
1 files changed, 164 insertions, 234 deletions
diff --git a/docs/articles/mkin.html b/docs/articles/mkin.html index 3bd0d4d3..fcf37ee4 100644 --- a/docs/articles/mkin.html +++ b/docs/articles/mkin.html @@ -1,154 +1,82 @@ <!DOCTYPE html> -<!-- Generated by pkgdown: do not edit by hand --><html lang="en"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -<meta charset="utf-8"> -<meta http-equiv="X-UA-Compatible" content="IE=edge"> -<meta name="viewport" content="width=device-width, initial-scale=1.0"> -<title>Short introduction to mkin • mkin</title> -<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"> -<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"> -<script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"> -<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"> -<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"> -<script src="../pkgdown.js"></script><meta property="og:title" content="Short introduction to mkin"> -<meta property="og:description" content="mkin"> -<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]> -<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> -<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> -<![endif]--> -</head> -<body data-spy="scroll" data-target="#toc"> - +<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Short introduction to mkin • mkin</title><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.5.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Short introduction to mkin"></head><body> + <a href="#main" class="visually-hidden-focusable">Skip to contents</a> + + + <nav class="navbar navbar-expand-lg fixed-top bg-light" data-bs-theme="default" aria-label="Site navigation"><div class="container"> + + <a class="navbar-brand me-2" href="../index.html">mkin</a> + + <small class="nav-text text-default me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Released version">1.2.9</small> + + + <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> + <span class="navbar-toggler-icon"></span> + </button> + + <div id="navbar" class="collapse navbar-collapse ms-3"> + <ul class="navbar-nav me-auto"><li class="nav-item"><a class="nav-link" href="../reference/index.html">Reference</a></li> +<li class="nav-item dropdown"> + <button class="nav-link dropdown-toggle" type="button" id="dropdown-articles" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true">Articles</button> + <ul class="dropdown-menu" aria-labelledby="dropdown-articles"><li><a class="dropdown-item" href="../articles/mkin.html">Introduction to mkin</a></li> + <li><hr class="dropdown-divider"></li> + <li><h6 class="dropdown-header" data-toc-skip>Example evaluations with (generalised) nonlinear least squares</h6></li> + <li><a class="dropdown-item" href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a></li> + <li><a class="dropdown-item" href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a></li> + <li><a class="dropdown-item" href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a></li> + <li><hr class="dropdown-divider"></li> + <li><h6 class="dropdown-header" data-toc-skip>Example evaluations with hierarchical models (nonlinear mixed-effects models)</h6></li> + <li><a class="dropdown-item" href="../articles/prebuilt/2022_dmta_parent.html">Testing hierarchical parent degradation kinetics with residue data on dimethenamid and dimethenamid-P</a></li> + <li><a class="dropdown-item" href="../articles/prebuilt/2022_dmta_pathway.html">Testing hierarchical pathway kinetics with residue data on dimethenamid and dimethenamid-P</a></li> + <li><a class="dropdown-item" href="../articles/prebuilt/2023_mesotrione_parent.html">Testing covariate modelling in hierarchical parent degradation kinetics with residue data on mesotrione</a></li> + <li><a class="dropdown-item" href="../articles/prebuilt/2022_cyan_pathway.html">Testing hierarchical pathway kinetics with residue data on cyantraniliprole</a></li> + <li><a class="dropdown-item" href="../articles/web_only/dimethenamid_2018.html">Comparison of saemix and nlme evaluations of dimethenamid data from 2018</a></li> + <li><a class="dropdown-item" href="../articles/web_only/multistart.html">Short demo of the multistart method</a></li> + <li><hr class="dropdown-divider"></li> + <li><h6 class="dropdown-header" data-toc-skip>Performance</h6></li> + <li><a class="dropdown-item" href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a></li> + <li><a class="dropdown-item" href="../articles/web_only/benchmarks.html">Benchmark timings for mkin</a></li> + <li><a class="dropdown-item" href="../articles/web_only/saem_benchmarks.html">Benchmark timings for saem.mmkin</a></li> + <li><hr class="dropdown-divider"></li> + <li><h6 class="dropdown-header" data-toc-skip>Miscellaneous</h6></li> + <li><a class="dropdown-item" href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a></li> + <li><a class="dropdown-item" href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a></li> + </ul></li> +<li class="nav-item"><a class="nav-link" href="../coverage/coverage.html">Test coverage</a></li> +<li class="nav-item"><a class="nav-link" href="../news/index.html">News</a></li> + </ul><ul class="navbar-nav"><li class="nav-item"><form class="form-inline" role="search"> + <input class="form-control" type="search" name="search-input" id="search-input" autocomplete="off" aria-label="Search site" placeholder="Search for" data-search-index="../search.json"></form></li> +<li class="nav-item"><a class="external-link nav-link" href="https://github.com/jranke/mkin/" aria-label="GitHub"><span class="fa fab fa-github fa-lg"></span></a></li> + </ul></div> - <div class="container template-article"> - <header><div class="navbar navbar-default navbar-fixed-top" role="navigation"> - <div class="container"> - <div class="navbar-header"> - <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"> - <span class="sr-only">Toggle navigation</span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </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">1.2.5</span> - </span> - </div> - <div id="navbar" class="navbar-collapse collapse"> - <ul class="nav navbar-nav"> -<li> - <a href="../reference/index.html">Reference</a> -</li> -<li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"> - Articles - - <span class="caret"></span> - </a> - <ul class="dropdown-menu" role="menu"> -<li> - <a href="../articles/mkin.html">Introduction to mkin</a> - </li> - <li class="divider"> - </li> -<li class="dropdown-header">Example evaluations with (generalised) nonlinear least squares</li> - <li> - <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a> - </li> - <li> - <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a> - </li> - <li> - <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> - </li> - <li class="divider"> - </li> -<li class="dropdown-header">Example evaluations with hierarchical models (nonlinear mixed-effects models)</li> - <li> - <a href="../articles/prebuilt/2022_dmta_parent.html">Testing hierarchical parent degradation kinetics with residue data on dimethenamid and dimethenamid-P</a> - </li> - <li> - <a href="../articles/prebuilt/2022_dmta_pathway.html">Testing hierarchical pathway kinetics with residue data on dimethenamid and dimethenamid-P</a> - </li> - <li> - <a href="../articles/prebuilt/2022_cyan_pathway.html">Testing hierarchical pathway kinetics with residue data on cyantraniliprole</a> - </li> - <li> - <a href="../articles/web_only/dimethenamid_2018.html">Comparison of saemix and nlme evaluations of dimethenamid data from 2018</a> - </li> - <li> - <a href="../articles/web_only/multistart.html">Short demo of the multistart method</a> - </li> - <li class="divider"> - </li> -<li class="dropdown-header">Performance</li> - <li> - <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a> - </li> - <li> - <a href="../articles/web_only/benchmarks.html">Benchmark timings for mkin</a> - </li> - <li> - <a href="../articles/web_only/saem_benchmarks.html">Benchmark timings for saem.mmkin</a> - </li> - <li class="divider"> - </li> -<li class="dropdown-header">Miscellaneous</li> - <li> - <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a> - </li> - <li> - <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> - </li> - </ul> -</li> -<li> - <a href="../news/index.html">News</a> -</li> - </ul> -<ul class="nav navbar-nav navbar-right"> -<li> - <a href="https://github.com/jranke/mkin/" class="external-link"> - <span class="fab fa-github fa-lg"></span> - - </a> -</li> - </ul> -</div> -<!--/.nav-collapse --> </div> -<!--/.container --> -</div> -<!--/.navbar --> +</nav><div class="container template-article"> + + - - </header><div class="row"> - <div class="col-md-9 contents"> - <div class="page-header toc-ignore"> - <h1 data-toc-skip>Short introduction to mkin</h1> +<div class="row"> + <main id="main" class="col-md-9"><div class="page-header"> + + <h1>Short introduction to mkin</h1> <h4 data-toc-skip class="author">Johannes Ranke</h4> <h4 data-toc-skip class="date">Last change 18 May 2023 -(rebuilt 2023-08-09)</h4> +(rebuilt 2025-02-13)</h4> <small class="dont-index">Source: <a href="https://github.com/jranke/mkin/blob/HEAD/vignettes/mkin.rmd" class="external-link"><code>vignettes/mkin.rmd</code></a></small> - <div class="hidden name"><code>mkin.rmd</code></div> - + <div class="d-none name"><code>mkin.rmd</code></div> </div> -<p><a href="https://www.jrwb.de" class="external-link">Wissenschaftlicher Berater, Kronacher -Str. 12, 79639 Grenzach-Wyhlen, Germany</a><br> Privatdozent at the +<p><a href="https://www.jrwb.de">Wissenschaftlicher Berater, Kronacher +Str. 12, 79639 Grenzach-Wyhlen, Germany</a><br /> Privatdozent at the University of Freiburg</p> -<div class="section level2"> -<h2 id="abstract">Abstract<a class="anchor" aria-label="anchor" href="#abstract"></a> -</h2> +<div id="abstract" class="section level1"> +<h1>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 @@ -158,40 +86,38 @@ nonlinear optimisation. The <code>R</code> 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.</p> -<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">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> -<span><span class="co"># Define the kinetic model</span></span> -<span><span class="va">m_SFO_SFO_SFO</span> <span class="op"><-</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/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M1"</span><span class="op">)</span>,</span> -<span> M1 <span class="op">=</span> <span class="fu"><a href="../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M2"</span><span class="op">)</span>,</span> -<span> M2 <span class="op">=</span> <span class="fu"><a href="../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>,</span> -<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> -<span></span> -<span></span> -<span><span class="co"># Produce model predictions using some arbitrary parameters</span></span> -<span><span class="va">sampling_times</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">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> -<span><span class="va">d_SFO_SFO_SFO</span> <span class="op"><-</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> -<span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span>k_parent <span class="op">=</span> <span class="fl">0.03</span>,</span> -<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" class="external-link">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>,</span> -<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" class="external-link">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> -<span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">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> -<span> <span class="va">sampling_times</span><span class="op">)</span></span> -<span></span> -<span><span class="co"># Generate a dataset by adding normally distributed errors with</span></span> -<span><span class="co"># standard deviation 3, for two replicates at each sampling time</span></span> -<span><span class="va">d_SFO_SFO_SFO_err</span> <span class="op"><-</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>,</span> -<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>,</span> -<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> -<span></span> -<span><span class="co"># Fit the model to the dataset</span></span> -<span><span class="va">f_SFO_SFO_SFO</span> <span class="op"><-</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> -<span></span> -<span><span class="co"># Plot the results separately for parent and metabolites</span></span> -<span><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" class="external-link">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></span></code></pre></div> -<p><img src="mkin_files/figure-html/unnamed-chunk-2-1.png" width="768"></p> +<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(<span class="st">"mkin"</span>, <span class="at">quietly =</span> <span class="cn">TRUE</span>)</span> +<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="co"># Define the kinetic model</span></span> +<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a>m_SFO_SFO_SFO <span class="ot"><-</span> <span class="fu">mkinmod</span>(<span class="at">parent =</span> <span class="fu">mkinsub</span>(<span class="st">"SFO"</span>, <span class="st">"M1"</span>),</span> +<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a> <span class="at">M1 =</span> <span class="fu">mkinsub</span>(<span class="st">"SFO"</span>, <span class="st">"M2"</span>),</span> +<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a> <span class="at">M2 =</span> <span class="fu">mkinsub</span>(<span class="st">"SFO"</span>),</span> +<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a> <span class="at">use_of_ff =</span> <span class="st">"max"</span>, <span class="at">quiet =</span> <span class="cn">TRUE</span>)</span> +<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a><span class="co"># Produce model predictions using some arbitrary parameters</span></span> +<span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a>sampling_times <span class="ot">=</span> <span class="fu">c</span>(<span class="dv">0</span>, <span class="dv">1</span>, <span class="dv">3</span>, <span class="dv">7</span>, <span class="dv">14</span>, <span class="dv">28</span>, <span class="dv">60</span>, <span class="dv">90</span>, <span class="dv">120</span>)</span> +<span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a>d_SFO_SFO_SFO <span class="ot"><-</span> <span class="fu">mkinpredict</span>(m_SFO_SFO_SFO,</span> +<span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a> <span class="fu">c</span>(<span class="at">k_parent =</span> <span class="fl">0.03</span>,</span> +<span id="cb1-13"><a href="#cb1-13" aria-hidden="true" tabindex="-1"></a> <span class="at">f_parent_to_M1 =</span> <span class="fl">0.5</span>, <span class="at">k_M1 =</span> <span class="fu">log</span>(<span class="dv">2</span>)<span class="sc">/</span><span class="dv">100</span>,</span> +<span id="cb1-14"><a href="#cb1-14" aria-hidden="true" tabindex="-1"></a> <span class="at">f_M1_to_M2 =</span> <span class="fl">0.9</span>, <span class="at">k_M2 =</span> <span class="fu">log</span>(<span class="dv">2</span>)<span class="sc">/</span><span class="dv">50</span>),</span> +<span id="cb1-15"><a href="#cb1-15" aria-hidden="true" tabindex="-1"></a> <span class="fu">c</span>(<span class="at">parent =</span> <span class="dv">100</span>, <span class="at">M1 =</span> <span class="dv">0</span>, <span class="at">M2 =</span> <span class="dv">0</span>),</span> +<span id="cb1-16"><a href="#cb1-16" aria-hidden="true" tabindex="-1"></a> sampling_times)</span> +<span id="cb1-17"><a href="#cb1-17" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb1-18"><a href="#cb1-18" aria-hidden="true" tabindex="-1"></a><span class="co"># Generate a dataset by adding normally distributed errors with</span></span> +<span id="cb1-19"><a href="#cb1-19" aria-hidden="true" tabindex="-1"></a><span class="co"># standard deviation 3, for two replicates at each sampling time</span></span> +<span id="cb1-20"><a href="#cb1-20" aria-hidden="true" tabindex="-1"></a>d_SFO_SFO_SFO_err <span class="ot"><-</span> <span class="fu">add_err</span>(d_SFO_SFO_SFO, <span class="at">reps =</span> <span class="dv">2</span>,</span> +<span id="cb1-21"><a href="#cb1-21" aria-hidden="true" tabindex="-1"></a> <span class="at">sdfunc =</span> <span class="cf">function</span>(x) <span class="dv">3</span>,</span> +<span id="cb1-22"><a href="#cb1-22" aria-hidden="true" tabindex="-1"></a> <span class="at">n =</span> <span class="dv">1</span>, <span class="at">seed =</span> <span class="dv">123456789</span> )</span> +<span id="cb1-23"><a href="#cb1-23" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb1-24"><a href="#cb1-24" aria-hidden="true" tabindex="-1"></a><span class="co"># Fit the model to the dataset</span></span> +<span id="cb1-25"><a href="#cb1-25" aria-hidden="true" tabindex="-1"></a>f_SFO_SFO_SFO <span class="ot"><-</span> <span class="fu">mkinfit</span>(m_SFO_SFO_SFO, d_SFO_SFO_SFO_err[[<span class="dv">1</span>]], <span class="at">quiet =</span> <span class="cn">TRUE</span>)</span> +<span id="cb1-26"><a href="#cb1-26" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb1-27"><a href="#cb1-27" aria-hidden="true" tabindex="-1"></a><span class="co"># Plot the results separately for parent and metabolites</span></span> +<span id="cb1-28"><a href="#cb1-28" aria-hidden="true" tabindex="-1"></a><span class="fu">plot_sep</span>(f_SFO_SFO_SFO, <span class="at">lpos =</span> <span class="fu">c</span>(<span class="st">"topright"</span>, <span class="st">"bottomright"</span>, <span class="st">"bottomright"</span>))</span></code></pre></div> +<p><img src="/home/jranke/git/mkin/docs/articles/mkin_files/figure-html/unnamed-chunk-2-1.png" width="768" /></p> </div> -<div class="section level2"> -<h2 id="background">Background<a class="anchor" aria-label="anchor" href="#background"></a> -</h2> +<div id="background" class="section level1"> +<h1>Background</h1> <p>The <code>mkin</code> package <span class="citation">(J. Ranke 2021)</span> implements the approach to degradation kinetics recommended in the kinetics report provided by the FOrum for Co-ordination of @@ -212,7 +138,8 @@ purpose compartment based tool providing infrastructure for fitting dynamic simulation models based on differential equations to data.</p> <p>The ‘mkin’ code was first uploaded to the BerliOS development 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" class="external-link">the +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 being updated.</p> <p>At that time, the R package <code>FME</code> (Flexible Modelling @@ -221,8 +148,9 @@ 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 <span class="math inline">\(\chi^2\)</span> error level as defined in this -guidance.</p> +include the output requested by the FOCUS guidance, such as the +<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><msup><mi>χ</mi><mn>2</mn></msup><annotation encoding="application/x-tex">\chi^2</annotation></semantics></math> +error level as defined in this guidance.</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 @@ -234,9 +162,8 @@ 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> -<div class="section level3"> -<h3 id="derived-software-tools">Derived software tools<a class="anchor" aria-label="anchor" href="#derived-software-tools"></a> -</h3> +<div id="derived-software-tools" class="section level2"> +<h2>Derived software tools</h2> <p>Soon after the publication of <code>mkin</code>, two derived tools were published, namely KinGUII (developed at Bayer Crop Science) and CAKE (commissioned to Tessella by Syngenta), which added a graphical @@ -257,44 +184,50 @@ be specified for transformation products. Starting with KinGUII version 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/" class="external-link">documentation page</a> and <a href="https://pkgdown.jrwb.de/gmkin/articles/gmkin_manual.html" class="external-link">manual</a> +<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">Johannes Ranke, Wöltjen, and Meinecke +these tools has been recently been published by <span +class="citation">Johannes Ranke, Wöltjen, and Meinecke (2018)</span>.</p> </div> </div> -<div class="section level2"> -<h2 id="unique-features">Unique features<a class="anchor" aria-label="anchor" href="#unique-features"></a> -</h2> +<div id="unique-features" class="section level1"> +<h1>Unique features</h1> <p>Currently, the main unique features available in <code>mkin</code> are</p> <ul> -<li>the <a href="https://pkgdown.jrwb.de/mkin/articles/web_only/compiled_models.html">speed +<li>the <a +href="https://pkgdown.jrwb.de/mkin/articles/web_only/compiled_models.html">speed increase</a> by using compiled code when a compiler is present,</li> -<li>parallel model fitting on multicore machines using the <a href="https://pkgdown.jrwb.de/mkin/reference/mmkin.html"><code>mmkin</code> +<li>parallel model fitting on multicore machines using the <a +href="https://pkgdown.jrwb.de/mkin/reference/mmkin.html"><code>mmkin</code> function</a>,</li> <li>the estimation of parameter confidence intervals based on transformed parameters (see below) and</li> -<li>the possibility to use the <a href="https://pkgdown.jrwb.de/mkin/reference/sigma_twocomp.html">two-component -error model</a> -</li> +<li>the possibility to use the <a +href="https://pkgdown.jrwb.de/mkin/reference/sigma_twocomp.html">two-component +error model</a></li> </ul> <p>The iteratively reweighted least squares fitting of different variances for each variable as introduced by <span class="citation">Gao -et al. (2011)</span> has been available in mkin since <a href="https://pkgdown.jrwb.de/mkin/news/index.html#mkin-0-9-22-2013-10-26">version -0.9-22</a>. With <a href="https://pkgdown.jrwb.de/mkin/news/index.html#mkin-0-9-49-5-2019-07-04">release +et al. (2011)</span> has been available in mkin since <a +href="https://pkgdown.jrwb.de/mkin/news/index.html#mkin-0-9-22-2013-10-26">version +0.9-22</a>. With <a +href="https://pkgdown.jrwb.de/mkin/news/index.html#mkin-0-9-49-5-2019-07-04">release 0.9.49.5</a>, the IRLS algorithm has been complemented by direct or step-wise maximisation of the likelihood function, which makes it possible not only to fit the variance by variable error model but also a -<a href="https://pkgdown.jrwb.de/mkin/reference/sigma_twocomp.html">two-component +<a +href="https://pkgdown.jrwb.de/mkin/reference/sigma_twocomp.html">two-component error model</a> inspired by error models developed in analytical chemistry <span class="citation">(Johannes Ranke and Meinecke 2019)</span>.</p> </div> -<div class="section level2"> -<h2 id="internal-parameter-transformations">Internal parameter transformations<a class="anchor" aria-label="anchor" href="#internal-parameter-transformations"></a> -</h2> +<div id="internal-parameter-transformations" class="section level1"> +<h1>Internal parameter transformations</h1> <p>For rate constants, the log transformation is used, as proposed by Bates and Watts <span class="citation">(1988, 77, 149)</span>. Approximate intervals are constructed for the transformed rate constants @@ -319,9 +252,9 @@ well as in the subsequent calculation of parameter confidence intervals. In the current version of mkin, a logit transformation is used for parameters that are bound between 0 and 1, such as the g parameter of the DFOP model.</p> -<div class="section level3"> -<h3 id="confidence-intervals-based-on-transformed-parameters">Confidence intervals based on transformed parameters<a class="anchor" aria-label="anchor" href="#confidence-intervals-based-on-transformed-parameters"></a> -</h3> +<div id="confidence-intervals-based-on-transformed-parameters" +class="section level2"> +<h2>Confidence intervals based on transformed parameters</h2> <p>In the first attempt at providing improved parameter confidence intervals introduced to <code>mkin</code> in 2013, confidence intervals obtained from FME on the transformed parameters were simply all @@ -343,13 +276,14 @@ are considered by the author of this vignette to be more accurate than those obtained using a re-estimation of the Hessian matrix after backtransformation, as implemented in the FME package.</p> </div> -<div class="section level3"> -<h3 id="parameter-t-test-based-on-untransformed-parameters">Parameter t-test based on untransformed parameters<a class="anchor" aria-label="anchor" href="#parameter-t-test-based-on-untransformed-parameters"></a> -</h3> +<div id="parameter-t-test-based-on-untransformed-parameters" +class="section level2"> +<h2>Parameter t-test based on untransformed parameters</h2> <p>The standard output of many nonlinear regression software packages includes the results from a test for significant difference from zero for all parameters. Such a test is also recommended to check the -validity of rate constants in the FOCUS guidance <span class="citation">(FOCUS Work Group on Degradation Kinetics 2014, +validity of rate constants in the FOCUS guidance <span +class="citation">(FOCUS Work Group on Degradation Kinetics 2014, 96ff)</span>.</p> <p>It has been argued that the precondition for this test, <em>i.e.</em> normal distribution of the estimator for the parameters, is not @@ -360,18 +294,18 @@ reliability of parameter estimates, based on the FOCUS guidance mentioned above. Therefore, the results of this one-sided t-test are included in the summary output from <code>mkin</code>.</p> <p>As it is not reasonable to test for significant difference of the -transformed parameters (<em>e.g.</em> <span class="math inline">\(log(k)\)</span>) from zero, the t-test is -calculated based on the model definition before parameter -transformation, <em>i.e.</em> in a similar way as in packages that do -not apply such an internal parameter transformation. A note is included -in the <code>mkin</code> output, pointing to the fact that the t-test is -based on the unjustified assumption of normal distribution of the -parameter estimators.</p> +transformed parameters (<em>e.g.</em> +<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi><mi>o</mi><mi>g</mi><mrow><mo stretchy="true" form="prefix">(</mo><mi>k</mi><mo stretchy="true" form="postfix">)</mo></mrow></mrow><annotation encoding="application/x-tex">log(k)</annotation></semantics></math>) +from zero, the t-test is calculated based on the model definition before +parameter transformation, <em>i.e.</em> in a similar way as in packages +that do not apply such an internal parameter transformation. A note is +included in the <code>mkin</code> output, pointing to the fact that the +t-test is based on the unjustified assumption of normal distribution of +the parameter estimators.</p> </div> </div> -<div class="section level2"> -<h2 id="references">References<a class="anchor" aria-label="anchor" href="#references"></a> -</h2> +<div id="references" class="section level1"> +<h1>References</h1> <!-- vim: set foldmethod=syntax: --> <div id="refs" class="references csl-bib-body hanging-indent"> <div id="ref-bates1988" class="csl-entry"> @@ -382,12 +316,14 @@ Applications</em>. Wiley-Interscience. FOCUS Work Group on Degradation Kinetics. 2006. <em>Guidance Document on Estimating Persistence and Degradation Kinetics from Environmental Fate Studies on Pesticides in EU Registration. Report of the FOCUS Work Group -on Degradation Kinetics</em>. <a href="http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics" class="external-link">http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics</a>. +on Degradation Kinetics</em>. <a +href="http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics">http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics</a>. </div> <div id="ref-FOCUSkinetics2014" class="csl-entry"> ———. 2014. <em>Generic Guidance for Estimating Persistence and Degradation Kinetics from Environmental Fate Studies on Pesticides in EU -Registration</em>. 1.1 ed. <a href="http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics" class="external-link">http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics</a>. +Registration</em>. 1.1 ed. <a +href="http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics">http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics</a>. </div> <div id="ref-gao11" class="csl-entry"> Gao, Z., J. W. Green, J. Vanderborght, and W. Schmitt. 2011. @@ -397,29 +333,34 @@ Science and Technology</em> 45: 4429–37. </div> <div id="ref-pkg:mkin" class="csl-entry"> Ranke, J. 2021. <em>‘<span class="nocase">mkin</span>‘: -<span>K</span>inetic Evaluation of Chemical Degradation Data</em>. <a href="https://CRAN.R-project.org/package=mkin" class="external-link">https://CRAN.R-project.org/package=mkin</a>. +<span>K</span>inetic Evaluation of Chemical Degradation Data</em>. <a +href="https://CRAN.R-project.org/package=mkin">https://CRAN.R-project.org/package=mkin</a>. </div> <div id="ref-ranke2012" class="csl-entry"> Ranke, J., and R. Lehmann. 2012. <span>“Parameter Reliability in Kinetic Evaluation of Environmental Metabolism Data - Assessment and the Influence of Model Specification.”</span> In <em>SETAC World 20-24 -May</em>. Berlin. <a href="https://jrwb.de/posters/Poster_SETAC_2012_Kinetic_parameter_uncertainty_model_parameterization_Lehmann_Ranke.pdf" class="external-link">https://jrwb.de/posters/Poster_SETAC_2012_Kinetic_parameter_uncertainty_model_parameterization_Lehmann_Ranke.pdf</a>. +May</em>. Berlin. <a +href="https://jrwb.de/posters/Poster_SETAC_2012_Kinetic_parameter_uncertainty_model_parameterization_Lehmann_Ranke.pdf">https://jrwb.de/posters/Poster_SETAC_2012_Kinetic_parameter_uncertainty_model_parameterization_Lehmann_Ranke.pdf</a>. </div> <div id="ref-ranke2015" class="csl-entry"> ———. 2015. <span>“To t-Test or Not to t-Test, That Is the Question.”</span> In <em>XV Symposium on Pesticide Chemistry 2-4 -September 2015</em>. Piacenza. <a href="https://jrwb.de/posters/piacenza_2015.pdf" class="external-link">https://jrwb.de/posters/piacenza_2015.pdf</a>. +September 2015</em>. Piacenza. <a +href="https://jrwb.de/posters/piacenza_2015.pdf">https://jrwb.de/posters/piacenza_2015.pdf</a>. </div> <div id="ref-ranke2019" class="csl-entry"> Ranke, Johannes, and Stefan Meinecke. 2019. <span>“Error Models for the Kinetic Evaluation of Chemical Degradation Data.”</span> -<em>Environments</em> 6 (12). <a href="https://doi.org/10.3390/environments6120124" class="external-link">https://doi.org/10.3390/environments6120124</a>. +<em>Environments</em> 6 (12). <a +href="https://doi.org/10.3390/environments6120124">https://doi.org/10.3390/environments6120124</a>. </div> <div id="ref-ranke2018" class="csl-entry"> Ranke, Johannes, Janina Wöltjen, and Stefan Meinecke. 2018. <span>“Comparison of Software Tools for Kinetic Evaluation of Chemical Degradation Data.”</span> <em>Environmental Sciences Europe</em> 30 (1): -17. <a href="https://doi.org/10.1186/s12302-018-0145-1" class="external-link">https://doi.org/10.1186/s12302-018-0145-1</a>. +17. <a +href="https://doi.org/10.1186/s12302-018-0145-1">https://doi.org/10.1186/s12302-018-0145-1</a>. </div> <div id="ref-schaefer2007" class="csl-entry"> Schäfer, D., B. Mikolasch, P. Rainbird, and B. Harvey. 2007. @@ -433,39 +374,28 @@ Piacenza. Soetaert, Karline, and Thomas Petzoldt. 2010. <span>“Inverse Modelling, Sensitivity and Monte Carlo Analysis in <span>R</span> Using Package <span>FME</span>.”</span> <em>Journal of Statistical Software</em> 33 -(3): 1–28. <a href="https://doi.org/10.18637/jss.v033.i03" class="external-link">https://doi.org/10.18637/jss.v033.i03</a>. +(3): 1–28. <a +href="https://doi.org/10.18637/jss.v033.i03">https://doi.org/10.18637/jss.v033.i03</a>. </div> </div> </div> - </div> + </main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2> + </nav></aside></div> - <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> - <nav id="toc" data-toggle="toc"><h2 data-toc-skip>Contents</h2> - </nav> -</div> + <footer><div class="pkgdown-footer-left"> + <p>Developed by Johannes Ranke.</p> </div> - - - <footer><div class="copyright"> - <p></p> -<p>Developed by Johannes Ranke.</p> +<div class="pkgdown-footer-right"> + <p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.1.1.</p> </div> -<div class="pkgdown"> - <p></p> -<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.7.</p> -</div> + </footer></div> - </footer> -</div> - - - </body> -</html> + </body></html> |