diff options
Diffstat (limited to 'docs/dev/articles')
19 files changed, 285 insertions, 449 deletions
diff --git a/docs/dev/articles/index.html b/docs/dev/articles/index.html index c0338df8..d1ca6668 100644 --- a/docs/dev/articles/index.html +++ b/docs/dev/articles/index.html @@ -1,66 +1,12 @@ -<!-- Generated by pkgdown: do not edit by hand --> <!DOCTYPE html> -<html lang="en"> - <head> - <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>Articles • 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="Articles" /> - - -<meta name="robots" content="noindex"> - -<!-- 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]> +<!-- 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>Articles • 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="Articles"><meta name="robots" content="noindex"><!-- 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> +<![endif]--></head><body data-spy="scroll" data-target="#toc"> + - <body data-spy="scroll" data-target="#toc"> <div class="container template-article-index"> - <header> - <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <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"> @@ -76,8 +22,7 @@ </div> <div id="navbar" class="navbar-collapse collapse"> - <ul class="nav navbar-nav"> - <li> + <ul class="nav navbar-nav"><li> <a href="../reference/index.html">Functions and data</a> </li> <li class="dropdown"> @@ -86,8 +31,7 @@ <span class="caret"></span> </a> - <ul class="dropdown-menu" role="menu"> - <li> + <ul class="dropdown-menu" role="menu"><li> <a href="../articles/mkin.html">Introduction to mkin</a> </li> <li> @@ -111,30 +55,23 @@ <li> <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> </li> - </ul> -</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/"> + </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 --> + </ul></div><!--/.nav-collapse --> </div><!--/.container --> </div><!--/.navbar --> - </header> - -<div class="row"> + </header><div class="row"> <div class="col-md-9 contents"> <div class="page-header"> <h1>Articles</h1> @@ -144,47 +81,43 @@ <h3>All vignettes</h3> <p class="section-desc"></p> - <dl> - <dt><a href="FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a></dt> - <dd></dt> - <dt><a href="FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a></dt> - <dd></dt> - <dt><a href="mkin.html">Introduction to mkin</a></dt> - <dd></dt> - <dt><a href="twa.html">Calculation of time weighted average concentrations with mkin</a></dt> - <dd></dt> - <dt><a href="web_only/FOCUS_Z.html">Example evaluation of FOCUS dataset Z</a></dt> - <dd></dt> - <dt><a href="web_only/NAFTA_examples.html">Evaluation of example datasets from Attachment 1 to the US EPA SOP for the NAFTA guidance</a></dt> - <dd></dt> - <dt><a href="web_only/benchmarks.html">Benchmark timings for mkin</a></dt> - <dd></dt> - <dt><a href="web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a></dt> - <dd></dt> - <dt><a href="web_only/dimethenamid_2018.html">Example evaluations of the dimethenamid data from 2018</a></dt> - <dd></dt> - </dl> - </div> + <dl><dt><a href="FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a></dt> + <dd> + </dd><dt><a href="FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a></dt> + <dd> + </dd><dt><a href="mkin.html">Introduction to mkin</a></dt> + <dd> + </dd><dt><a href="twa.html">Calculation of time weighted average concentrations with mkin</a></dt> + <dd> + </dd><dt><a href="web_only/FOCUS_Z.html">Example evaluation of FOCUS dataset Z</a></dt> + <dd> + </dd><dt><a href="web_only/NAFTA_examples.html">Evaluation of example datasets from Attachment 1 to the US EPA SOP for the NAFTA guidance</a></dt> + <dd> + </dd><dt><a href="web_only/benchmarks.html">Benchmark timings for mkin</a></dt> + <dd> + </dd><dt><a href="web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a></dt> + <dd> + </dd><dt><a href="web_only/dimethenamid_2018.html">Example evaluations of the dimethenamid data from 2018</a></dt> + <dd> + </dd></dl></div> </div> </div> - <footer> - <div class="copyright"> - <p>Developed by Johannes Ranke.</p> + <footer><div class="copyright"> + <p></p><p>Developed by Johannes Ranke.</p> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> + <p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.2.</p> </div> - </footer> - </div> + </footer></div> - </body> -</html> + + </body></html> diff --git a/docs/dev/articles/mkin.html b/docs/dev/articles/mkin.html index fed85a33..6bfb63bc 100644 --- a/docs/dev/articles/mkin.html +++ b/docs/dev/articles/mkin.html @@ -20,6 +20,8 @@ <![endif]--> </head> <body data-spy="scroll" data-target="#toc"> + + <div class="container template-article"> <header><div class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> @@ -32,7 +34,7 @@ </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">mkin</a> - <span class="version label label-info" data-toggle="tooltip" data-placement="bottom" title="In-development version">1.0.3.9000</span> + <span class="version label label-info" data-toggle="tooltip" data-placement="bottom" title="In-development version">1.1.0</span> </span> </div> @@ -80,7 +82,7 @@ </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="https://github.com/jranke/mkin/"> + <a href="https://github.com/jranke/mkin/" class="external-link"> <span class="fab fa-github fa-lg"></span> </a> @@ -95,28 +97,28 @@ - </header><script src="mkin_files/header-attrs-2.6/header-attrs.js"></script><script src="mkin_files/accessible-code-block-0.0.1/empty-anchor.js"></script><div class="row"> + </header><script src="mkin_files/accessible-code-block-0.0.1/empty-anchor.js"></script><div class="row"> <div class="col-md-9 contents"> <div class="page-header toc-ignore"> <h1 data-toc-skip>Introduction to mkin</h1> - <h4 class="author">Johannes Ranke</h4> + <h4 data-toc-skip class="author">Johannes Ranke</h4> - <h4 class="date">Last change 15 February 2021 (rebuilt 2021-02-15)</h4> + <h4 data-toc-skip class="date">Last change 15 February 2021 (rebuilt 2022-02-28)</h4> - <small class="dont-index">Source: <a href="https://github.com/jranke/mkin/blob/master/vignettes/mkin.rmd"><code>vignettes/mkin.rmd</code></a></small> + <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> -<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><a href="https://www.jrwb.de" class="external-link">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> <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"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><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> +<code class="sourceCode R"><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 class="co"># Define the kinetic model</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>, 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>, @@ -125,12 +127,12 @@ <span class="co"># Produce model predictions using some arbitrary parameters</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">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 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 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="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>, + 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>, + 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 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 class="va">sampling_times</span><span class="op">)</span> <span class="co"># Generate a dataset by adding normally distributed errors with</span> @@ -143,31 +145,31 @@ <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 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="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></code></pre></div> +<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></code></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"> -<a href="#background" class="anchor"></a>Background</h1> +<div class="section level2"> +<h2 id="background">Background<a class="anchor" aria-label="anchor" href="#background"></a> +</h2> <p>The <code>mkin</code> package <span class="citation">(Ranke 2021)</span> implements the approach to degradation kinetics 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>. It covers data series describing the decline of one compound, data series with transformation products (commonly termed metabolites) and data series for more than one compartment. It is possible to include back reactions. Therefore, equilibrium reactions and equilibrium partitioning can be specified, although this often 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 ‘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">the initial commit on 11 May 2010</a>), where the code is still being updated.</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 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 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 <span class="math inline">\(\chi^2\)</span> 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 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, has become somehow obsolete, as the use of compiled code described below gives even faster 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> -<div id="derived-software-tools" class="section level2"> -<h2 class="hasAnchor"> -<a href="#derived-software-tools" class="anchor"></a>Derived software tools</h2> +<div class="section level3"> +<h3 id="derived-software-tools">Derived software tools<a class="anchor" aria-label="anchor" href="#derived-software-tools"></a> +</h3> <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 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.4 of CAKE released in May 2020 uses a scheme for up to six metabolites in a flexible arrangement and supports biphasic modelling of metabolites, but does not support back-reactions (non-instantaneous equilibria).</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/" class="external-link">documentation page</a> and <a href="https://pkgdown.jrwb.de/gmkin/articles/gmkin_manual.html" class="external-link">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> -<div id="unique-features" class="section level1"> -<h1 class="hasAnchor"> -<a href="#unique-features" class="anchor"></a>Unique features</h1> +<div class="section level2"> +<h2 id="unique-features">Unique features<a class="anchor" aria-label="anchor" href="#unique-features"></a> +</h2> <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 increase</a> by using compiled code when a compiler is present,</li> @@ -178,66 +180,66 @@ </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 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 error model</a> inspired by error models developed in analytical chemistry <span class="citation">(Ranke and Meinecke 2019)</span>.</p> </div> -<div id="internal-parameter-transformations" class="section level1"> -<h1 class="hasAnchor"> -<a href="#internal-parameter-transformations" class="anchor"></a>Internal parameter transformations</h1> +<div class="section level2"> +<h2 id="internal-parameter-transformations">Internal parameter transformations<a class="anchor" aria-label="anchor" href="#internal-parameter-transformations"></a> +</h2> <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 <span class="citation">(compare Bates and Watts 1988, 135)</span>, <em>i.e.</em> for their logarithms. Confidence intervals for the rate constants are then obtained using the appropriate backtransformation using the exponential function.</p> <p>In the first version of <code>mkin</code> allowing for specifying models using formation fractions, a home-made reparameterisation was used in order to ensure that the sum of formation fractions would not exceed unity.</p> <p>This method is still used in the current version of KinGUII (v2.1 from April 2014), with a modification that allows for fixing the pathway to sink to zero. CAKE uses penalties in the objective function in order to enforce this constraint.</p> <p>In 2012, an alternative reparameterisation of the formation fractions was proposed together with René Lehmann <span class="citation">(Ranke and Lehmann 2012)</span>, based on isometric logratio transformation (ILR). The aim was to improve the validity of the linear approximation of the objective function during the parameter estimation procedure as 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 id="confidence-intervals-based-on-transformed-parameters" class="section level2"> -<h2 class="hasAnchor"> -<a href="#confidence-intervals-based-on-transformed-parameters" class="anchor"></a>Confidence intervals based on transformed parameters</h2> +<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> <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 backtransformed one by one to yield asymmetric confidence intervals for the backtransformed parameters.</p> <p>However, while there is a 1:1 relation between the rate constants in the model and the transformed parameters fitted in the model, the parameters obtained by the isometric logratio transformation are calculated from the set of formation fractions that quantify the paths to each of the compounds formed from a specific parent compound, and no such 1:1 relation exists.</p> <p>Therefore, parameter confidence intervals for formation fractions obtained with this method only appear valid for the case of a single transformation product, where currently the logit transformation is used for the formation fraction.</p> <p>The confidence intervals obtained by backtransformation for the cases where a 1:1 relation between transformed and original parameter exist 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 id="parameter-t-test-based-on-untransformed-parameters" class="section level2"> -<h2 class="hasAnchor"> -<a href="#parameter-t-test-based-on-untransformed-parameters" class="anchor"></a>Parameter t-test based on untransformed parameters</h2> +<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> <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, 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 fulfilled in the case of nonlinear regression <span class="citation">(Ranke and Lehmann 2015)</span>. However, this test is commonly used by industry, consultants and national authorities in order to decide on the 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> </div> </div> -<div id="references" class="section level1"> -<h1 class="hasAnchor"> -<a href="#references" class="anchor"></a>References</h1> +<div class="section level2"> +<h2 id="references">References<a class="anchor" aria-label="anchor" href="#references"></a> +</h2> <!-- vim: set foldmethod=syntax: --> <div id="refs" class="references hanging-indent"> <div id="ref-bates1988"> <p>Bates, D., and D. Watts. 1988. <em>Nonlinear Regression and Its Applications</em>. Wiley-Interscience.</p> </div> <div id="ref-FOCUS2006"> -<p>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">http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics</a>.</p> +<p>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>.</p> </div> <div id="ref-FOCUSkinetics2014"> -<p>———. 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">http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics</a>.</p> +<p>———. 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>.</p> </div> <div id="ref-gao11"> <p>Gao, Z., J. W. Green, J. Vanderborght, and W. Schmitt. 2011. “Improving Uncertainty Analysis in Kinetic Evaluations Using Iteratively Reweighted Least Squares.” Journal. <em>Environmental Science and Technology</em> 45: 4429–37.</p> </div> <div id="ref-pkg:mkin"> -<p>Ranke, J. 2021. <em>‘mkin‘: Kinetic Evaluation of Chemical Degradation Data</em>. <a href="https://CRAN.R-project.org/package=mkin">https://CRAN.R-project.org/package=mkin</a>.</p> +<p>Ranke, J. 2021. <em>‘mkin‘: Kinetic 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>.</p> </div> <div id="ref-ranke2012"> <p>Ranke, J., and R. Lehmann. 2012. “Parameter Reliability in Kinetic Evaluation of Environmental Metabolism Data - Assessment and the Influence of Model Specification.” In <em>SETAC World 20-24 May</em>. Berlin.</p> </div> <div id="ref-ranke2015"> -<p>———. 2015. “To T-Test or Not to T-Test, That Is the Question.” In <em>XV Symposium on Pesticide Chemistry 2-4 September 2015</em>. Piacenza. <a href="http://chem.uft.uni-bremen.de/ranke/posters/piacenza_2015.pdf">http://chem.uft.uni-bremen.de/ranke/posters/piacenza_2015.pdf</a>.</p> +<p>———. 2015. “To T-Test or Not to T-Test, That Is the Question.” In <em>XV Symposium on Pesticide Chemistry 2-4 September 2015</em>. Piacenza. <a href="http://chem.uft.uni-bremen.de/ranke/posters/piacenza_2015.pdf" class="external-link">http://chem.uft.uni-bremen.de/ranke/posters/piacenza_2015.pdf</a>.</p> </div> <div id="ref-ranke2019"> -<p>Ranke, Johannes, and Stefan Meinecke. 2019. “Error Models for the Kinetic Evaluation of Chemical Degradation Data.” <em>Environments</em> 6 (12). <a href="https://doi.org/10.3390/environments6120124">https://doi.org/10.3390/environments6120124</a>.</p> +<p>Ranke, Johannes, and Stefan Meinecke. 2019. “Error Models for the Kinetic Evaluation of Chemical Degradation Data.” <em>Environments</em> 6 (12). <a href="https://doi.org/10.3390/environments6120124" class="external-link">https://doi.org/10.3390/environments6120124</a>.</p> </div> <div id="ref-ranke2018"> -<p>Ranke, Johannes, Janina Wöltjen, and Stefan Meinecke. 2018. “Comparison of Software Tools for Kinetic Evaluation of Chemical Degradation Data.” <em>Environmental Sciences Europe</em> 30 (1): 17. <a href="https://doi.org/10.1186/s12302-018-0145-1">https://doi.org/10.1186/s12302-018-0145-1</a>.</p> +<p>Ranke, Johannes, Janina Wöltjen, and Stefan Meinecke. 2018. “Comparison of Software Tools for Kinetic Evaluation of Chemical Degradation Data.” <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>.</p> </div> <div id="ref-schaefer2007"> <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="https://www.jstatsoft.org/v33/i03/">https://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://doi.org/10.18637/jss.v033.i03" class="external-link">https://doi.org/10.18637/jss.v033.i03</a>.</p> </div> </div> </div> @@ -254,11 +256,13 @@ <footer><div class="copyright"> - <p>Developed by Johannes Ranke.</p> + <p></p> +<p>Developed by Johannes Ranke.</p> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> + <p></p> +<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.2.</p> </div> </footer> @@ -267,5 +271,7 @@ + + </body> </html> diff --git a/docs/dev/articles/mkin_files/figure-html/unnamed-chunk-2-1.png b/docs/dev/articles/mkin_files/figure-html/unnamed-chunk-2-1.png Binary files differindex bf38fdd7..63246387 100644 --- a/docs/dev/articles/mkin_files/figure-html/unnamed-chunk-2-1.png +++ b/docs/dev/articles/mkin_files/figure-html/unnamed-chunk-2-1.png diff --git a/docs/dev/articles/web_only/dimethenamid_2018.html b/docs/dev/articles/web_only/dimethenamid_2018.html index a2ea5c8d..6b5c8c4e 100644 --- a/docs/dev/articles/web_only/dimethenamid_2018.html +++ b/docs/dev/articles/web_only/dimethenamid_2018.html @@ -20,6 +20,8 @@ <![endif]--> </head> <body data-spy="scroll" data-target="#toc"> + + <div class="container template-article"> <header><div class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> @@ -80,7 +82,7 @@ </ul> <ul class="nav navbar-nav navbar-right"> <li> - <a href="https://github.com/jranke/mkin/"> + <a href="https://github.com/jranke/mkin/" class="external-link"> <span class="fab fa-github fa-lg"></span> </a> @@ -95,96 +97,109 @@ - </header><script src="dimethenamid_2018_files/header-attrs-2.11/header-attrs.js"></script><script src="dimethenamid_2018_files/accessible-code-block-0.0.1/empty-anchor.js"></script><div class="row"> + </header><script src="dimethenamid_2018_files/accessible-code-block-0.0.1/empty-anchor.js"></script><div class="row"> <div class="col-md-9 contents"> <div class="page-header toc-ignore"> <h1 data-toc-skip>Example evaluations of the dimethenamid data from 2018</h1> - <h4 class="author">Johannes Ranke</h4> + <h4 data-toc-skip class="author">Johannes Ranke</h4> - <h4 class="date">Last change 11 January 2022, built on 11 Jan 2022</h4> + <h4 data-toc-skip class="date">Last change 10 February 2022, built on 28 Feb 2022</h4> - <small class="dont-index">Source: <a href="https://github.com/jranke/mkin/blob/master/vignettes/web_only/dimethenamid_2018.rmd"><code>vignettes/web_only/dimethenamid_2018.rmd</code></a></small> + <small class="dont-index">Source: <a href="https://github.com/jranke/mkin/blob/HEAD/vignettes/web_only/dimethenamid_2018.rmd" class="external-link"><code>vignettes/web_only/dimethenamid_2018.rmd</code></a></small> <div class="hidden name"><code>dimethenamid_2018.rmd</code></div> </div> -<p><a href="http://www.jrwb.de">Wissenschaftlicher Berater, Kronacher Str. 12, 79639 Grenzach-Wyhlen, Germany</a></p> -<div id="introduction" class="section level1"> -<h1 class="hasAnchor"> -<a href="#introduction" class="anchor"></a>Introduction</h1> +<p><a href="http://www.jrwb.de" class="external-link">Wissenschaftlicher Berater, Kronacher Str. 12, 79639 Grenzach-Wyhlen, Germany</a></p> +<div class="section level2"> +<h2 id="introduction">Introduction<a class="anchor" aria-label="anchor" href="#introduction"></a> +</h2> <p>During the preparation of the journal article on nonlinear mixed-effects models in degradation kinetics <span class="citation">(Ranke et al. 2021)</span> and the analysis of the dimethenamid degradation data analysed therein, a need for a more detailed analysis using not only nlme and saemix, but also nlmixr for fitting the mixed-effects models was identified, as many model variants do not converge when fitted with nlme, and not all relevant error models can be fitted with saemix.</p> <p>This vignette is an attempt to satisfy this need.</p> </div> -<div id="data" class="section level1"> -<h1 class="hasAnchor"> -<a href="#data" class="anchor"></a>Data</h1> -<p>Residue data forming the basis for the endpoints derived in the conclusion on the peer review of the pesticide risk assessment of dimethenamid-P published by the European Food Safety Authority (EFSA) in 2018 <span class="citation">(EFSA 2018)</span> were transcribed from the risk assessment report <span class="citation">(Rapporteur Member State Germany, Co-Rapporteur Member State Bulgaria 2018)</span> which can be downloaded from the Open EFSA repository <a href="https://open.efsa.europa.eu">https://open.efsa.europa.eu/study-inventory/EFSA-Q-2014-00716</a>.</p> +<div class="section level2"> +<h2 id="data">Data<a class="anchor" aria-label="anchor" href="#data"></a> +</h2> +<p>Residue data forming the basis for the endpoints derived in the conclusion on the peer review of the pesticide risk assessment of dimethenamid-P published by the European Food Safety Authority (EFSA) in 2018 <span class="citation">(EFSA 2018)</span> were transcribed from the risk assessment report <span class="citation">(Rapporteur Member State Germany, Co-Rapporteur Member State Bulgaria 2018)</span> which can be downloaded from the Open EFSA repository <a href="https://open.efsa.europa.eu" class="external-link">https://open.efsa.europa.eu/study-inventory/EFSA-Q-2014-00716</a>.</p> <p>The data are <a href="https://pkgdown.jrwb.de/mkin/reference/dimethenamid_2018.html">available in the mkin package</a>. The following code (hidden by default, please use the button to the right to show it) treats the data available for the racemic mixture dimethenamid (DMTA) and its enantiomer dimethenamid-P (DMTAP) in the same way, as no difference between their degradation behaviour was identified in the EU risk assessment. The observation times of each dataset are multiplied with the corresponding normalisation factor also available in the dataset, in order to make it possible to describe all datasets with a single set of parameters.</p> <p>Also, datasets observed in the same soil are merged, resulting in dimethenamid (DMTA) data from six soils.</p> <div class="sourceCode" id="cb1"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><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="va">dmta_ds</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/lapply.html">lapply</a></span><span class="op">(</span><span class="fl">1</span><span class="op">:</span><span class="fl">7</span>, <span class="kw">function</span><span class="op">(</span><span class="va">i</span><span class="op">)</span> <span class="op">{</span> +<code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><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="va">dmta_ds</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/lapply.html" class="external-link">lapply</a></span><span class="op">(</span><span class="fl">1</span><span class="op">:</span><span class="fl">7</span>, <span class="kw">function</span><span class="op">(</span><span class="va">i</span><span class="op">)</span> <span class="op">{</span> <span class="va">ds_i</span> <span class="op"><-</span> <span class="va">dimethenamid_2018</span><span class="op">$</span><span class="va">ds</span><span class="op">[[</span><span class="va">i</span><span class="op">]</span><span class="op">]</span><span class="op">$</span><span class="va">data</span> <span class="va">ds_i</span><span class="op">[</span><span class="va">ds_i</span><span class="op">$</span><span class="va">name</span> <span class="op">==</span> <span class="st">"DMTAP"</span>, <span class="st">"name"</span><span class="op">]</span> <span class="op"><-</span> <span class="st">"DMTA"</span> <span class="va">ds_i</span><span class="op">$</span><span class="va">time</span> <span class="op"><-</span> <span class="va">ds_i</span><span class="op">$</span><span class="va">time</span> <span class="op">*</span> <span class="va">dimethenamid_2018</span><span class="op">$</span><span class="va">f_time_norm</span><span class="op">[</span><span class="va">i</span><span class="op">]</span> <span class="va">ds_i</span> <span class="op">}</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/r/base/names.html">names</a></span><span class="op">(</span><span class="va">dmta_ds</span><span class="op">)</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/lapply.html">sapply</a></span><span class="op">(</span><span class="va">dimethenamid_2018</span><span class="op">$</span><span class="va">ds</span>, <span class="kw">function</span><span class="op">(</span><span class="va">ds</span><span class="op">)</span> <span class="va">ds</span><span class="op">$</span><span class="va">title</span><span class="op">)</span> -<span class="va">dmta_ds</span><span class="op">[[</span><span class="st">"Elliot"</span><span class="op">]</span><span class="op">]</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/cbind.html">rbind</a></span><span class="op">(</span><span class="va">dmta_ds</span><span class="op">[[</span><span class="st">"Elliot 1"</span><span class="op">]</span><span class="op">]</span>, <span class="va">dmta_ds</span><span class="op">[[</span><span class="st">"Elliot 2"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span> +<span class="fu"><a href="https://rdrr.io/r/base/names.html" class="external-link">names</a></span><span class="op">(</span><span class="va">dmta_ds</span><span class="op">)</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/lapply.html" class="external-link">sapply</a></span><span class="op">(</span><span class="va">dimethenamid_2018</span><span class="op">$</span><span class="va">ds</span>, <span class="kw">function</span><span class="op">(</span><span class="va">ds</span><span class="op">)</span> <span class="va">ds</span><span class="op">$</span><span class="va">title</span><span class="op">)</span> +<span class="va">dmta_ds</span><span class="op">[[</span><span class="st">"Elliot"</span><span class="op">]</span><span class="op">]</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/cbind.html" class="external-link">rbind</a></span><span class="op">(</span><span class="va">dmta_ds</span><span class="op">[[</span><span class="st">"Elliot 1"</span><span class="op">]</span><span class="op">]</span>, <span class="va">dmta_ds</span><span class="op">[[</span><span class="st">"Elliot 2"</span><span class="op">]</span><span class="op">]</span><span class="op">)</span> <span class="va">dmta_ds</span><span class="op">[[</span><span class="st">"Elliot 1"</span><span class="op">]</span><span class="op">]</span> <span class="op"><-</span> <span class="cn">NULL</span> <span class="va">dmta_ds</span><span class="op">[[</span><span class="st">"Elliot 2"</span><span class="op">]</span><span class="op">]</span> <span class="op"><-</span> <span class="cn">NULL</span></code></pre></div> </div> -<div id="parent-degradation" class="section level1"> -<h1 class="hasAnchor"> -<a href="#parent-degradation" class="anchor"></a>Parent degradation</h1> +<div class="section level2"> +<h2 id="parent-degradation">Parent degradation<a class="anchor" aria-label="anchor" href="#parent-degradation"></a> +</h2> <p>We evaluate the observed degradation of the parent compound using simple exponential decline (SFO) and biexponential decline (DFOP), using constant variance (const) and a two-component variance (tc) as error models.</p> -<div id="separate-evaluations" class="section level2"> -<h2 class="hasAnchor"> -<a href="#separate-evaluations" class="anchor"></a>Separate evaluations</h2> +<div class="section level3"> +<h3 id="separate-evaluations">Separate evaluations<a class="anchor" aria-label="anchor" href="#separate-evaluations"></a> +</h3> <p>As a first step, to get a visual impression of the fit of the different models, we do separate evaluations for each soil using the mmkin function from the mkin package:</p> <div class="sourceCode" id="cb2"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="va">f_parent_mkin_const</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mmkin.html">mmkin</a></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="st">"SFO"</span>, <span class="st">"DFOP"</span><span class="op">)</span>, <span class="va">dmta_ds</span>, +<code class="sourceCode R"><span class="va">f_parent_mkin_const</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mmkin.html">mmkin</a></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="st">"SFO"</span>, <span class="st">"DFOP"</span><span class="op">)</span>, <span class="va">dmta_ds</span>, error_model <span class="op">=</span> <span class="st">"const"</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> -<span class="va">f_parent_mkin_tc</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mmkin.html">mmkin</a></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="st">"SFO"</span>, <span class="st">"DFOP"</span><span class="op">)</span>, <span class="va">dmta_ds</span>, +<span class="va">f_parent_mkin_tc</span> <span class="op"><-</span> <span class="fu"><a href="../../reference/mmkin.html">mmkin</a></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="st">"SFO"</span>, <span class="st">"DFOP"</span><span class="op">)</span>, <span class="va">dmta_ds</span>, error_model <span class="op">=</span> <span class="st">"tc"</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div> <p>The plot of the individual SFO fits shown below suggests that at least in some datasets the degradation slows down towards later time points, and that the scatter of the residuals error is smaller for smaller values (panel to the right):</p> <div class="sourceCode" id="cb3"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="fu"><a href="../../reference/mixed.html">mixed</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span><span class="op">)</span><span class="op">)</span></code></pre></div> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/pkg/saemix/man/plot-SaemixObject-ANY-method.html" class="external-link">plot</a></span><span class="op">(</span><span class="fu"><a href="../../reference/mixed.html">mixed</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span><span class="op">)</span><span class="op">)</span></code></pre></div> <p><img src="dimethenamid_2018_files/figure-html/f_parent_mkin_sfo_const-1.png" width="700"></p> <p>Using biexponential decline (DFOP) results in a slightly more random scatter of the residuals:</p> <div class="sourceCode" id="cb4"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="fu"><a href="../../reference/mixed.html">mixed</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span><span class="op">)</span><span class="op">)</span></code></pre></div> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/pkg/saemix/man/plot-SaemixObject-ANY-method.html" class="external-link">plot</a></span><span class="op">(</span><span class="fu"><a href="../../reference/mixed.html">mixed</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span><span class="op">)</span><span class="op">)</span></code></pre></div> <p><img src="dimethenamid_2018_files/figure-html/f_parent_mkin_dfop_const-1.png" width="700"></p> <p>The population curve (bold line) in the above plot results from taking the mean of the individual transformed parameters, i.e. of log k1 and log k2, as well as of the logit of the g parameter of the DFOP model). Here, this procedure does not result in parameters that represent the degradation well, because in some datasets the fitted value for k2 is extremely close to zero, leading to a log k2 value that dominates the average. This is alleviated if only rate constants that pass the t-test for significant difference from zero (on the untransformed scale) are considered in the averaging:</p> <div class="sourceCode" id="cb5"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="fu"><a href="../../reference/mixed.html">mixed</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span><span class="op">)</span>, test_log_parms <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/pkg/saemix/man/plot-SaemixObject-ANY-method.html" class="external-link">plot</a></span><span class="op">(</span><span class="fu"><a href="../../reference/mixed.html">mixed</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span><span class="op">)</span>, test_log_parms <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div> <p><img src="dimethenamid_2018_files/figure-html/f_parent_mkin_dfop_const_test-1.png" width="700"></p> <p>While this is visually much more satisfactory, such an average procedure could introduce a bias, as not all results from the individual fits enter the population curve with the same weight. This is where nonlinear mixed-effects models can help out by treating all datasets with equally by fitting a parameter distribution model together with the degradation model and the error model (see below).</p> <p>The remaining trend of the residuals to be higher for higher predicted residues is reduced by using the two-component error model:</p> <div class="sourceCode" id="cb6"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="fu"><a href="../../reference/mixed.html">mixed</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span><span class="op">)</span>, test_log_parms <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/pkg/saemix/man/plot-SaemixObject-ANY-method.html" class="external-link">plot</a></span><span class="op">(</span><span class="fu"><a href="../../reference/mixed.html">mixed</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span><span class="op">)</span>, test_log_parms <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></code></pre></div> <p><img src="dimethenamid_2018_files/figure-html/f_parent_mkin_dfop_tc_test-1.png" width="700"></p> +<p>However, note that in the case of using this error model, the fits to the Flaach and BBA 2.3 datasets appear to be ill-defined, indicated by the fact that they did not converge:</p> +<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span><span class="op">)</span></code></pre></div> +<pre><code><mmkin> object +Status of individual fits: + + dataset +model Calke Borstel Flaach BBA 2.2 BBA 2.3 Elliot + DFOP OK OK C OK C OK + +OK: No warnings +C: Optimisation did not converge: +iteration limit reached without convergence (10)</code></pre> </div> -<div id="nonlinear-mixed-effects-models" class="section level2"> -<h2 class="hasAnchor"> -<a href="#nonlinear-mixed-effects-models" class="anchor"></a>Nonlinear mixed-effects models</h2> +<div class="section level3"> +<h3 id="nonlinear-mixed-effects-models">Nonlinear mixed-effects models<a class="anchor" aria-label="anchor" href="#nonlinear-mixed-effects-models"></a> +</h3> <p>Instead of taking a model selection decision for each of the individual fits, we fit nonlinear mixed-effects models (using different fitting algorithms as implemented in different packages) and do model selection using all available data at the same time. In order to make sure that these decisions are not unduly influenced by the type of algorithm used, by implementation details or by the use of wrong control parameters, we compare the model selection results obtained with different R packages, with different algorithms and checking control parameters.</p> -<div id="nlme" class="section level3"> -<h3 class="hasAnchor"> -<a href="#nlme" class="anchor"></a>nlme</h3> +<div class="section level4"> +<h4 id="nlme">nlme<a class="anchor" aria-label="anchor" href="#nlme"></a> +</h4> <p>The nlme package was the first R extension providing facilities to fit nonlinear mixed-effects models. We would like to do model selection from all four combinations of degradation models and error models based on the AIC. However, fitting the DFOP model with constant variance and using default control parameters results in an error, signalling that the maximum number of 50 iterations was reached, potentially indicating overparameterisation. Nevertheless, the algorithm converges when the two-component error model is used in combination with the DFOP model. This can be explained by the fact that the smaller residues observed at later sampling times get more weight when using the two-component error model which will counteract the tendency of the algorithm to try parameter combinations unsuitable for fitting these data.</p> -<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://svn.r-project.org/R-packages/trunk/nlme/">nlme</a></span><span class="op">)</span> -<span class="va">f_parent_nlme_sfo_const</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlme/man/nlme.html">nlme</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span><span class="op">)</span> +<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://svn.r-project.org/R-packages/trunk/nlme/" class="external-link">nlme</a></span><span class="op">)</span> +<span class="va">f_parent_nlme_sfo_const</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlme/man/nlme.html" class="external-link">nlme</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span><span class="op">)</span> <span class="co"># f_parent_nlme_dfop_const <- nlme(f_parent_mkin_const["DFOP", ])</span> -<span class="va">f_parent_nlme_sfo_tc</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlme/man/nlme.html">nlme</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span><span class="op">)</span> -<span class="va">f_parent_nlme_dfop_tc</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlme/man/nlme.html">nlme</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span><span class="op">)</span></code></pre></div> +<span class="va">f_parent_nlme_sfo_tc</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlme/man/nlme.html" class="external-link">nlme</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span><span class="op">)</span> +<span class="va">f_parent_nlme_dfop_tc</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlme/man/nlme.html" class="external-link">nlme</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span><span class="op">)</span></code></pre></div> <p>Note that a certain degree of overparameterisation is also indicated by a warning obtained when fitting DFOP with the two-component error model (‘false convergence’ in the ‘LME step’ in iteration 3). However, as this warning does not occur in later iterations, and specifically not in the last of the 6 iterations, we can ignore this warning.</p> <p>The model comparison function of the nlme package can directly be applied to these fits showing a much lower AIC for the DFOP model fitted with the two-component error model. Also, the likelihood ratio test indicates that this difference is significant as the p-value is below 0.0001.</p> -<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/stats/anova.html">anova</a></span><span class="op">(</span> +<div class="sourceCode" id="cb10"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/stats/anova.html" class="external-link">anova</a></span><span class="op">(</span> <span class="va">f_parent_nlme_sfo_const</span>, <span class="va">f_parent_nlme_sfo_tc</span>, <span class="va">f_parent_nlme_dfop_tc</span> <span class="op">)</span></code></pre></div> <pre><code> Model df AIC BIC logLik Test L.Ratio p-value @@ -192,227 +207,215 @@ f_parent_nlme_sfo_const 1 5 796.60 811.82 -393.30 f_parent_nlme_sfo_tc 2 6 798.60 816.86 -393.30 1 vs 2 0.00 0.998 f_parent_nlme_dfop_tc 3 10 671.91 702.34 -325.96 2 vs 3 134.69 <.0001</code></pre> <p>In addition to these fits, attempts were also made to include correlations between random effects by using the log Cholesky parameterisation of the matrix specifying them. The code used for these attempts can be made visible below.</p> -<div class="sourceCode" id="cb10"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="va">f_parent_nlme_sfo_const_logchol</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlme/man/nlme.html">nlme</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span>, - random <span class="op">=</span> <span class="fu">nlme</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/nlme/man/pdLogChol.html">pdLogChol</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">DMTA_0</span> <span class="op">~</span> <span class="fl">1</span>, <span class="va">log_k_DMTA</span> <span class="op">~</span> <span class="fl">1</span><span class="op">)</span><span class="op">)</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/r/stats/anova.html">anova</a></span><span class="op">(</span><span class="va">f_parent_nlme_sfo_const</span>, <span class="va">f_parent_nlme_sfo_const_logchol</span><span class="op">)</span> -<span class="va">f_parent_nlme_sfo_tc_logchol</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlme/man/nlme.html">nlme</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span>, - random <span class="op">=</span> <span class="fu">nlme</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/nlme/man/pdLogChol.html">pdLogChol</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">DMTA_0</span> <span class="op">~</span> <span class="fl">1</span>, <span class="va">log_k_DMTA</span> <span class="op">~</span> <span class="fl">1</span><span class="op">)</span><span class="op">)</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/r/stats/anova.html">anova</a></span><span class="op">(</span><span class="va">f_parent_nlme_sfo_tc</span>, <span class="va">f_parent_nlme_sfo_tc_logchol</span><span class="op">)</span> -<span class="va">f_parent_nlme_dfop_tc_logchol</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlme/man/nlme.html">nlme</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, - random <span class="op">=</span> <span class="fu">nlme</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/nlme/man/pdLogChol.html">pdLogChol</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">DMTA_0</span> <span class="op">~</span> <span class="fl">1</span>, <span class="va">log_k1</span> <span class="op">~</span> <span class="fl">1</span>, <span class="va">log_k2</span> <span class="op">~</span> <span class="fl">1</span>, <span class="va">g_qlogis</span> <span class="op">~</span> <span class="fl">1</span><span class="op">)</span><span class="op">)</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/r/stats/anova.html">anova</a></span><span class="op">(</span><span class="va">f_parent_nlme_dfop_tc</span>, <span class="va">f_parent_nlme_dfop_tc_logchol</span><span class="op">)</span></code></pre></div> +<div class="sourceCode" id="cb12"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">f_parent_nlme_sfo_const_logchol</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlme/man/nlme.html" class="external-link">nlme</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span>, + random <span class="op">=</span> <span class="fu">nlme</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/nlme/man/pdLogChol.html" class="external-link">pdLogChol</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span><span class="va">DMTA_0</span> <span class="op">~</span> <span class="fl">1</span>, <span class="va">log_k_DMTA</span> <span class="op">~</span> <span class="fl">1</span><span class="op">)</span><span class="op">)</span><span class="op">)</span> +<span class="fu"><a href="https://rdrr.io/r/stats/anova.html" class="external-link">anova</a></span><span class="op">(</span><span class="va">f_parent_nlme_sfo_const</span>, <span class="va">f_parent_nlme_sfo_const_logchol</span><span class="op">)</span> +<span class="va">f_parent_nlme_sfo_tc_logchol</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlme/man/nlme.html" class="external-link">nlme</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span>, + random <span class="op">=</span> <span class="fu">nlme</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/nlme/man/pdLogChol.html" class="external-link">pdLogChol</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span><span class="va">DMTA_0</span> <span class="op">~</span> <span class="fl">1</span>, <span class="va">log_k_DMTA</span> <span class="op">~</span> <span class="fl">1</span><span class="op">)</span><span class="op">)</span><span class="op">)</span> +<span class="fu"><a href="https://rdrr.io/r/stats/anova.html" class="external-link">anova</a></span><span class="op">(</span><span class="va">f_parent_nlme_sfo_tc</span>, <span class="va">f_parent_nlme_sfo_tc_logchol</span><span class="op">)</span> +<span class="va">f_parent_nlme_dfop_tc_logchol</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlme/man/nlme.html" class="external-link">nlme</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, + random <span class="op">=</span> <span class="fu">nlme</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/nlme/man/pdLogChol.html" class="external-link">pdLogChol</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span><span class="va">DMTA_0</span> <span class="op">~</span> <span class="fl">1</span>, <span class="va">log_k1</span> <span class="op">~</span> <span class="fl">1</span>, <span class="va">log_k2</span> <span class="op">~</span> <span class="fl">1</span>, <span class="va">g_qlogis</span> <span class="op">~</span> <span class="fl">1</span><span class="op">)</span><span class="op">)</span><span class="op">)</span> +<span class="fu"><a href="https://rdrr.io/r/stats/anova.html" class="external-link">anova</a></span><span class="op">(</span><span class="va">f_parent_nlme_dfop_tc</span>, <span class="va">f_parent_nlme_dfop_tc_logchol</span><span class="op">)</span></code></pre></div> <p>While the SFO variants converge fast, the additional parameters introduced by this lead to convergence warnings for the DFOP model. The model comparison clearly show that adding correlations between random effects does not improve the fits.</p> <p>The selected model (DFOP with two-component error) fitted to the data assuming no correlations between random effects is shown below.</p> -<div class="sourceCode" id="cb11"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">f_parent_nlme_dfop_tc</span><span class="op">)</span></code></pre></div> +<div class="sourceCode" id="cb13"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/pkg/saemix/man/plot-SaemixObject-ANY-method.html" class="external-link">plot</a></span><span class="op">(</span><span class="va">f_parent_nlme_dfop_tc</span><span class="op">)</span></code></pre></div> <p><img src="dimethenamid_2018_files/figure-html/plot_parent_nlme-1.png" width="700"></p> </div> -<div id="saemix" class="section level3"> -<h3 class="hasAnchor"> -<a href="#saemix" class="anchor"></a>saemix</h3> +<div class="section level4"> +<h4 id="saemix">saemix<a class="anchor" aria-label="anchor" href="#saemix"></a> +</h4> <p>The saemix package provided the first Open Source implementation of the Stochastic Approximation to the Expectation Maximisation (SAEM) algorithm. SAEM fits of degradation models can be conveniently performed using an interface to the saemix package available in current development versions of the mkin package.</p> <p>The corresponding SAEM fits of the four combinations of degradation and error models are fitted below. As there is no convergence criterion implemented in the saemix package, the convergence plots need to be manually checked for every fit. As we will compare the SAEM implementation of saemix to the results obtained using the nlmixr package later, we define control settings that work well for all the parent data fits shown in this vignette.</p> -<div class="sourceCode" id="cb12"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va">saemix</span><span class="op">)</span> -<span class="va">saemix_control</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/saemix/man/saemixControl.html">saemixControl</a></span><span class="op">(</span>nbiter.saemix <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">800</span>, <span class="fl">300</span><span class="op">)</span>, nb.chains <span class="op">=</span> <span class="fl">15</span>, +<div class="sourceCode" id="cb14"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va">saemix</span><span class="op">)</span> +<span class="va">saemix_control</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/saemix/man/saemixControl.html" class="external-link">saemixControl</a></span><span class="op">(</span>nbiter.saemix <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">800</span>, <span class="fl">300</span><span class="op">)</span>, nb.chains <span class="op">=</span> <span class="fl">15</span>, print <span class="op">=</span> <span class="cn">FALSE</span>, save <span class="op">=</span> <span class="cn">FALSE</span>, save.graphs <span class="op">=</span> <span class="cn">FALSE</span>, displayProgress <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span> -<span class="va">saemix_control_moreiter</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/saemix/man/saemixControl.html">saemixControl</a></span><span class="op">(</span>nbiter.saemix <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">1600</span>, <span class="fl">300</span><span class="op">)</span>, nb.chains <span class="op">=</span> <span class="fl">15</span>, +<span class="va">saemix_control_moreiter</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/saemix/man/saemixControl.html" class="external-link">saemixControl</a></span><span class="op">(</span>nbiter.saemix <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">1600</span>, <span class="fl">300</span><span class="op">)</span>, nb.chains <span class="op">=</span> <span class="fl">15</span>, + print <span class="op">=</span> <span class="cn">FALSE</span>, save <span class="op">=</span> <span class="cn">FALSE</span>, save.graphs <span class="op">=</span> <span class="cn">FALSE</span>, displayProgress <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span> +<span class="va">saemix_control_10k</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/saemix/man/saemixControl.html" class="external-link">saemixControl</a></span><span class="op">(</span>nbiter.saemix <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">10000</span>, <span class="fl">300</span><span class="op">)</span>, nb.chains <span class="op">=</span> <span class="fl">15</span>, print <span class="op">=</span> <span class="cn">FALSE</span>, save <span class="op">=</span> <span class="cn">FALSE</span>, save.graphs <span class="op">=</span> <span class="cn">FALSE</span>, displayProgress <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></code></pre></div> <p>The convergence plot for the SFO model using constant variance is shown below.</p> -<div class="sourceCode" id="cb13"><pre class="downlit sourceCode r"> +<div class="sourceCode" id="cb15"><pre class="downlit sourceCode r"> <code class="sourceCode R"><span class="va">f_parent_saemix_sfo_const</span> <span class="op"><-</span> <span class="fu">mkin</span><span class="fu">::</span><span class="fu"><a href="../../reference/saem.html">saem</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span>, control <span class="op">=</span> <span class="va">saemix_control</span>, transformations <span class="op">=</span> <span class="st">"saemix"</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/pkg/saemix/man/plot-SaemixObject-ANY-method.html">plot</a></span><span class="op">(</span><span class="va">f_parent_saemix_sfo_const</span><span class="op">$</span><span class="va">so</span>, plot.type <span class="op">=</span> <span class="st">"convergence"</span><span class="op">)</span></code></pre></div> +<span class="fu"><a href="https://rdrr.io/pkg/saemix/man/plot-SaemixObject-ANY-method.html" class="external-link">plot</a></span><span class="op">(</span><span class="va">f_parent_saemix_sfo_const</span><span class="op">$</span><span class="va">so</span>, plot.type <span class="op">=</span> <span class="st">"convergence"</span><span class="op">)</span></code></pre></div> <p><img src="dimethenamid_2018_files/figure-html/f_parent_saemix_sfo_const-1.png" width="700"></p> <p>Obviously the default number of iterations is sufficient to reach convergence. This can also be said for the SFO fit using the two-component error model.</p> -<div class="sourceCode" id="cb14"><pre class="downlit sourceCode r"> +<div class="sourceCode" id="cb16"><pre class="downlit sourceCode r"> <code class="sourceCode R"><span class="va">f_parent_saemix_sfo_tc</span> <span class="op"><-</span> <span class="fu">mkin</span><span class="fu">::</span><span class="fu"><a href="../../reference/saem.html">saem</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span>, control <span class="op">=</span> <span class="va">saemix_control</span>, transformations <span class="op">=</span> <span class="st">"saemix"</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/pkg/saemix/man/plot-SaemixObject-ANY-method.html">plot</a></span><span class="op">(</span><span class="va">f_parent_saemix_sfo_tc</span><span class="op">$</span><span class="va">so</span>, plot.type <span class="op">=</span> <span class="st">"convergence"</span><span class="op">)</span></code></pre></div> +<span class="fu"><a href="https://rdrr.io/pkg/saemix/man/plot-SaemixObject-ANY-method.html" class="external-link">plot</a></span><span class="op">(</span><span class="va">f_parent_saemix_sfo_tc</span><span class="op">$</span><span class="va">so</span>, plot.type <span class="op">=</span> <span class="st">"convergence"</span><span class="op">)</span></code></pre></div> <p><img src="dimethenamid_2018_files/figure-html/f_parent_saemix_sfo_tc-1.png" width="700"></p> <p>When fitting the DFOP model with constant variance (see below), parameter convergence is not as unambiguous.</p> -<div class="sourceCode" id="cb15"><pre class="downlit sourceCode r"> +<div class="sourceCode" id="cb17"><pre class="downlit sourceCode r"> <code class="sourceCode R"><span class="va">f_parent_saemix_dfop_const</span> <span class="op"><-</span> <span class="fu">mkin</span><span class="fu">::</span><span class="fu"><a href="../../reference/saem.html">saem</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span>, control <span class="op">=</span> <span class="va">saemix_control</span>, transformations <span class="op">=</span> <span class="st">"saemix"</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/pkg/saemix/man/plot-SaemixObject-ANY-method.html">plot</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_const</span><span class="op">$</span><span class="va">so</span>, plot.type <span class="op">=</span> <span class="st">"convergence"</span><span class="op">)</span></code></pre></div> +<span class="fu"><a href="https://rdrr.io/pkg/saemix/man/plot-SaemixObject-ANY-method.html" class="external-link">plot</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_const</span><span class="op">$</span><span class="va">so</span>, plot.type <span class="op">=</span> <span class="st">"convergence"</span><span class="op">)</span></code></pre></div> <p><img src="dimethenamid_2018_files/figure-html/f_parent_saemix_dfop_const-1.png" width="700"></p> <p>This is improved when the DFOP model is fitted with the two-component error model. Convergence of the variance of k2 is enhanced, it remains more or less stable already after 200 iterations of the first phase.</p> -<div class="sourceCode" id="cb16"><pre class="downlit sourceCode r"> +<div class="sourceCode" id="cb18"><pre class="downlit sourceCode r"> <code class="sourceCode R"><span class="va">f_parent_saemix_dfop_tc</span> <span class="op"><-</span> <span class="fu">mkin</span><span class="fu">::</span><span class="fu"><a href="../../reference/saem.html">saem</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span>, control <span class="op">=</span> <span class="va">saemix_control</span>, transformations <span class="op">=</span> <span class="st">"saemix"</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/pkg/saemix/man/plot-SaemixObject-ANY-method.html">plot</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc</span><span class="op">$</span><span class="va">so</span>, plot.type <span class="op">=</span> <span class="st">"convergence"</span><span class="op">)</span></code></pre></div> -<p><img src="dimethenamid_2018_files/figure-html/f_parent_saemix_dfop_tc-1.png" width="700"></p> -<div class="sourceCode" id="cb17"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="co"># The last time I tried (2022-01-11) this gives an error in solve.default(omega.eta)</span> -<span class="co"># system is computationally singular: reciprocal condition number = 5e-17</span> -<span class="co">#f_parent_saemix_dfop_tc_10k <- mkin::saem(f_parent_mkin_tc["DFOP", ], quiet = TRUE,</span> -<span class="co"># control = saemix_control_10k, transformations = "saemix")</span> -<span class="co"># Now we do not get a significant improvement by using twice the number of iterations</span> <span class="va">f_parent_saemix_dfop_tc_moreiter</span> <span class="op"><-</span> <span class="fu">mkin</span><span class="fu">::</span><span class="fu"><a href="../../reference/saem.html">saem</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span>, control <span class="op">=</span> <span class="va">saemix_control_moreiter</span>, transformations <span class="op">=</span> <span class="st">"saemix"</span><span class="op">)</span> -<span class="co">#plot(f_parent_saemix_dfop_tc_moreiter$so, plot.type = "convergence")</span></code></pre></div> -<p>An alternative way to fit DFOP in combination with the two-component error model is to use the model formulation with transformed parameters as used per default in mkin.</p> -<div class="sourceCode" id="cb18"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="va">f_parent_saemix_dfop_tc_mkin</span> <span class="op"><-</span> <span class="fu">mkin</span><span class="fu">::</span><span class="fu"><a href="../../reference/saem.html">saem</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span>, - control <span class="op">=</span> <span class="va">saemix_control</span>, transformations <span class="op">=</span> <span class="st">"mkin"</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/pkg/saemix/man/plot-SaemixObject-ANY-method.html">plot</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc_mkin</span><span class="op">$</span><span class="va">so</span>, plot.type <span class="op">=</span> <span class="st">"convergence"</span><span class="op">)</span></code></pre></div> -<p><img src="dimethenamid_2018_files/figure-html/f_parent_saemix_dfop_tc_mkin-1.png" width="700"> As the convergence plots do not clearly indicate that the algorithm has converged, we again use four times the number of iterations, which leads to almost satisfactory convergence (see below).</p> +<span class="fu"><a href="https://rdrr.io/pkg/saemix/man/plot-SaemixObject-ANY-method.html" class="external-link">plot</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc</span><span class="op">$</span><span class="va">so</span>, plot.type <span class="op">=</span> <span class="st">"convergence"</span><span class="op">)</span></code></pre></div> +<p><img src="dimethenamid_2018_files/figure-html/f_parent_saemix_dfop_tc-1.png" width="700"></p> +<p>Doubling the number of iterations in the first phase of the algorithm leads to a slightly lower likelihood, and therefore to slightly higher AIC and BIC values. With even more iterations, the algorithm stops with an error message. This is related to the variance of k2 approximating zero. This has been submitted as a <a href="https://github.com/saemixdevelopment/saemixextension/issues/29" class="external-link">bug to the saemix package</a>, as the algorithm does not converge in this case.</p> +<p>An alternative way to fit DFOP in combination with the two-component error model is to use the model formulation with transformed parameters as used per default in mkin. When using this option, convergence is slower, but eventually the algorithm stops as well with the same error message.</p> +<p>The four combinations (SFO/const, SFO/tc, DFOP/const and DFOP/tc) and the version with increased iterations can be compared using the model comparison function of the saemix package:</p> <div class="sourceCode" id="cb19"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="va">saemix_control_muchmoreiter</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/saemix/man/saemixControl.html">saemixControl</a></span><span class="op">(</span>nbiter.saemix <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">3200</span>, <span class="fl">300</span><span class="op">)</span>, nb.chains <span class="op">=</span> <span class="fl">15</span>, - print <span class="op">=</span> <span class="cn">FALSE</span>, save <span class="op">=</span> <span class="cn">FALSE</span>, save.graphs <span class="op">=</span> <span class="cn">FALSE</span>, displayProgress <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span> -<span class="va">f_parent_saemix_dfop_tc_mkin_muchmoreiter</span> <span class="op"><-</span> <span class="fu">mkin</span><span class="fu">::</span><span class="fu"><a href="../../reference/saem.html">saem</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span>, - control <span class="op">=</span> <span class="va">saemix_control_muchmoreiter</span>, transformations <span class="op">=</span> <span class="st">"mkin"</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/pkg/saemix/man/plot-SaemixObject-ANY-method.html">plot</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc_mkin_muchmoreiter</span><span class="op">$</span><span class="va">so</span>, plot.type <span class="op">=</span> <span class="st">"convergence"</span><span class="op">)</span></code></pre></div> -<p><img src="dimethenamid_2018_files/figure-html/f_parent_saemix_dfop_tc_mkin_moreiter-1.png" width="700"></p> -<p>The four combinations (SFO/const, SFO/tc, DFOP/const and DFOP/tc), including the variations of the DFOP/tc combination can be compared using the model comparison function of the saemix package:</p> -<div class="sourceCode" id="cb20"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="va">AIC_parent_saemix</span> <span class="op"><-</span> <span class="fu">saemix</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/saemix/man/compare.saemix.html">compare.saemix</a></span><span class="op">(</span> +<code class="sourceCode R"><span class="va">AIC_parent_saemix</span> <span class="op"><-</span> <span class="fu">saemix</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/saemix/man/compare.saemix.html" class="external-link">compare.saemix</a></span><span class="op">(</span> <span class="va">f_parent_saemix_sfo_const</span><span class="op">$</span><span class="va">so</span>, <span class="va">f_parent_saemix_sfo_tc</span><span class="op">$</span><span class="va">so</span>, <span class="va">f_parent_saemix_dfop_const</span><span class="op">$</span><span class="va">so</span>, <span class="va">f_parent_saemix_dfop_tc</span><span class="op">$</span><span class="va">so</span>, - <span class="va">f_parent_saemix_dfop_tc_moreiter</span><span class="op">$</span><span class="va">so</span>, - <span class="va">f_parent_saemix_dfop_tc_mkin</span><span class="op">$</span><span class="va">so</span>, - <span class="va">f_parent_saemix_dfop_tc_mkin_muchmoreiter</span><span class="op">$</span><span class="va">so</span><span class="op">)</span></code></pre></div> + <span class="va">f_parent_saemix_dfop_tc_moreiter</span><span class="op">$</span><span class="va">so</span><span class="op">)</span></code></pre></div> <pre><code>Likelihoods calculated by importance sampling</code></pre> -<div class="sourceCode" id="cb22"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/colnames.html">rownames</a></span><span class="op">(</span><span class="va">AIC_parent_saemix</span><span class="op">)</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="st">"SFO const"</span>, <span class="st">"SFO tc"</span>, <span class="st">"DFOP const"</span>, <span class="st">"DFOP tc"</span>, <span class="st">"DFOP tc more iterations"</span>, - <span class="st">"DFOP tc mkintrans"</span>, <span class="st">"DFOP tc mkintrans more iterations"</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">AIC_parent_saemix</span><span class="op">)</span></code></pre></div> -<pre><code> AIC BIC -SFO const 796.38 795.34 -SFO tc 798.38 797.13 -DFOP const 705.75 703.88 -DFOP tc 665.65 663.57 -DFOP tc more iterations 665.88 663.80 -DFOP tc mkintrans 674.02 671.94 -DFOP tc mkintrans more iterations 667.94 665.86</code></pre> -<p>As in the case of nlme fits, the DFOP model fitted with two-component error (number 4) gives the lowest AIC. Using a much larger number of iterations does not significantly change the AIC. When the mkin transformations are used instead of the saemix transformations, we need four times the number of iterations to obtain a goodness of fit that almost as good as the result obtained with saemix transformations.</p> +<div class="sourceCode" id="cb21"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/colnames.html" class="external-link">rownames</a></span><span class="op">(</span><span class="va">AIC_parent_saemix</span><span class="op">)</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="st">"SFO const"</span>, <span class="st">"SFO tc"</span>, <span class="st">"DFOP const"</span>, <span class="st">"DFOP tc"</span>, <span class="st">"DFOP tc more iterations"</span><span class="op">)</span> +<span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">AIC_parent_saemix</span><span class="op">)</span></code></pre></div> +<pre><code> AIC BIC +SFO const 796.38 795.34 +SFO tc 798.38 797.13 +DFOP const 705.75 703.88 +DFOP tc 665.65 663.57 +DFOP tc more iterations 665.88 663.80</code></pre> <p>In order to check the influence of the likelihood calculation algorithms implemented in saemix, the likelihood from Gaussian quadrature is added to the best fit, and the AIC values obtained from the three methods are compared.</p> -<div class="sourceCode" id="cb24"><pre class="downlit sourceCode r"> +<div class="sourceCode" id="cb23"><pre class="downlit sourceCode r"> <code class="sourceCode R"><span class="va">f_parent_saemix_dfop_tc</span><span class="op">$</span><span class="va">so</span> <span class="op"><-</span> - <span class="fu">saemix</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/saemix/man/llgq.saemix.html">llgq.saemix</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc</span><span class="op">$</span><span class="va">so</span><span class="op">)</span> -<span class="va">AIC_parent_saemix_methods</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span> - is <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/stats/AIC.html">AIC</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc</span><span class="op">$</span><span class="va">so</span>, method <span class="op">=</span> <span class="st">"is"</span><span class="op">)</span>, - gq <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/stats/AIC.html">AIC</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc</span><span class="op">$</span><span class="va">so</span>, method <span class="op">=</span> <span class="st">"gq"</span><span class="op">)</span>, - lin <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/stats/AIC.html">AIC</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc</span><span class="op">$</span><span class="va">so</span>, method <span class="op">=</span> <span class="st">"lin"</span><span class="op">)</span> + <span class="fu">saemix</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/saemix/man/llgq.saemix.html" class="external-link">llgq.saemix</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc</span><span class="op">$</span><span class="va">so</span><span class="op">)</span> +<span class="va">AIC_parent_saemix_methods</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> + is <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/stats/AIC.html" class="external-link">AIC</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc</span><span class="op">$</span><span class="va">so</span>, method <span class="op">=</span> <span class="st">"is"</span><span class="op">)</span>, + gq <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/stats/AIC.html" class="external-link">AIC</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc</span><span class="op">$</span><span class="va">so</span>, method <span class="op">=</span> <span class="st">"gq"</span><span class="op">)</span>, + lin <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/stats/AIC.html" class="external-link">AIC</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc</span><span class="op">$</span><span class="va">so</span>, method <span class="op">=</span> <span class="st">"lin"</span><span class="op">)</span> <span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">AIC_parent_saemix_methods</span><span class="op">)</span></code></pre></div> +<span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">AIC_parent_saemix_methods</span><span class="op">)</span></code></pre></div> <pre><code> is gq lin 665.65 665.68 665.11 </code></pre> -<p>The AIC values based on importance sampling and Gaussian quadrature are very similar. Using linearisation is known to be less accurate, but still gives a similar value.</p> +<p>The AIC values based on importance sampling and Gaussian quadrature are very similar. Using linearisation is known to be less accurate, but still gives a similar value. In order to illustrate that the comparison of the three method depends on the degree of convergence obtained in the fit, the same comparison is shown below for the fit using the defaults for the number of iterations and the number of MCMC chains.</p> +<div class="sourceCode" id="cb25"><pre class="downlit sourceCode r"> +<code class="sourceCode R"><span class="va">f_parent_saemix_dfop_tc_defaults</span> <span class="op"><-</span> <span class="fu">mkin</span><span class="fu">::</span><span class="fu"><a href="../../reference/saem.html">saem</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span><span class="op">)</span> +<span class="va">f_parent_saemix_dfop_tc_defaults</span><span class="op">$</span><span class="va">so</span> <span class="op"><-</span> + <span class="fu">saemix</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/saemix/man/llgq.saemix.html" class="external-link">llgq.saemix</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc_defaults</span><span class="op">$</span><span class="va">so</span><span class="op">)</span> +<span class="va">AIC_parent_saemix_methods_defaults</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> + is <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/stats/AIC.html" class="external-link">AIC</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc_defaults</span><span class="op">$</span><span class="va">so</span>, method <span class="op">=</span> <span class="st">"is"</span><span class="op">)</span>, + gq <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/stats/AIC.html" class="external-link">AIC</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc_defaults</span><span class="op">$</span><span class="va">so</span>, method <span class="op">=</span> <span class="st">"gq"</span><span class="op">)</span>, + lin <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/stats/AIC.html" class="external-link">AIC</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc_defaults</span><span class="op">$</span><span class="va">so</span>, method <span class="op">=</span> <span class="st">"lin"</span><span class="op">)</span> +<span class="op">)</span> +<span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">AIC_parent_saemix_methods_defaults</span><span class="op">)</span></code></pre></div> +<pre><code> is gq lin +668.27 718.36 666.49 </code></pre> </div> -<div id="nlmixr" class="section level3"> -<h3 class="hasAnchor"> -<a href="#nlmixr" class="anchor"></a>nlmixr</h3> +<div class="section level4"> +<h4 id="nlmixr">nlmixr<a class="anchor" aria-label="anchor" href="#nlmixr"></a> +</h4> <p>In the last years, a lot of effort has been put into the nlmixr package which is designed for pharmacokinetics, where nonlinear mixed-effects models are routinely used, but which can also be used for related data like chemical degradation data. A current development branch of the mkin package provides an interface between mkin and nlmixr. Here, we check if we get equivalent results when using a refined version of the First Order Conditional Estimation (FOCE) algorithm used in nlme, namely the First Order Conditional Estimation with Interaction (FOCEI), and the SAEM algorithm as implemented in nlmixr.</p> -<p>First, the focei algorithm is used for the four model combinations. A number of warnings are produced with unclear significance.</p> -<div class="sourceCode" id="cb26"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://github.com/nlmixrdevelopment/nlmixr">nlmixr</a></span><span class="op">)</span> -<span class="va">f_parent_nlmixr_focei_sfo_const</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"focei"</span><span class="op">)</span> -<span class="va">f_parent_nlmixr_focei_sfo_tc</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"focei"</span><span class="op">)</span> -<span class="va">f_parent_nlmixr_focei_dfop_const</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"focei"</span><span class="op">)</span> -<span class="va">f_parent_nlmixr_focei_dfop_tc</span><span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"focei"</span><span class="op">)</span></code></pre></div> +<p>First, the focei algorithm is used for the four model combinations.</p> <div class="sourceCode" id="cb27"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="va">aic_nlmixr_focei</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/lapply.html">sapply</a></span><span class="op">(</span> - <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_focei_sfo_const</span><span class="op">$</span><span class="va">nm</span>, <span class="va">f_parent_nlmixr_focei_sfo_tc</span><span class="op">$</span><span class="va">nm</span>, - <span class="va">f_parent_nlmixr_focei_dfop_const</span><span class="op">$</span><span class="va">nm</span>, <span class="va">f_parent_nlmixr_focei_dfop_tc</span><span class="op">$</span><span class="va">nm</span><span class="op">)</span>, - <span class="va">AIC</span><span class="op">)</span></code></pre></div> -<p>The AIC values are very close to the ones obtained with nlme which are repeated below for convenience.</p> +<code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://github.com/nlmixrdevelopment/nlmixr" class="external-link">nlmixr</a></span><span class="op">)</span> +<span class="va">f_parent_nlmixr_focei_sfo_const</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html" class="external-link">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"focei"</span><span class="op">)</span> +<span class="va">f_parent_nlmixr_focei_sfo_tc</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html" class="external-link">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"focei"</span><span class="op">)</span> +<span class="va">f_parent_nlmixr_focei_dfop_const</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html" class="external-link">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"focei"</span><span class="op">)</span> +<span class="va">f_parent_nlmixr_focei_dfop_tc</span><span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html" class="external-link">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"focei"</span><span class="op">)</span></code></pre></div> +<p>For the SFO model with constant variance, the AIC values are the same, for the DFOP model, there are significant differences between the AIC values. These may be caused by different solutions that are found, but also by the fact that the AIC values for the nlmixr fits are calculated based on Gaussian quadrature, not on linearisation.</p> <div class="sourceCode" id="cb28"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="va">aic_nlme</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/lapply.html">sapply</a></span><span class="op">(</span> - <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">f_parent_nlme_sfo_const</span>, <span class="cn">NA</span>, <span class="va">f_parent_nlme_sfo_tc</span>, <span class="va">f_parent_nlme_dfop_tc</span><span class="op">)</span>, - <span class="kw">function</span><span class="op">(</span><span class="va">x</span><span class="op">)</span> <span class="kw">if</span> <span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/NA.html">is.na</a></span><span class="op">(</span><span class="va">x</span><span class="op">[</span><span class="fl">1</span><span class="op">]</span><span class="op">)</span><span class="op">)</span> <span class="cn">NA</span> <span class="kw">else</span> <span class="fu"><a href="https://rdrr.io/r/stats/AIC.html">AIC</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span><span class="op">)</span> -<span class="va">aic_nlme_nlmixr_focei</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span> - <span class="st">"Degradation model"</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="st">"SFO"</span>, <span class="st">"SFO"</span>, <span class="st">"DFOP"</span>, <span class="st">"DFOP"</span><span class="op">)</span>, - <span class="st">"Error model"</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/rep.html">rep</a></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="st">"constant variance"</span>, <span class="st">"two-component"</span><span class="op">)</span>, <span class="fl">2</span><span class="op">)</span>, +<code class="sourceCode R"><span class="va">aic_nlmixr_focei</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/lapply.html" class="external-link">sapply</a></span><span class="op">(</span> + <span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_focei_sfo_const</span><span class="op">$</span><span class="va">nm</span>, <span class="va">f_parent_nlmixr_focei_sfo_tc</span><span class="op">$</span><span class="va">nm</span>, + <span class="va">f_parent_nlmixr_focei_dfop_const</span><span class="op">$</span><span class="va">nm</span>, <span class="va">f_parent_nlmixr_focei_dfop_tc</span><span class="op">$</span><span class="va">nm</span><span class="op">)</span>, + <span class="va">AIC</span><span class="op">)</span> +<span class="va">aic_nlme</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/lapply.html" class="external-link">sapply</a></span><span class="op">(</span> + <span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span><span class="va">f_parent_nlme_sfo_const</span>, <span class="cn">NA</span>, <span class="va">f_parent_nlme_sfo_tc</span>, <span class="va">f_parent_nlme_dfop_tc</span><span class="op">)</span>, + <span class="kw">function</span><span class="op">(</span><span class="va">x</span><span class="op">)</span> <span class="kw">if</span> <span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/NA.html" class="external-link">is.na</a></span><span class="op">(</span><span class="va">x</span><span class="op">[</span><span class="fl">1</span><span class="op">]</span><span class="op">)</span><span class="op">)</span> <span class="cn">NA</span> <span class="kw">else</span> <span class="fu"><a href="https://rdrr.io/r/stats/AIC.html" class="external-link">AIC</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span><span class="op">)</span> +<span class="va">aic_nlme_nlmixr_focei</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a></span><span class="op">(</span> + <span class="st">"Degradation model"</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="st">"SFO"</span>, <span class="st">"SFO"</span>, <span class="st">"DFOP"</span>, <span class="st">"DFOP"</span><span class="op">)</span>, + <span class="st">"Error model"</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/rep.html" class="external-link">rep</a></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="st">"constant variance"</span>, <span class="st">"two-component"</span><span class="op">)</span>, <span class="fl">2</span><span class="op">)</span>, <span class="st">"AIC (nlme)"</span> <span class="op">=</span> <span class="va">aic_nlme</span>, <span class="st">"AIC (nlmixr with FOCEI)"</span> <span class="op">=</span> <span class="va">aic_nlmixr_focei</span>, check.names <span class="op">=</span> <span class="cn">FALSE</span> <span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/r/base/print.html">print</a></span><span class="op">(</span><span class="va">aic_nlme_nlmixr_focei</span><span class="op">)</span></code></pre></div> +<span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">aic_nlme_nlmixr_focei</span><span class="op">)</span></code></pre></div> <pre><code> Degradation model Error model AIC (nlme) AIC (nlmixr with FOCEI) 1 SFO constant variance 796.60 796.60 2 SFO two-component NA 798.64 3 DFOP constant variance 798.60 745.87 4 DFOP two-component 671.91 740.42</code></pre> -<p>Secondly, we use the SAEM estimation routine and check the convergence plots. The control parameters also used for the saemix fits are defined beforehand.</p> +<p>Secondly, we use the SAEM estimation routine and check the convergence plots. The control parameters, which were also used for the saemix fits, are defined beforehand.</p> <div class="sourceCode" id="cb30"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="va">nlmixr_saem_control_800</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/saemControl.html">saemControl</a></span><span class="op">(</span>logLik <span class="op">=</span> <span class="cn">TRUE</span>, +<code class="sourceCode R"><span class="va">nlmixr_saem_control_800</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/saemControl.html" class="external-link">saemControl</a></span><span class="op">(</span>logLik <span class="op">=</span> <span class="cn">TRUE</span>, nBurn <span class="op">=</span> <span class="fl">800</span>, nEm <span class="op">=</span> <span class="fl">300</span>, nmc <span class="op">=</span> <span class="fl">15</span><span class="op">)</span> -<span class="va">nlmixr_saem_control_1000</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/saemControl.html">saemControl</a></span><span class="op">(</span>logLik <span class="op">=</span> <span class="cn">TRUE</span>, - nBurn <span class="op">=</span> <span class="fl">1000</span>, nEm <span class="op">=</span> <span class="fl">300</span>, nmc <span class="op">=</span> <span class="fl">15</span><span class="op">)</span> -<span class="va">nlmixr_saem_control_10k</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/saemControl.html">saemControl</a></span><span class="op">(</span>logLik <span class="op">=</span> <span class="cn">TRUE</span>, +<span class="va">nlmixr_saem_control_moreiter</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/saemControl.html" class="external-link">saemControl</a></span><span class="op">(</span>logLik <span class="op">=</span> <span class="cn">TRUE</span>, + nBurn <span class="op">=</span> <span class="fl">1600</span>, nEm <span class="op">=</span> <span class="fl">300</span>, nmc <span class="op">=</span> <span class="fl">15</span><span class="op">)</span> +<span class="va">nlmixr_saem_control_10k</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/saemControl.html" class="external-link">saemControl</a></span><span class="op">(</span>logLik <span class="op">=</span> <span class="cn">TRUE</span>, nBurn <span class="op">=</span> <span class="fl">10000</span>, nEm <span class="op">=</span> <span class="fl">1000</span>, nmc <span class="op">=</span> <span class="fl">15</span><span class="op">)</span></code></pre></div> <p>Then we fit SFO with constant variance</p> <div class="sourceCode" id="cb31"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="va">f_parent_nlmixr_saem_sfo_const</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"saem"</span>, +<code class="sourceCode R"><span class="va">f_parent_nlmixr_saem_sfo_const</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html" class="external-link">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"saem"</span>, control <span class="op">=</span> <span class="va">nlmixr_saem_control_800</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/traceplot.html">traceplot</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_sfo_const</span><span class="op">$</span><span class="va">nm</span><span class="op">)</span></code></pre></div> +<span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/traceplot.html" class="external-link">traceplot</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_sfo_const</span><span class="op">$</span><span class="va">nm</span><span class="op">)</span></code></pre></div> <p><img src="dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_sfo_const-1.png" width="700"></p> <p>and SFO with two-component error.</p> <div class="sourceCode" id="cb32"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="va">f_parent_nlmixr_saem_sfo_tc</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"saem"</span>, +<code class="sourceCode R"><span class="va">f_parent_nlmixr_saem_sfo_tc</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html" class="external-link">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"SFO"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"saem"</span>, control <span class="op">=</span> <span class="va">nlmixr_saem_control_800</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/traceplot.html">traceplot</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_sfo_tc</span><span class="op">$</span><span class="va">nm</span><span class="op">)</span></code></pre></div> +<span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/traceplot.html" class="external-link">traceplot</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_sfo_tc</span><span class="op">$</span><span class="va">nm</span><span class="op">)</span></code></pre></div> <p><img src="dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_sfo_tc-1.png" width="700"></p> -<p>For DFOP with constant variance, the convergence plots show considerable instability of the fit, which indicates overparameterisation which was already observed above for this model combination.</p> +<p>For DFOP with constant variance, the convergence plots show considerable instability of the fit, which indicates overparameterisation which was already observed above for this model combination. Also note that the variance of k2 approximates zero, which was already observed in the saemix fits of the DFOP model.</p> <div class="sourceCode" id="cb33"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="va">f_parent_nlmixr_saem_dfop_const</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"saem"</span>, +<code class="sourceCode R"><span class="va">f_parent_nlmixr_saem_dfop_const</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html" class="external-link">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_const</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"saem"</span>, control <span class="op">=</span> <span class="va">nlmixr_saem_control_800</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/traceplot.html">traceplot</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_dfop_const</span><span class="op">$</span><span class="va">nm</span><span class="op">)</span></code></pre></div> +<span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/traceplot.html" class="external-link">traceplot</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_dfop_const</span><span class="op">$</span><span class="va">nm</span><span class="op">)</span></code></pre></div> <p><img src="dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_const-1.png" width="700"></p> -<p>For DFOP with two-component error, a less erratic convergence is seen.</p> +<p>For DFOP with two-component error, a less erratic convergence is seen, but the variance of k2 again approximates zero.</p> <div class="sourceCode" id="cb34"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="va">f_parent_nlmixr_saem_dfop_tc</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"saem"</span>, +<code class="sourceCode R"><span class="va">f_parent_nlmixr_saem_dfop_tc</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html" class="external-link">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"saem"</span>, control <span class="op">=</span> <span class="va">nlmixr_saem_control_800</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/traceplot.html">traceplot</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_dfop_tc</span><span class="op">$</span><span class="va">nm</span><span class="op">)</span></code></pre></div> +<span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/traceplot.html" class="external-link">traceplot</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_dfop_tc</span><span class="op">$</span><span class="va">nm</span><span class="op">)</span></code></pre></div> <p><img src="dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_tc-1.png" width="700"></p> <p>To check if an increase in the number of iterations improves the fit, we repeat the fit with 1000 iterations for the burn in phase and 300 iterations for the second phase.</p> <div class="sourceCode" id="cb35"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="va">f_parent_nlmixr_saem_dfop_tc_1000</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"saem"</span>, - control <span class="op">=</span> <span class="va">nlmixr_saem_control_1000</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/traceplot.html">traceplot</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_dfop_tc_1000</span><span class="op">$</span><span class="va">nm</span><span class="op">)</span></code></pre></div> +<code class="sourceCode R"><span class="va">f_parent_nlmixr_saem_dfop_tc_moreiter</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html" class="external-link">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"saem"</span>, + control <span class="op">=</span> <span class="va">nlmixr_saem_control_moreiter</span><span class="op">)</span> +<span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/traceplot.html" class="external-link">traceplot</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_dfop_tc_moreiter</span><span class="op">$</span><span class="va">nm</span><span class="op">)</span></code></pre></div> <p><img src="dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_tc_1k-1.png" width="700"></p> <p>Here the fit looks very similar, but we will see below that it shows a higher AIC than the fit with 800 iterations in the burn in phase. Next we choose 10 000 iterations for the burn in phase and 1000 iterations for the second phase for comparison with saemix.</p> <div class="sourceCode" id="cb36"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="va">f_parent_nlmixr_saem_dfop_tc_10k</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"saem"</span>, +<code class="sourceCode R"><span class="va">f_parent_nlmixr_saem_dfop_tc_10k</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/nlmixr.html" class="external-link">nlmixr</a></span><span class="op">(</span><span class="va">f_parent_mkin_tc</span><span class="op">[</span><span class="st">"DFOP"</span>, <span class="op">]</span>, est <span class="op">=</span> <span class="st">"saem"</span>, control <span class="op">=</span> <span class="va">nlmixr_saem_control_10k</span><span class="op">)</span> -<span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/traceplot.html">traceplot</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_dfop_tc_10k</span><span class="op">$</span><span class="va">nm</span><span class="op">)</span></code></pre></div> +<span class="fu"><a href="https://rdrr.io/pkg/nlmixr/man/traceplot.html" class="external-link">traceplot</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_dfop_tc_10k</span><span class="op">$</span><span class="va">nm</span><span class="op">)</span></code></pre></div> <p><img src="dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_tc_10k-1.png" width="700"></p> -<p>In the above convergence plot, the time course of ‘eta.DMTA_0’ and ‘log_k2’ indicate a false convergence.</p> <p>The AIC values are internally calculated using Gaussian quadrature.</p> <div class="sourceCode" id="cb37"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/stats/AIC.html">AIC</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_sfo_const</span><span class="op">$</span><span class="va">nm</span>, <span class="va">f_parent_nlmixr_saem_sfo_tc</span><span class="op">$</span><span class="va">nm</span>, +<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/stats/AIC.html" class="external-link">AIC</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_sfo_const</span><span class="op">$</span><span class="va">nm</span>, <span class="va">f_parent_nlmixr_saem_sfo_tc</span><span class="op">$</span><span class="va">nm</span>, <span class="va">f_parent_nlmixr_saem_dfop_const</span><span class="op">$</span><span class="va">nm</span>, <span class="va">f_parent_nlmixr_saem_dfop_tc</span><span class="op">$</span><span class="va">nm</span>, - <span class="va">f_parent_nlmixr_saem_dfop_tc_1000</span><span class="op">$</span><span class="va">nm</span>, + <span class="va">f_parent_nlmixr_saem_dfop_tc_moreiter</span><span class="op">$</span><span class="va">nm</span>, <span class="va">f_parent_nlmixr_saem_dfop_tc_10k</span><span class="op">$</span><span class="va">nm</span><span class="op">)</span></code></pre></div> -<pre><code> df AIC -f_parent_nlmixr_saem_sfo_const$nm 5 798.71 -f_parent_nlmixr_saem_sfo_tc$nm 6 808.64 -f_parent_nlmixr_saem_dfop_const$nm 9 1995.96 -f_parent_nlmixr_saem_dfop_tc$nm 10 664.96 -f_parent_nlmixr_saem_dfop_tc_1000$nm 10 667.39 -f_parent_nlmixr_saem_dfop_tc_10k$nm 10 Inf</code></pre> -<p>We can see that again, the DFOP/tc model shows the best goodness of fit. However, increasing the number of burn-in iterations from 800 to 1000 results in a higher AIC. If we further increase the number of iterations to 10 000 (burn-in) and 1000 (second phase), the AIC cannot be calculated for the nlmixr/saem fit, supporting that the fit did not converge properly.</p> +<pre><code> df AIC +f_parent_nlmixr_saem_sfo_const$nm 5 798.71 +f_parent_nlmixr_saem_sfo_tc$nm 6 808.64 +f_parent_nlmixr_saem_dfop_const$nm 9 1995.96 +f_parent_nlmixr_saem_dfop_tc$nm 10 664.96 +f_parent_nlmixr_saem_dfop_tc_moreiter$nm 10 4464.93 +f_parent_nlmixr_saem_dfop_tc_10k$nm 10 Inf</code></pre> +<p>We can see that again, the DFOP/tc model shows the best goodness of fit. However, increasing the number of burn-in iterations from 800 to 1600 results in a higher AIC. If we further increase the number of iterations to 10 000 (burn-in) and 1000 (second phase), the AIC cannot be calculated for the nlmixr/saem fit, confirming that this fit does not converge properly with the SAEM algorithm.</p> </div> -<div id="comparison" class="section level3"> -<h3 class="hasAnchor"> -<a href="#comparison" class="anchor"></a>Comparison</h3> +<div class="section level4"> +<h4 id="comparison">Comparison<a class="anchor" aria-label="anchor" href="#comparison"></a> +</h4> <p>The following table gives the AIC values obtained with the three packages using the same control parameters (800 iterations burn-in, 300 iterations second phase, 15 chains).</p> <div class="sourceCode" id="cb39"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="va">AIC_all</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span> +<code class="sourceCode R"><span class="va">AIC_all</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a></span><span class="op">(</span> check.names <span class="op">=</span> <span class="cn">FALSE</span>, - <span class="st">"Degradation model"</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="st">"SFO"</span>, <span class="st">"SFO"</span>, <span class="st">"DFOP"</span>, <span class="st">"DFOP"</span><span class="op">)</span>, - <span class="st">"Error model"</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="st">"const"</span>, <span class="st">"tc"</span>, <span class="st">"const"</span>, <span class="st">"tc"</span><span class="op">)</span>, - nlme <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="fu"><a href="https://rdrr.io/r/stats/AIC.html">AIC</a></span><span class="op">(</span><span class="va">f_parent_nlme_sfo_const</span><span class="op">)</span>, <span class="fu"><a href="https://rdrr.io/r/stats/AIC.html">AIC</a></span><span class="op">(</span><span class="va">f_parent_nlme_sfo_tc</span><span class="op">)</span>, <span class="cn">NA</span>, <span class="fu"><a href="https://rdrr.io/r/stats/AIC.html">AIC</a></span><span class="op">(</span><span class="va">f_parent_nlme_dfop_tc</span><span class="op">)</span><span class="op">)</span>, - nlmixr_focei <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/lapply.html">sapply</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_focei_sfo_const</span><span class="op">$</span><span class="va">nm</span>, <span class="va">f_parent_nlmixr_focei_sfo_tc</span><span class="op">$</span><span class="va">nm</span>, + <span class="st">"Degradation model"</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="st">"SFO"</span>, <span class="st">"SFO"</span>, <span class="st">"DFOP"</span>, <span class="st">"DFOP"</span><span class="op">)</span>, + <span class="st">"Error model"</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="st">"const"</span>, <span class="st">"tc"</span>, <span class="st">"const"</span>, <span class="st">"tc"</span><span class="op">)</span>, + nlme <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="fu"><a href="https://rdrr.io/r/stats/AIC.html" class="external-link">AIC</a></span><span class="op">(</span><span class="va">f_parent_nlme_sfo_const</span><span class="op">)</span>, <span class="fu"><a href="https://rdrr.io/r/stats/AIC.html" class="external-link">AIC</a></span><span class="op">(</span><span class="va">f_parent_nlme_sfo_tc</span><span class="op">)</span>, <span class="cn">NA</span>, <span class="fu"><a href="https://rdrr.io/r/stats/AIC.html" class="external-link">AIC</a></span><span class="op">(</span><span class="va">f_parent_nlme_dfop_tc</span><span class="op">)</span><span class="op">)</span>, + nlmixr_focei <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/lapply.html" class="external-link">sapply</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_focei_sfo_const</span><span class="op">$</span><span class="va">nm</span>, <span class="va">f_parent_nlmixr_focei_sfo_tc</span><span class="op">$</span><span class="va">nm</span>, <span class="va">f_parent_nlmixr_focei_dfop_const</span><span class="op">$</span><span class="va">nm</span>, <span class="va">f_parent_nlmixr_focei_dfop_tc</span><span class="op">$</span><span class="va">nm</span><span class="op">)</span>, <span class="va">AIC</span><span class="op">)</span>, - saemix <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/lapply.html">sapply</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">f_parent_saemix_sfo_const</span><span class="op">$</span><span class="va">so</span>, <span class="va">f_parent_saemix_sfo_tc</span><span class="op">$</span><span class="va">so</span>, + saemix <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/lapply.html" class="external-link">sapply</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span><span class="va">f_parent_saemix_sfo_const</span><span class="op">$</span><span class="va">so</span>, <span class="va">f_parent_saemix_sfo_tc</span><span class="op">$</span><span class="va">so</span>, <span class="va">f_parent_saemix_dfop_const</span><span class="op">$</span><span class="va">so</span>, <span class="va">f_parent_saemix_dfop_tc</span><span class="op">$</span><span class="va">so</span><span class="op">)</span>, <span class="va">AIC</span><span class="op">)</span>, - nlmixr_saem <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/lapply.html">sapply</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_sfo_const</span><span class="op">$</span><span class="va">nm</span>, <span class="va">f_parent_nlmixr_saem_sfo_tc</span><span class="op">$</span><span class="va">nm</span>, + nlmixr_saem <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/lapply.html" class="external-link">sapply</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_sfo_const</span><span class="op">$</span><span class="va">nm</span>, <span class="va">f_parent_nlmixr_saem_sfo_tc</span><span class="op">$</span><span class="va">nm</span>, <span class="va">f_parent_nlmixr_saem_dfop_const</span><span class="op">$</span><span class="va">nm</span>, <span class="va">f_parent_nlmixr_saem_dfop_tc</span><span class="op">$</span><span class="va">nm</span><span class="op">)</span>, <span class="va">AIC</span><span class="op">)</span> <span class="op">)</span> <span class="fu">kable</span><span class="op">(</span><span class="va">AIC_all</span><span class="op">)</span></code></pre></div> @@ -460,132 +463,22 @@ f_parent_nlmixr_saem_dfop_tc_10k$nm 10 Inf</code></pre> </tr> </tbody> </table> -<div class="sourceCode" id="cb40"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/pkg/nlme/man/intervals.html">intervals</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc</span><span class="op">)</span></code></pre></div> -<pre><code>Approximate 95% confidence intervals - - Fixed effects: - lower est. upper -DMTA_0 96.3087887 98.2761715 100.243554 -k1 0.0336893 0.0643651 0.095041 -k2 0.0062993 0.0088001 0.011301 -g 0.9100426 0.9524920 0.994941 - - Random effects: - lower est. upper -sd(DMTA_0) 0.41868 2.0607469 3.70281 -sd(k1) 0.25611 0.5935653 0.93102 -sd(k2) -10.29603 0.0029188 10.30187 -sd(g) 0.38083 1.0572543 1.73368 - - - lower est. upper -a.1 0.86253 1.061610 1.260690 -b.1 0.02262 0.029666 0.036712</code></pre> -<div class="sourceCode" id="cb42"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/pkg/nlme/man/intervals.html">intervals</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc</span><span class="op">)</span></code></pre></div> -<pre><code>Approximate 95% confidence intervals - - Fixed effects: - lower est. upper -DMTA_0 96.3087887 98.2761715 100.243554 -k1 0.0336893 0.0643651 0.095041 -k2 0.0062993 0.0088001 0.011301 -g 0.9100426 0.9524920 0.994941 - - Random effects: - lower est. upper -sd(DMTA_0) 0.41868 2.0607469 3.70281 -sd(k1) 0.25611 0.5935653 0.93102 -sd(k2) -10.29603 0.0029188 10.30187 -sd(g) 0.38083 1.0572543 1.73368 - - - lower est. upper -a.1 0.86253 1.061610 1.260690 -b.1 0.02262 0.029666 0.036712</code></pre> -<div class="sourceCode" id="cb44"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/pkg/nlme/man/intervals.html">intervals</a></span><span class="op">(</span><span class="va">f_parent_saemix_dfop_tc_mkin_muchmoreiter</span><span class="op">)</span></code></pre></div> -<pre><code>Approximate 95% confidence intervals - - Fixed effects: - lower est. upper -DMTA_0 96.3402070 98.2789378 100.217669 -k1 0.0397896 0.0641976 0.103578 -k2 0.0041987 0.0084427 0.016977 -g 0.8656257 0.9521509 0.983992 - - Random effects: - lower est. upper -sd(DMTA_0) 0.38907 2.01821 3.64735 -sd(log_k1) 0.25653 0.59512 0.93371 -sd(log_k2) -0.20501 0.37610 0.95721 -sd(g_qlogis) 0.39712 1.18296 1.96879 - - - lower est. upper -a.1 0.868558 1.070260 1.271963 -b.1 0.022461 0.029505 0.036548</code></pre> -<div class="sourceCode" id="cb46"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/pkg/nlme/man/intervals.html">intervals</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_dfop_tc</span><span class="op">)</span></code></pre></div> -<pre><code>Approximate 95% confidence intervals - - Fixed effects: - lower est. upper -DMTA_0 96.3224806 98.2941093 100.265738 -k1 0.0402270 0.0648200 0.104448 -k2 0.0068547 0.0093928 0.012871 -g 0.8764066 0.9501419 0.980848 - - Random effects: - lower est. upper -sd(DMTA_0) NA 1.686509 NA -sd(log_k1) NA 0.592805 NA -sd(log_k2) NA 0.009766 NA -sd(g_qlogis) NA 1.082616 NA - - - lower est. upper -sigma_low NA 1.081677 NA -rsd_high NA 0.032073 NA</code></pre> -<div class="sourceCode" id="cb48"><pre class="downlit sourceCode r"> -<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/pkg/nlme/man/intervals.html">intervals</a></span><span class="op">(</span><span class="va">f_parent_nlmixr_saem_dfop_tc_10k</span><span class="op">)</span></code></pre></div> -<pre><code>Approximate 95% confidence intervals - - Fixed effects: - lower est. upper -DMTA_0 96.2302085 98.1641090 100.098010 -k1 0.0398514 0.0643909 0.104041 -k2 0.0066292 0.0090784 0.012432 -g 0.8831478 0.9527284 0.981734 - - Random effects: - lower est. upper -sd(DMTA_0) NA 1.6257e+00 NA -sd(log_k1) NA 5.9627e-01 NA -sd(log_k2) NA 5.8400e-07 NA -sd(g_qlogis) NA 1.0676e+00 NA - - - lower est. upper -sigma_low NA 1.087722 NA -rsd_high NA 0.031883 NA</code></pre> </div> </div> </div> -<div id="references" class="section level1"> -<h1 class="hasAnchor"> -<a href="#references" class="anchor"></a>References</h1> +<div class="section level2"> +<h2 id="references">References<a class="anchor" aria-label="anchor" href="#references"></a> +</h2> <!-- vim: set foldmethod=syntax: --> <div id="refs" class="references hanging-indent"> <div id="ref-efsa_2018_dimethenamid"> <p>EFSA. 2018. “Peer Review of the Pesticide Risk Assessment of the Active Substance Dimethenamid-P.” <em>EFSA Journal</em> 16 (4): 5211.</p> </div> <div id="ref-ranke2021"> -<p>Ranke, Johannes, Janina Wöltjen, Jana Schmidt, and Emmanuelle Comets. 2021. “Taking Kinetic Evaluations of Degradation Data to the Next Level with Nonlinear Mixed-Effects Models.” <em>Environments</em> 8 (8). <a href="https://doi.org/10.3390/environments8080071">https://doi.org/10.3390/environments8080071</a>.</p> +<p>Ranke, Johannes, Janina Wöltjen, Jana Schmidt, and Emmanuelle Comets. 2021. “Taking Kinetic Evaluations of Degradation Data to the Next Level with Nonlinear Mixed-Effects Models.” <em>Environments</em> 8 (8). <a href="https://doi.org/10.3390/environments8080071" class="external-link">https://doi.org/10.3390/environments8080071</a>.</p> </div> <div id="ref-dimethenamid_rar_2018_b8"> -<p>Rapporteur Member State Germany, Co-Rapporteur Member State Bulgaria. 2018. “Renewal Assessment Report Dimethenamid-P Volume 3 - B.8 Environmental fate and behaviour, Rev. 2 - November 2017.” <a href="https://open.efsa.europa.eu/study-inventory/EFSA-Q-2014-00716">https://open.efsa.europa.eu/study-inventory/EFSA-Q-2014-00716</a>.</p> +<p>Rapporteur Member State Germany, Co-Rapporteur Member State Bulgaria. 2018. “Renewal Assessment Report Dimethenamid-P Volume 3 - B.8 Environmental fate and behaviour, Rev. 2 - November 2017.” <a href="https://open.efsa.europa.eu/study-inventory/EFSA-Q-2014-00716" class="external-link">https://open.efsa.europa.eu/study-inventory/EFSA-Q-2014-00716</a>.</p> </div> </div> </div> @@ -602,11 +495,13 @@ rsd_high NA 0.031883 NA</code></pre> <footer><div class="copyright"> - <p>Developed by Johannes Ranke.</p> + <p></p> +<p>Developed by Johannes Ranke.</p> </div> <div class="pkgdown"> - <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p> + <p></p> +<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.2.</p> </div> </footer> @@ -615,5 +510,7 @@ rsd_high NA 0.031883 NA</code></pre> + + </body> </html> diff --git a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_mkin_dfop_const-1.png b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_mkin_dfop_const-1.png Binary files differindex 8eb464d1..950abf27 100644 --- a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_mkin_dfop_const-1.png +++ b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_mkin_dfop_const-1.png diff --git a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_mkin_dfop_const_test-1.png b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_mkin_dfop_const_test-1.png Binary files differindex 9e4b951a..66481bc1 100644 --- a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_mkin_dfop_const_test-1.png +++ b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_mkin_dfop_const_test-1.png diff --git a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_mkin_dfop_tc_test-1.png b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_mkin_dfop_tc_test-1.png Binary files differindex 830fec65..557ccc45 100644 --- a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_mkin_dfop_tc_test-1.png +++ b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_mkin_dfop_tc_test-1.png diff --git a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_mkin_sfo_const-1.png b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_mkin_sfo_const-1.png Binary files differindex 133249a4..089ab64d 100644 --- a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_mkin_sfo_const-1.png +++ b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_mkin_sfo_const-1.png diff --git a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_const-1.png b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_const-1.png Binary files differindex 27546d8d..88089aaf 100644 --- a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_const-1.png +++ b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_const-1.png diff --git a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_tc-1.png b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_tc-1.png Binary files differindex dcb8a2f0..efc37a5f 100644 --- a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_tc-1.png +++ b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_tc-1.png diff --git a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_tc_10k-1.png b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_tc_10k-1.png Binary files differindex 7871ef69..ab2b1b2d 100644 --- a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_tc_10k-1.png +++ b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_tc_10k-1.png diff --git a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_tc_1k-1.png b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_tc_1k-1.png Binary files differindex 69aaae8e..70987378 100644 --- a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_tc_1k-1.png +++ b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_dfop_tc_1k-1.png diff --git a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_sfo_const-1.png b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_sfo_const-1.png Binary files differindex 4316ed0b..de0a0ded 100644 --- a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_sfo_const-1.png +++ b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_sfo_const-1.png diff --git a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_sfo_tc-1.png b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_sfo_tc-1.png Binary files differindex fb6dd51c..0b7f5090 100644 --- a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_sfo_tc-1.png +++ b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_nlmixr_saem_sfo_tc-1.png diff --git a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_saemix_dfop_const-1.png b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_saemix_dfop_const-1.png Binary files differindex fd4a686d..84a6fc92 100644 --- a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_saemix_dfop_const-1.png +++ b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_saemix_dfop_const-1.png diff --git a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_saemix_dfop_tc-1.png b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_saemix_dfop_tc-1.png Binary files differindex 25a82cbe..d154dc9b 100644 --- a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_saemix_dfop_tc-1.png +++ b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_saemix_dfop_tc-1.png diff --git a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_saemix_sfo_const-1.png b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_saemix_sfo_const-1.png Binary files differindex c406f3f2..7862fc65 100644 --- a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_saemix_sfo_const-1.png +++ b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_saemix_sfo_const-1.png diff --git a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_saemix_sfo_tc-1.png b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_saemix_sfo_tc-1.png Binary files differindex aaf2e0c8..800c320b 100644 --- a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_saemix_sfo_tc-1.png +++ b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/f_parent_saemix_sfo_tc-1.png diff --git a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/plot_parent_nlme-1.png b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/plot_parent_nlme-1.png Binary files differindex ed978664..849296d9 100644 --- a/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/plot_parent_nlme-1.png +++ b/docs/dev/articles/web_only/dimethenamid_2018_files/figure-html/plot_parent_nlme-1.png |