aboutsummaryrefslogtreecommitdiff
path: root/docs/articles
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2016-10-06 09:19:21 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2016-10-06 09:19:21 +0200
commit38f9e15f0c972c1516ae737a2bca8d7789581bbd (patch)
tree724c9dc19901f24f427757ac81001f07bf298024 /docs/articles
parentec1487f0f2cef32d44b0c6ce94a6f1b4f65a79d3 (diff)
Static documentation rebuilt by pkgdown::build_site()
Diffstat (limited to 'docs/articles')
-rw-r--r--docs/articles/FOCUS_D.html245
-rw-r--r--docs/articles/FOCUS_D_files/figure-html/unnamed-chunk-5-1.pngbin0 -> 74304 bytes
-rw-r--r--docs/articles/FOCUS_D_files/figure-html/unnamed-chunk-6-1.pngbin0 -> 13789 bytes
-rw-r--r--docs/articles/FOCUS_L.html661
-rw-r--r--docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-10-1.pngbin0 -> 28716 bytes
-rw-r--r--docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-12-1.pngbin0 -> 52644 bytes
-rw-r--r--docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-13-1.pngbin0 -> 21438 bytes
-rw-r--r--docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-15-1.pngbin0 -> 36854 bytes
-rw-r--r--docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-4-1.pngbin0 -> 23253 bytes
-rw-r--r--docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-5-1.pngbin0 -> 14728 bytes
-rw-r--r--docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-6-1.pngbin0 -> 23593 bytes
-rw-r--r--docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-8-1.pngbin0 -> 27575 bytes
-rw-r--r--docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-9-1.pngbin0 -> 28058 bytes
-rw-r--r--docs/articles/compiled_models.html146
-rw-r--r--docs/articles/compiled_models_files/figure-html/benchmark_FOMC_SFO-1.pngbin0 -> 9925 bytes
-rw-r--r--docs/articles/compiled_models_files/figure-html/benchmark_SFO_SFO-1.pngbin0 -> 11448 bytes
-rw-r--r--docs/articles/index.html99
-rw-r--r--docs/articles/mkin.html171
-rw-r--r--docs/articles/mkin_files/figure-html/unnamed-chunk-2-1.pngbin0 -> 112161 bytes
19 files changed, 1322 insertions, 0 deletions
diff --git a/docs/articles/FOCUS_D.html b/docs/articles/FOCUS_D.html
new file mode 100644
index 00000000..bbfc36b6
--- /dev/null
+++ b/docs/articles/FOCUS_D.html
@@ -0,0 +1,245 @@
+<!DOCTYPE html>
+<!-- Generated by pkgdown: do not edit by hand --><html><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>Example evaluation of FOCUS Example Dataset D. mkin</title><!-- jquery --><script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/cerulean/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"><script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script><!-- Font Awesome icons --><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><!-- mathjax --><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><!--[if lt IE 9]>
+<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
+<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
+<![endif]--></head><body>
+ <div class="container">
+ <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">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="../index.html">mkin</a>
+ </div>
+ <div id="navbar" class="navbar-collapse collapse">
+ <ul class="nav navbar-nav"><li>
+ <a href="../index.html">Home</a>
+</li>
+<li>
+ <a href="../reference/index.html">Reference</a>
+</li>
+ </ul><ul class="nav navbar-nav navbar-right"><li>
+ <a href="https://github.com/jranke/mkin">
+ <span class="fa fa-github fa-lg"></span>
+
+ </a>
+</li>
+ </ul></div><!--/.nav-collapse -->
+ </div><!--/.container -->
+</div><!--/.navbar -->
+
+ </header><div class="row">
+ <div class="col-md-9">
+ <div class="page-header toc-ignore">
+ <h1>Example evaluation of FOCUS Example Dataset D</h1>
+ <h4 class="author">Johannes Ranke</h4>
+
+ <h4 class="date">2016-10-06</h4>
+ </div>
+
+
+
+<p>This is just a very simple vignette showing how to fit a degradation model for a parent compound with one transformation product using <code>mkin</code>. After loading the library we look a the data. We have observed concentrations in the column named <code>value</code> at the times specified in column <code>time</code> for the two observed variables named <code>parent</code> and <code>m1</code>.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">library</span>(<span class="st">"mkin"</span>)
+<span class="kw">print</span>(FOCUS_2006_D)</code></pre></div>
+<pre><code>## name time value
+## 1 parent 0 99.46
+## 2 parent 0 102.04
+## 3 parent 1 93.50
+## 4 parent 1 92.50
+## 5 parent 3 63.23
+## 6 parent 3 68.99
+## 7 parent 7 52.32
+## 8 parent 7 55.13
+## 9 parent 14 27.27
+## 10 parent 14 26.64
+## 11 parent 21 11.50
+## 12 parent 21 11.64
+## 13 parent 35 2.85
+## 14 parent 35 2.91
+## 15 parent 50 0.69
+## 16 parent 50 0.63
+## 17 parent 75 0.05
+## 18 parent 75 0.06
+## 19 parent 100 NA
+## 20 parent 100 NA
+## 21 parent 120 NA
+## 22 parent 120 NA
+## 23 m1 0 0.00
+## 24 m1 0 0.00
+## 25 m1 1 4.84
+## 26 m1 1 5.64
+## 27 m1 3 12.91
+## 28 m1 3 12.96
+## 29 m1 7 22.97
+## 30 m1 7 24.47
+## 31 m1 14 41.69
+## 32 m1 14 33.21
+## 33 m1 21 44.37
+## 34 m1 21 46.44
+## 35 m1 35 41.22
+## 36 m1 35 37.95
+## 37 m1 50 41.19
+## 38 m1 50 40.01
+## 39 m1 75 40.09
+## 40 m1 75 33.85
+## 41 m1 100 31.04
+## 42 m1 100 33.13
+## 43 m1 120 25.15
+## 44 m1 120 33.31</code></pre>
+<p>Next we specify the degradation model: The parent compound degrades with simple first-order kinetics (SFO) to one metabolite named m1, which also degrades with SFO kinetics.</p>
+<p>The call to mkinmod returns a degradation model. The differential equations represented in R code can be found in the character vector <code>$diffs</code> of the <code>mkinmod</code> object. If a C compiler (gcc) is installed and functional, the differential equation model will be compiled from auto-generated C code.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">SFO_SFO &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mkinmod.html">mkinmod</a></span>(<span class="dt">parent =</span> <span class="kw"><a href="../reference/mkinsub.html">mkinsub</a></span>(<span class="st">"SFO"</span>, <span class="st">"m1"</span>), <span class="dt">m1 =</span> <span class="kw"><a href="../reference/mkinsub.html">mkinsub</a></span>(<span class="st">"SFO"</span>))</code></pre></div>
+<pre><code>## Successfully compiled differential equation model from auto-generated C code.</code></pre>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">print</span>(SFO_SFO$diffs)</code></pre></div>
+<pre><code>## parent
+## "d_parent = - k_parent_sink * parent - k_parent_m1 * parent"
+## m1
+## "d_m1 = + k_parent_m1 * parent - k_m1_sink * m1"</code></pre>
+<p>We do the fitting without progress report (<code>quiet = TRUE</code>).</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">fit &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mkinfit.html">mkinfit</a></span>(SFO_SFO, FOCUS_2006_D, <span class="dt">quiet =</span> <span class="ot">TRUE</span>)</code></pre></div>
+<p>A plot of the fit including a residual plot for both observed variables is obtained using the <code>plot</code> method for <code>mkinfit</code> objects.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">plot</span>(fit, <span class="dt">show_residuals =</span> <span class="ot">TRUE</span>)</code></pre></div>
+<p><img src="FOCUS_D_files/figure-html/unnamed-chunk-5-1.png" width="672"></p>
+<p>Confidence intervals for the parameter estimates are obtained using the <code>mkinparplot</code> function.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="../reference/mkinparplot.html">mkinparplot</a></span>(fit)</code></pre></div>
+<p><img src="FOCUS_D_files/figure-html/unnamed-chunk-6-1.png" width="672"></p>
+<p>A comprehensive report of the results is obtained using the <code>summary</code> method for <code>mkinfit</code> objects.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">summary</span>(fit)</code></pre></div>
+<pre><code>## mkin version: 0.9.44.9000
+## R version: 3.3.1
+## Date of fit: Thu Oct 6 08:54:04 2016
+## Date of summary: Thu Oct 6 08:54:04 2016
+##
+## Equations:
+## d_parent = - k_parent_sink * parent - k_parent_m1 * parent
+## d_m1 = + k_parent_m1 * parent - k_m1_sink * m1
+##
+## Model predictions using solution type deSolve
+##
+## Fitted with method Port using 153 model solutions performed in 0.637 s
+##
+## Weighting: none
+##
+## Starting values for parameters to be optimised:
+## value type
+## parent_0 100.7500 state
+## k_parent_sink 0.1000 deparm
+## k_parent_m1 0.1001 deparm
+## k_m1_sink 0.1002 deparm
+##
+## Starting values for the transformed parameters actually optimised:
+## value lower upper
+## parent_0 100.750000 -Inf Inf
+## log_k_parent_sink -2.302585 -Inf Inf
+## log_k_parent_m1 -2.301586 -Inf Inf
+## log_k_m1_sink -2.300587 -Inf Inf
+##
+## Fixed parameter values:
+## value type
+## m1_0 0 state
+##
+## Optimised, transformed parameters with symmetric confidence intervals:
+## Estimate Std. Error Lower Upper
+## parent_0 99.600 1.61400 96.330 102.900
+## log_k_parent_sink -3.038 0.07826 -3.197 -2.879
+## log_k_parent_m1 -2.980 0.04124 -3.064 -2.897
+## log_k_m1_sink -5.248 0.13610 -5.523 -4.972
+##
+## Parameter correlation:
+## parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink
+## parent_0 1.00000 0.6075 -0.06625 -0.1701
+## log_k_parent_sink 0.60752 1.0000 -0.08740 -0.6253
+## log_k_parent_m1 -0.06625 -0.0874 1.00000 0.4716
+## log_k_m1_sink -0.17006 -0.6253 0.47163 1.0000
+##
+## Residual standard error: 3.211 on 36 degrees of freedom
+##
+## Backtransformed parameters:
+## Confidence intervals for internally transformed parameters are asymmetric.
+## t-test (unrealistically) based on the assumption of normal distribution
+## for estimators of untransformed parameters.
+## Estimate t value Pr(&gt;t) Lower Upper
+## parent_0 99.600000 61.720 2.024e-38 96.330000 1.029e+02
+## k_parent_sink 0.047920 12.780 3.050e-15 0.040890 5.616e-02
+## k_parent_m1 0.050780 24.250 3.407e-24 0.046700 5.521e-02
+## k_m1_sink 0.005261 7.349 5.758e-09 0.003992 6.933e-03
+##
+## Chi2 error levels in percent:
+## err.min n.optim df
+## All data 6.398 4 15
+## parent 6.827 3 6
+## m1 4.490 1 9
+##
+## Resulting formation fractions:
+## ff
+## parent_sink 0.4855
+## parent_m1 0.5145
+## m1_sink 1.0000
+##
+## Estimated disappearance times:
+## DT50 DT90
+## parent 7.023 23.33
+## m1 131.761 437.70
+##
+## Data:
+## time variable observed predicted residual
+## 0 parent 99.46 9.960e+01 -1.385e-01
+## 0 parent 102.04 9.960e+01 2.442e+00
+## 1 parent 93.50 9.024e+01 3.262e+00
+## 1 parent 92.50 9.024e+01 2.262e+00
+## 3 parent 63.23 7.407e+01 -1.084e+01
+## 3 parent 68.99 7.407e+01 -5.083e+00
+## 7 parent 52.32 4.991e+01 2.408e+00
+## 7 parent 55.13 4.991e+01 5.218e+00
+## 14 parent 27.27 2.501e+01 2.257e+00
+## 14 parent 26.64 2.501e+01 1.627e+00
+## 21 parent 11.50 1.253e+01 -1.035e+00
+## 21 parent 11.64 1.253e+01 -8.946e-01
+## 35 parent 2.85 3.148e+00 -2.979e-01
+## 35 parent 2.91 3.148e+00 -2.379e-01
+## 50 parent 0.69 7.162e-01 -2.624e-02
+## 50 parent 0.63 7.162e-01 -8.624e-02
+## 75 parent 0.05 6.074e-02 -1.074e-02
+## 75 parent 0.06 6.074e-02 -7.382e-04
+## 100 parent NA 5.151e-03 NA
+## 100 parent NA 5.151e-03 NA
+## 120 parent NA 7.155e-04 NA
+## 120 parent NA 7.155e-04 NA
+## 0 m1 0.00 0.000e+00 0.000e+00
+## 0 m1 0.00 0.000e+00 0.000e+00
+## 1 m1 4.84 4.803e+00 3.704e-02
+## 1 m1 5.64 4.803e+00 8.370e-01
+## 3 m1 12.91 1.302e+01 -1.140e-01
+## 3 m1 12.96 1.302e+01 -6.400e-02
+## 7 m1 22.97 2.504e+01 -2.075e+00
+## 7 m1 24.47 2.504e+01 -5.748e-01
+## 14 m1 41.69 3.669e+01 5.000e+00
+## 14 m1 33.21 3.669e+01 -3.480e+00
+## 21 m1 44.37 4.165e+01 2.717e+00
+## 21 m1 46.44 4.165e+01 4.787e+00
+## 35 m1 41.22 4.331e+01 -2.093e+00
+## 35 m1 37.95 4.331e+01 -5.363e+00
+## 50 m1 41.19 4.122e+01 -2.831e-02
+## 50 m1 40.01 4.122e+01 -1.208e+00
+## 75 m1 40.09 3.645e+01 3.643e+00
+## 75 m1 33.85 3.645e+01 -2.597e+00
+## 100 m1 31.04 3.198e+01 -9.416e-01
+## 100 m1 33.13 3.198e+01 1.148e+00
+## 120 m1 25.15 2.879e+01 -3.640e+00
+## 120 m1 33.31 2.879e+01 4.520e+00</code></pre>
+ </div>
+
+ <div class="col-md-3 hidden-xs">
+ </div>
+
+</div>
+
+
+ <footer><p>Built by <a href="http://hadley.github.io/pkgdown/">pkgdown</a>. Styled with <a href="http://getbootstrap.com">Bootstrap 3</a>.</p>
+ </footer></div>
+
+ </body></html>
diff --git a/docs/articles/FOCUS_D_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/FOCUS_D_files/figure-html/unnamed-chunk-5-1.png
new file mode 100644
index 00000000..c0b0c2db
--- /dev/null
+++ b/docs/articles/FOCUS_D_files/figure-html/unnamed-chunk-5-1.png
Binary files differ
diff --git a/docs/articles/FOCUS_D_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/FOCUS_D_files/figure-html/unnamed-chunk-6-1.png
new file mode 100644
index 00000000..6700e527
--- /dev/null
+++ b/docs/articles/FOCUS_D_files/figure-html/unnamed-chunk-6-1.png
Binary files differ
diff --git a/docs/articles/FOCUS_L.html b/docs/articles/FOCUS_L.html
new file mode 100644
index 00000000..353f1484
--- /dev/null
+++ b/docs/articles/FOCUS_L.html
@@ -0,0 +1,661 @@
+<!DOCTYPE html>
+<!-- Generated by pkgdown: do not edit by hand --><html><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>Example evaluation of FOCUS Laboratory Data L1 to L3. mkin</title><!-- jquery --><script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/cerulean/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"><script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script><!-- Font Awesome icons --><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><!-- mathjax --><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><!--[if lt IE 9]>
+<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
+<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
+<![endif]--></head><body>
+ <div class="container">
+ <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">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="../index.html">mkin</a>
+ </div>
+ <div id="navbar" class="navbar-collapse collapse">
+ <ul class="nav navbar-nav"><li>
+ <a href="../index.html">Home</a>
+</li>
+<li>
+ <a href="../reference/index.html">Reference</a>
+</li>
+ </ul><ul class="nav navbar-nav navbar-right"><li>
+ <a href="https://github.com/jranke/mkin">
+ <span class="fa fa-github fa-lg"></span>
+
+ </a>
+</li>
+ </ul></div><!--/.nav-collapse -->
+ </div><!--/.container -->
+</div><!--/.navbar -->
+
+ </header><div class="row">
+ <div class="col-md-9">
+ <div class="page-header toc-ignore">
+ <h1>Example evaluation of FOCUS Laboratory Data L1 to L3</h1>
+ <h4 class="author">Johannes Ranke</h4>
+
+ <h4 class="date">2016-10-06</h4>
+ </div>
+
+
+
+<div id="laboratory-data-l1" class="section level1">
+<h1>Laboratory Data L1</h1>
+<p>The following code defines example dataset L1 from the FOCUS kinetics report, p.&nbsp;284:</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">library</span>(<span class="st">"mkin"</span>, <span class="dt">quietly =</span> <span class="ot">TRUE</span>)
+FOCUS_2006_L1 =<span class="st"> </span><span class="kw">data.frame</span>(
+ <span class="dt">t =</span> <span class="kw">rep</span>(<span class="kw">c</span>(<span class="dv">0</span>, <span class="dv">1</span>, <span class="dv">2</span>, <span class="dv">3</span>, <span class="dv">5</span>, <span class="dv">7</span>, <span class="dv">14</span>, <span class="dv">21</span>, <span class="dv">30</span>), <span class="dt">each =</span> <span class="dv">2</span>),
+ <span class="dt">parent =</span> <span class="kw">c</span>(<span class="fl">88.3</span>, <span class="fl">91.4</span>, <span class="fl">85.6</span>, <span class="fl">84.5</span>, <span class="fl">78.9</span>, <span class="fl">77.6</span>,
+ <span class="fl">72.0</span>, <span class="fl">71.9</span>, <span class="fl">50.3</span>, <span class="fl">59.4</span>, <span class="fl">47.0</span>, <span class="fl">45.1</span>,
+ <span class="fl">27.7</span>, <span class="fl">27.3</span>, <span class="fl">10.0</span>, <span class="fl">10.4</span>, <span class="fl">2.9</span>, <span class="fl">4.0</span>))
+FOCUS_2006_L1_mkin &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mkin_wide_to_long.html">mkin_wide_to_long</a></span>(FOCUS_2006_L1)</code></pre></div>
+<p>Here we use the assumptions of simple first order (SFO), the case of declining rate constant over time (FOMC) and the case of two different phases of the kinetics (DFOP). For a more detailed discussion of the models, please see the FOCUS kinetics report.</p>
+<p>Since mkin version 0.9-32 (July 2014), we can use shorthand notation like <code>"SFO"</code> for parent only degradation models. The following two lines fit the model and produce the summary report of the model fit. This covers the numerical analysis given in the FOCUS report.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">m.L1.SFO &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mkinfit.html">mkinfit</a></span>(<span class="st">"SFO"</span>, FOCUS_2006_L1_mkin, <span class="dt">quiet =</span> <span class="ot">TRUE</span>)
+<span class="kw">summary</span>(m.L1.SFO)</code></pre></div>
+<pre><code>## mkin version: 0.9.44.9000
+## R version: 3.3.1
+## Date of fit: Thu Oct 6 08:54:05 2016
+## Date of summary: Thu Oct 6 08:54:05 2016
+##
+## Equations:
+## d_parent = - k_parent_sink * parent
+##
+## Model predictions using solution type analytical
+##
+## Fitted with method Port using 37 model solutions performed in 0.087 s
+##
+## Weighting: none
+##
+## Starting values for parameters to be optimised:
+## value type
+## parent_0 89.85 state
+## k_parent_sink 0.10 deparm
+##
+## Starting values for the transformed parameters actually optimised:
+## value lower upper
+## parent_0 89.850000 -Inf Inf
+## log_k_parent_sink -2.302585 -Inf Inf
+##
+## Fixed parameter values:
+## None
+##
+## Optimised, transformed parameters with symmetric confidence intervals:
+## Estimate Std. Error Lower Upper
+## parent_0 92.470 1.36800 89.570 95.370
+## log_k_parent_sink -2.347 0.04057 -2.433 -2.261
+##
+## Parameter correlation:
+## parent_0 log_k_parent_sink
+## parent_0 1.0000 0.6248
+## log_k_parent_sink 0.6248 1.0000
+##
+## Residual standard error: 2.948 on 16 degrees of freedom
+##
+## Backtransformed parameters:
+## Confidence intervals for internally transformed parameters are asymmetric.
+## t-test (unrealistically) based on the assumption of normal distribution
+## for estimators of untransformed parameters.
+## Estimate t value Pr(&gt;t) Lower Upper
+## parent_0 92.47000 67.58 2.170e-21 89.57000 95.3700
+## k_parent_sink 0.09561 24.65 1.867e-14 0.08773 0.1042
+##
+## Chi2 error levels in percent:
+## err.min n.optim df
+## All data 3.424 2 7
+## parent 3.424 2 7
+##
+## Resulting formation fractions:
+## ff
+## parent_sink 1
+##
+## Estimated disappearance times:
+## DT50 DT90
+## parent 7.249 24.08
+##
+## Data:
+## time variable observed predicted residual
+## 0 parent 88.3 92.471 -4.1710
+## 0 parent 91.4 92.471 -1.0710
+## 1 parent 85.6 84.039 1.5610
+## 1 parent 84.5 84.039 0.4610
+## 2 parent 78.9 76.376 2.5241
+## 2 parent 77.6 76.376 1.2241
+## 3 parent 72.0 69.412 2.5884
+## 3 parent 71.9 69.412 2.4884
+## 5 parent 50.3 57.330 -7.0301
+## 5 parent 59.4 57.330 2.0699
+## 7 parent 47.0 47.352 -0.3515
+## 7 parent 45.1 47.352 -2.2515
+## 14 parent 27.7 24.247 3.4528
+## 14 parent 27.3 24.247 3.0528
+## 21 parent 10.0 12.416 -2.4163
+## 21 parent 10.4 12.416 -2.0163
+## 30 parent 2.9 5.251 -2.3513
+## 30 parent 4.0 5.251 -1.2513</code></pre>
+<p>A plot of the fit is obtained with the plot function for mkinfit objects.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">plot</span>(m.L1.SFO, <span class="dt">show_errmin =</span> <span class="ot">TRUE</span>, <span class="dt">main =</span> <span class="st">"FOCUS L1 - SFO"</span>)</code></pre></div>
+<p><img src="FOCUS_L_files/figure-html/unnamed-chunk-4-1.png" width="576"></p>
+<p>The residual plot can be easily obtained by</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="../reference/mkinresplot.html">mkinresplot</a></span>(m.L1.SFO, <span class="dt">ylab =</span> <span class="st">"Observed"</span>, <span class="dt">xlab =</span> <span class="st">"Time"</span>)</code></pre></div>
+<p><img src="FOCUS_L_files/figure-html/unnamed-chunk-5-1.png" width="576"></p>
+<p>For comparison, the FOMC model is fitted as well, and the <span class="math inline">\(\chi^2\)</span> error level is checked.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">m.L1.FOMC &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mkinfit.html">mkinfit</a></span>(<span class="st">"FOMC"</span>, FOCUS_2006_L1_mkin, <span class="dt">quiet=</span><span class="ot">TRUE</span>)</code></pre></div>
+<pre><code>## Warning in mkinfit("FOMC", FOCUS_2006_L1_mkin, quiet = TRUE): Optimisation by method Port did not converge.
+## Convergence code is 1</code></pre>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">plot</span>(m.L1.FOMC, <span class="dt">show_errmin =</span> <span class="ot">TRUE</span>, <span class="dt">main =</span> <span class="st">"FOCUS L1 - FOMC"</span>)</code></pre></div>
+<p><img src="FOCUS_L_files/figure-html/unnamed-chunk-6-1.png" width="576"></p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">summary</span>(m.L1.FOMC, <span class="dt">data =</span> <span class="ot">FALSE</span>)</code></pre></div>
+<pre><code>## mkin version: 0.9.44.9000
+## R version: 3.3.1
+## Date of fit: Thu Oct 6 08:54:06 2016
+## Date of summary: Thu Oct 6 08:54:06 2016
+##
+##
+## Warning: Optimisation by method Port did not converge.
+## Convergence code is 1
+##
+##
+## Equations:
+## d_parent = - (alpha/beta) * 1/((time/beta) + 1) * parent
+##
+## Model predictions using solution type analytical
+##
+## Fitted with method Port using 188 model solutions performed in 0.437 s
+##
+## Weighting: none
+##
+## Starting values for parameters to be optimised:
+## value type
+## parent_0 89.85 state
+## alpha 1.00 deparm
+## beta 10.00 deparm
+##
+## Starting values for the transformed parameters actually optimised:
+## value lower upper
+## parent_0 89.850000 -Inf Inf
+## log_alpha 0.000000 -Inf Inf
+## log_beta 2.302585 -Inf Inf
+##
+## Fixed parameter values:
+## None
+##
+## Optimised, transformed parameters with symmetric confidence intervals:
+## Estimate Std. Error Lower Upper
+## parent_0 92.47 1.422 89.44 95.50
+## log_alpha 15.43 15.080 -16.71 47.58
+## log_beta 17.78 15.090 -14.37 49.93
+##
+## Parameter correlation:
+## parent_0 log_alpha log_beta
+## parent_0 1.0000 0.1129 0.1112
+## log_alpha 0.1129 1.0000 1.0000
+## log_beta 0.1112 1.0000 1.0000
+##
+## Residual standard error: 3.045 on 15 degrees of freedom
+##
+## Backtransformed parameters:
+## Confidence intervals for internally transformed parameters are asymmetric.
+## t-test (unrealistically) based on the assumption of normal distribution
+## for estimators of untransformed parameters.
+## Estimate t value Pr(&gt;t) Lower Upper
+## parent_0 9.247e+01 65.150 4.044e-20 8.944e+01 9.550e+01
+## alpha 5.044e+06 1.271 1.115e-01 5.510e-08 4.618e+20
+## beta 5.276e+07 1.259 1.137e-01 5.732e-07 4.857e+21
+##
+## Chi2 error levels in percent:
+## err.min n.optim df
+## All data 3.619 3 6
+## parent 3.619 3 6
+##
+## Estimated disappearance times:
+## DT50 DT90 DT50back
+## parent 7.25 24.08 7.25</code></pre>
+<p>We get a warning that the default optimisation algorithm <code>Port</code> did not converge, which is an indication that the model is overparameterised, <em>i.e.</em> contains too many parameters that are ill-defined as a consequence.</p>
+<p>And in fact, due to the higher number of parameters, and the lower number of degrees of freedom of the fit, the <span class="math inline">\(\chi^2\)</span> error level is actually higher for the FOMC model (3.6%) than for the SFO model (3.4%). Additionally, the parameters <code>log_alpha</code> and <code>log_beta</code> internally fitted in the model have excessive confidence intervals, that span more than 25 orders of magnitude (!) when backtransformed to the scale of <code>alpha</code> and <code>beta</code>. Also, the t-test for significant difference from zero does not indicate such a significant difference, with p-values greater than 0.1, and finally, the parameter correlation of <code>log_alpha</code> and <code>log_beta</code> is 1.000, clearly indicating that the model is overparameterised.</p>
+<p>The <span class="math inline">\(\chi^2\)</span> error levels reported in Appendix 3 and Appendix 7 to the FOCUS kinetics report are rounded to integer percentages and partly deviate by one percentage point from the results calculated by mkin. The reason for this is not known. However, mkin gives the same <span class="math inline">\(\chi^2\)</span> error levels as the kinfit package and the calculation routines of the kinfit package have been extensively compared to the results obtained by the KinGUI software, as documented in the kinfit package vignette. KinGUI was the first widely used standard package in this field. Also, the calculation of <span class="math inline">\(\chi^2\)</span> error levels was compared with KinGUII, CAKE and DegKin manager in a project sponsored by the German Umweltbundesamt <span class="citation">(Ranke, n.d.)</span>.</p>
+</div>
+<div id="laboratory-data-l2" class="section level1">
+<h1>Laboratory Data L2</h1>
+<p>The following code defines example dataset L2 from the FOCUS kinetics report, p.&nbsp;287:</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">FOCUS_2006_L2 =<span class="st"> </span><span class="kw">data.frame</span>(
+ <span class="dt">t =</span> <span class="kw">rep</span>(<span class="kw">c</span>(<span class="dv">0</span>, <span class="dv">1</span>, <span class="dv">3</span>, <span class="dv">7</span>, <span class="dv">14</span>, <span class="dv">28</span>), <span class="dt">each =</span> <span class="dv">2</span>),
+ <span class="dt">parent =</span> <span class="kw">c</span>(<span class="fl">96.1</span>, <span class="fl">91.8</span>, <span class="fl">41.4</span>, <span class="fl">38.7</span>,
+ <span class="fl">19.3</span>, <span class="fl">22.3</span>, <span class="fl">4.6</span>, <span class="fl">4.6</span>,
+ <span class="fl">2.6</span>, <span class="fl">1.2</span>, <span class="fl">0.3</span>, <span class="fl">0.6</span>))
+FOCUS_2006_L2_mkin &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mkin_wide_to_long.html">mkin_wide_to_long</a></span>(FOCUS_2006_L2)</code></pre></div>
+<div id="sfo-fit-for-l2" class="section level2">
+<h2>SFO fit for L2</h2>
+<p>Again, the SFO model is fitted and the result is plotted. The residual plot can be obtained simply by adding the argument <code>show_residuals</code> to the plot command.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">m.L2.SFO &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mkinfit.html">mkinfit</a></span>(<span class="st">"SFO"</span>, FOCUS_2006_L2_mkin, <span class="dt">quiet=</span><span class="ot">TRUE</span>)
+<span class="kw">plot</span>(m.L2.SFO, <span class="dt">show_residuals =</span> <span class="ot">TRUE</span>, <span class="dt">show_errmin =</span> <span class="ot">TRUE</span>,
+ <span class="dt">main =</span> <span class="st">"FOCUS L2 - SFO"</span>)</code></pre></div>
+<p><img src="FOCUS_L_files/figure-html/unnamed-chunk-8-1.png" width="672"></p>
+<p>The <span class="math inline">\(\chi^2\)</span> error level of 14% suggests that the model does not fit very well. This is also obvious from the plots of the fit, in which we have included the residual plot.</p>
+<p>In the FOCUS kinetics report, it is stated that there is no apparent systematic error observed from the residual plot up to the measured DT90 (approximately at day 5), and there is an underestimation beyond that point.</p>
+<p>We may add that it is difficult to judge the random nature of the residuals just from the three samplings at days 0, 1 and 3. Also, it is not clear <em>a priori</em> why a consistent underestimation after the approximate DT90 should be irrelevant. However, this can be rationalised by the fact that the FOCUS fate models generally only implement SFO kinetics.</p>
+</div>
+<div id="fomc-fit-for-l2" class="section level2">
+<h2>FOMC fit for L2</h2>
+<p>For comparison, the FOMC model is fitted as well, and the <span class="math inline">\(\chi^2\)</span> error level is checked.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">m.L2.FOMC &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mkinfit.html">mkinfit</a></span>(<span class="st">"FOMC"</span>, FOCUS_2006_L2_mkin, <span class="dt">quiet =</span> <span class="ot">TRUE</span>)
+<span class="kw">plot</span>(m.L2.FOMC, <span class="dt">show_residuals =</span> <span class="ot">TRUE</span>,
+ <span class="dt">main =</span> <span class="st">"FOCUS L2 - FOMC"</span>)</code></pre></div>
+<p><img src="FOCUS_L_files/figure-html/unnamed-chunk-9-1.png" width="672"></p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">summary</span>(m.L2.FOMC, <span class="dt">data =</span> <span class="ot">FALSE</span>)</code></pre></div>
+<pre><code>## mkin version: 0.9.44.9000
+## R version: 3.3.1
+## Date of fit: Thu Oct 6 08:54:07 2016
+## Date of summary: Thu Oct 6 08:54:07 2016
+##
+## Equations:
+## d_parent = - (alpha/beta) * 1/((time/beta) + 1) * parent
+##
+## Model predictions using solution type analytical
+##
+## Fitted with method Port using 81 model solutions performed in 0.19 s
+##
+## Weighting: none
+##
+## Starting values for parameters to be optimised:
+## value type
+## parent_0 93.95 state
+## alpha 1.00 deparm
+## beta 10.00 deparm
+##
+## Starting values for the transformed parameters actually optimised:
+## value lower upper
+## parent_0 93.950000 -Inf Inf
+## log_alpha 0.000000 -Inf Inf
+## log_beta 2.302585 -Inf Inf
+##
+## Fixed parameter values:
+## None
+##
+## Optimised, transformed parameters with symmetric confidence intervals:
+## Estimate Std. Error Lower Upper
+## parent_0 93.7700 1.8560 89.5700 97.9700
+## log_alpha 0.3180 0.1867 -0.1044 0.7405
+## log_beta 0.2102 0.2943 -0.4555 0.8759
+##
+## Parameter correlation:
+## parent_0 log_alpha log_beta
+## parent_0 1.00000 -0.09553 -0.1863
+## log_alpha -0.09553 1.00000 0.9757
+## log_beta -0.18628 0.97567 1.0000
+##
+## Residual standard error: 2.628 on 9 degrees of freedom
+##
+## Backtransformed parameters:
+## Confidence intervals for internally transformed parameters are asymmetric.
+## t-test (unrealistically) based on the assumption of normal distribution
+## for estimators of untransformed parameters.
+## Estimate t value Pr(&gt;t) Lower Upper
+## parent_0 93.770 50.510 1.173e-12 89.5700 97.970
+## alpha 1.374 5.355 2.296e-04 0.9009 2.097
+## beta 1.234 3.398 3.949e-03 0.6341 2.401
+##
+## Chi2 error levels in percent:
+## err.min n.optim df
+## All data 6.205 3 3
+## parent 6.205 3 3
+##
+## Estimated disappearance times:
+## DT50 DT90 DT50back
+## parent 0.8092 5.356 1.612</code></pre>
+<p>The error level at which the <span class="math inline">\(\chi^2\)</span> test passes is much lower in this case. Therefore, the FOMC model provides a better description of the data, as less experimental error has to be assumed in order to explain the data.</p>
+</div>
+<div id="dfop-fit-for-l2" class="section level2">
+<h2>DFOP fit for L2</h2>
+<p>Fitting the four parameter DFOP model further reduces the <span class="math inline">\(\chi^2\)</span> error level.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">m.L2.DFOP &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mkinfit.html">mkinfit</a></span>(<span class="st">"DFOP"</span>, FOCUS_2006_L2_mkin, <span class="dt">quiet =</span> <span class="ot">TRUE</span>)
+<span class="kw">plot</span>(m.L2.DFOP, <span class="dt">show_residuals =</span> <span class="ot">TRUE</span>, <span class="dt">show_errmin =</span> <span class="ot">TRUE</span>,
+ <span class="dt">main =</span> <span class="st">"FOCUS L2 - DFOP"</span>)</code></pre></div>
+<p><img src="FOCUS_L_files/figure-html/unnamed-chunk-10-1.png" width="672"></p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">summary</span>(m.L2.DFOP, <span class="dt">data =</span> <span class="ot">FALSE</span>)</code></pre></div>
+<pre><code>## mkin version: 0.9.44.9000
+## R version: 3.3.1
+## Date of fit: Thu Oct 6 08:54:08 2016
+## Date of summary: Thu Oct 6 08:54:08 2016
+##
+## Equations:
+## d_parent = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
+## time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 *
+## time))) * parent
+##
+## Model predictions using solution type analytical
+##
+## Fitted with method Port using 336 model solutions performed in 0.804 s
+##
+## Weighting: none
+##
+## Starting values for parameters to be optimised:
+## value type
+## parent_0 93.95 state
+## k1 0.10 deparm
+## k2 0.01 deparm
+## g 0.50 deparm
+##
+## Starting values for the transformed parameters actually optimised:
+## value lower upper
+## parent_0 93.950000 -Inf Inf
+## log_k1 -2.302585 -Inf Inf
+## log_k2 -4.605170 -Inf Inf
+## g_ilr 0.000000 -Inf Inf
+##
+## Fixed parameter values:
+## None
+##
+## Optimised, transformed parameters with symmetric confidence intervals:
+## Estimate Std. Error Lower Upper
+## parent_0 93.9500 NA NA NA
+## log_k1 3.1370 NA NA NA
+## log_k2 -1.0880 NA NA NA
+## g_ilr -0.2821 NA NA NA
+##
+## Parameter correlation:</code></pre>
+<pre><code>## Warning in print.summary.mkinfit(x): Could not estimate covariance matrix; singular system:</code></pre>
+<pre><code>## Could not estimate covariance matrix; singular system:
+##
+## Residual standard error: 1.732 on 8 degrees of freedom
+##
+## Backtransformed parameters:
+## Confidence intervals for internally transformed parameters are asymmetric.
+## t-test (unrealistically) based on the assumption of normal distribution
+## for estimators of untransformed parameters.
+## Estimate t value Pr(&gt;t) Lower Upper
+## parent_0 93.9500 NA NA NA NA
+## k1 23.0400 NA NA NA NA
+## k2 0.3369 NA NA NA NA
+## g 0.4016 NA NA NA NA
+##
+## Chi2 error levels in percent:
+## err.min n.optim df
+## All data 2.53 4 2
+## parent 2.53 4 2
+##
+## Estimated disappearance times:
+## DT50 DT90 DT50_k1 DT50_k2
+## parent 0.5335 5.311 0.03009 2.058</code></pre>
+<p>Here, the DFOP model is clearly the best-fit model for dataset L2 based on the chi^2 error level criterion. However, the failure to calculate the covariance matrix indicates that the parameter estimates correlate excessively. Therefore, the FOMC model may be preferred for this dataset.</p>
+</div>
+</div>
+<div id="laboratory-data-l3" class="section level1">
+<h1>Laboratory Data L3</h1>
+<p>The following code defines example dataset L3 from the FOCUS kinetics report, p.&nbsp;290.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">FOCUS_2006_L3 =<span class="st"> </span><span class="kw">data.frame</span>(
+ <span class="dt">t =</span> <span class="kw">c</span>(<span class="dv">0</span>, <span class="dv">3</span>, <span class="dv">7</span>, <span class="dv">14</span>, <span class="dv">30</span>, <span class="dv">60</span>, <span class="dv">91</span>, <span class="dv">120</span>),
+ <span class="dt">parent =</span> <span class="kw">c</span>(<span class="fl">97.8</span>, <span class="dv">60</span>, <span class="dv">51</span>, <span class="dv">43</span>, <span class="dv">35</span>, <span class="dv">22</span>, <span class="dv">15</span>, <span class="dv">12</span>))
+FOCUS_2006_L3_mkin &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mkin_wide_to_long.html">mkin_wide_to_long</a></span>(FOCUS_2006_L3)</code></pre></div>
+<div id="use-mmkin-to-fit-multiple-models" class="section level2">
+<h2>Use mmkin to fit multiple models</h2>
+<p>As of mkin version 0.9-39 (June 2015), we can fit several models to one or more datasets in one call to the function <code>mmkin</code>. The datasets have to be passed in a list, in this case a named list holding only the L3 dataset prepared above.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># Only use one core here, not to offend the CRAN checks</span>
+mm.L3 &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mmkin.html">mmkin</a></span>(<span class="kw">c</span>(<span class="st">"SFO"</span>, <span class="st">"FOMC"</span>, <span class="st">"DFOP"</span>), <span class="dt">cores =</span> <span class="dv">1</span>,
+ <span class="kw">list</span>(<span class="st">"FOCUS L3"</span> =<span class="st"> </span>FOCUS_2006_L3_mkin), <span class="dt">quiet =</span> <span class="ot">TRUE</span>)
+<span class="kw">plot</span>(mm.L3)</code></pre></div>
+<p><img src="FOCUS_L_files/figure-html/unnamed-chunk-12-1.png" width="672"></p>
+<p>The <span class="math inline">\(\chi^2\)</span> error level of 21% as well as the plot suggest that the SFO model does not fit very well. The FOMC model performs better, with an error level at which the <span class="math inline">\(\chi^2\)</span> test passes of 7%. Fitting the four parameter DFOP model further reduces the <span class="math inline">\(\chi^2\)</span> error level considerably.</p>
+</div>
+<div id="accessing-elements-of-mmkin-objects" class="section level2">
+<h2>Accessing elements of mmkin objects</h2>
+<p>The objects returned by mmkin are arranged like a matrix, with models as a row index and datasets as a column index.</p>
+<p>We can extract the summary and plot for <em>e.g.</em> the DFOP fit, using square brackets for indexing which will result in the use of the summary and plot functions working on mkinfit objects.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">summary</span>(mm.L3[[<span class="st">"DFOP"</span>, <span class="dv">1</span>]])</code></pre></div>
+<pre><code>## mkin version: 0.9.44.9000
+## R version: 3.3.1
+## Date of fit: Thu Oct 6 08:54:09 2016
+## Date of summary: Thu Oct 6 08:54:09 2016
+##
+## Equations:
+## d_parent = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *
+## time)) / (g * exp(-k1 * time) + (1 - g) * exp(-k2 *
+## time))) * parent
+##
+## Model predictions using solution type analytical
+##
+## Fitted with method Port using 137 model solutions performed in 0.319 s
+##
+## Weighting: none
+##
+## Starting values for parameters to be optimised:
+## value type
+## parent_0 97.80 state
+## k1 0.10 deparm
+## k2 0.01 deparm
+## g 0.50 deparm
+##
+## Starting values for the transformed parameters actually optimised:
+## value lower upper
+## parent_0 97.800000 -Inf Inf
+## log_k1 -2.302585 -Inf Inf
+## log_k2 -4.605170 -Inf Inf
+## g_ilr 0.000000 -Inf Inf
+##
+## Fixed parameter values:
+## None
+##
+## Optimised, transformed parameters with symmetric confidence intervals:
+## Estimate Std. Error Lower Upper
+## parent_0 97.7500 1.43800 93.7500 101.70000
+## log_k1 -0.6612 0.13340 -1.0310 -0.29100
+## log_k2 -4.2860 0.05902 -4.4500 -4.12200
+## g_ilr -0.1229 0.05121 -0.2651 0.01925
+##
+## Parameter correlation:
+## parent_0 log_k1 log_k2 g_ilr
+## parent_0 1.00000 0.1640 0.01315 0.4253
+## log_k1 0.16400 1.0000 0.46478 -0.5526
+## log_k2 0.01315 0.4648 1.00000 -0.6631
+## g_ilr 0.42526 -0.5526 -0.66310 1.0000
+##
+## Residual standard error: 1.439 on 4 degrees of freedom
+##
+## Backtransformed parameters:
+## Confidence intervals for internally transformed parameters are asymmetric.
+## t-test (unrealistically) based on the assumption of normal distribution
+## for estimators of untransformed parameters.
+## Estimate t value Pr(&gt;t) Lower Upper
+## parent_0 97.75000 67.970 1.404e-07 93.75000 101.70000
+## k1 0.51620 7.499 8.460e-04 0.35650 0.74750
+## k2 0.01376 16.940 3.557e-05 0.01168 0.01621
+## g 0.45660 25.410 7.121e-06 0.40730 0.50680
+##
+## Chi2 error levels in percent:
+## err.min n.optim df
+## All data 2.225 4 4
+## parent 2.225 4 4
+##
+## Estimated disappearance times:
+## DT50 DT90 DT50_k1 DT50_k2
+## parent 7.464 123 1.343 50.37
+##
+## Data:
+## time variable observed predicted residual
+## 0 parent 97.8 97.75 0.05396
+## 3 parent 60.0 60.45 -0.44933
+## 7 parent 51.0 49.44 1.56338
+## 14 parent 43.0 43.84 -0.83632
+## 30 parent 35.0 35.15 -0.14707
+## 60 parent 22.0 23.26 -1.25919
+## 91 parent 15.0 15.18 -0.18181
+## 120 parent 12.0 10.19 1.81395</code></pre>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">plot</span>(mm.L3[[<span class="st">"DFOP"</span>, <span class="dv">1</span>]], <span class="dt">show_errmin =</span> <span class="ot">TRUE</span>)</code></pre></div>
+<p><img src="FOCUS_L_files/figure-html/unnamed-chunk-13-1.png" width="672"></p>
+<p>Here, a look to the model plot, the confidence intervals of the parameters and the correlation matrix suggest that the parameter estimates are reliable, and the DFOP model can be used as the best-fit model based on the <span class="math inline">\(\chi^2\)</span> error level criterion for laboratory data L3.</p>
+<p>This is also an example where the standard t-test for the parameter <code>g_ilr</code> is misleading, as it tests for a significant difference from zero. In this case, zero appears to be the correct value for this parameter, and the confidence interval for the backtransformed parameter <code>g</code> is quite narrow.</p>
+</div>
+</div>
+<div id="laboratory-data-l4" class="section level1">
+<h1>Laboratory Data L4</h1>
+<p>The following code defines example dataset L4 from the FOCUS kinetics report, p.&nbsp;293:</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">FOCUS_2006_L4 =<span class="st"> </span><span class="kw">data.frame</span>(
+ <span class="dt">t =</span> <span class="kw">c</span>(<span class="dv">0</span>, <span class="dv">3</span>, <span class="dv">7</span>, <span class="dv">14</span>, <span class="dv">30</span>, <span class="dv">60</span>, <span class="dv">91</span>, <span class="dv">120</span>),
+ <span class="dt">parent =</span> <span class="kw">c</span>(<span class="fl">96.6</span>, <span class="fl">96.3</span>, <span class="fl">94.3</span>, <span class="fl">88.8</span>, <span class="fl">74.9</span>, <span class="fl">59.9</span>, <span class="fl">53.5</span>, <span class="fl">49.0</span>))
+FOCUS_2006_L4_mkin &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mkin_wide_to_long.html">mkin_wide_to_long</a></span>(FOCUS_2006_L4)</code></pre></div>
+<p>Fits of the SFO and FOMC models, plots and summaries are produced below:</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># Only use one core here, not to offend the CRAN checks</span>
+mm.L4 &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mmkin.html">mmkin</a></span>(<span class="kw">c</span>(<span class="st">"SFO"</span>, <span class="st">"FOMC"</span>), <span class="dt">cores =</span> <span class="dv">1</span>,
+ <span class="kw">list</span>(<span class="st">"FOCUS L4"</span> =<span class="st"> </span>FOCUS_2006_L4_mkin),
+ <span class="dt">quiet =</span> <span class="ot">TRUE</span>)
+<span class="kw">plot</span>(mm.L4)</code></pre></div>
+<p><img src="FOCUS_L_files/figure-html/unnamed-chunk-15-1.png" width="672"></p>
+<p>The <span class="math inline">\(\chi^2\)</span> error level of 3.3% as well as the plot suggest that the SFO model fits very well. The error level at which the <span class="math inline">\(\chi^2\)</span> test passes is slightly lower for the FOMC model. However, the difference appears negligible.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">summary</span>(mm.L4[[<span class="st">"SFO"</span>, <span class="dv">1</span>]], <span class="dt">data =</span> <span class="ot">FALSE</span>)</code></pre></div>
+<pre><code>## mkin version: 0.9.44.9000
+## R version: 3.3.1
+## Date of fit: Thu Oct 6 08:54:10 2016
+## Date of summary: Thu Oct 6 08:54:10 2016
+##
+## Equations:
+## d_parent = - k_parent_sink * parent
+##
+## Model predictions using solution type analytical
+##
+## Fitted with method Port using 46 model solutions performed in 0.158 s
+##
+## Weighting: none
+##
+## Starting values for parameters to be optimised:
+## value type
+## parent_0 96.6 state
+## k_parent_sink 0.1 deparm
+##
+## Starting values for the transformed parameters actually optimised:
+## value lower upper
+## parent_0 96.600000 -Inf Inf
+## log_k_parent_sink -2.302585 -Inf Inf
+##
+## Fixed parameter values:
+## None
+##
+## Optimised, transformed parameters with symmetric confidence intervals:
+## Estimate Std. Error Lower Upper
+## parent_0 96.44 1.94900 91.670 101.200
+## log_k_parent_sink -5.03 0.07999 -5.225 -4.834
+##
+## Parameter correlation:
+## parent_0 log_k_parent_sink
+## parent_0 1.0000 0.5865
+## log_k_parent_sink 0.5865 1.0000
+##
+## Residual standard error: 3.651 on 6 degrees of freedom
+##
+## Backtransformed parameters:
+## Confidence intervals for internally transformed parameters are asymmetric.
+## t-test (unrealistically) based on the assumption of normal distribution
+## for estimators of untransformed parameters.
+## Estimate t value Pr(&gt;t) Lower Upper
+## parent_0 96.440000 49.49 2.283e-09 91.670000 1.012e+02
+## k_parent_sink 0.006541 12.50 8.008e-06 0.005378 7.955e-03
+##
+## Chi2 error levels in percent:
+## err.min n.optim df
+## All data 3.287 2 6
+## parent 3.287 2 6
+##
+## Resulting formation fractions:
+## ff
+## parent_sink 1
+##
+## Estimated disappearance times:
+## DT50 DT90
+## parent 106 352</code></pre>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">summary</span>(mm.L4[[<span class="st">"FOMC"</span>, <span class="dv">1</span>]], <span class="dt">data =</span> <span class="ot">FALSE</span>)</code></pre></div>
+<pre><code>## mkin version: 0.9.44.9000
+## R version: 3.3.1
+## Date of fit: Thu Oct 6 08:54:10 2016
+## Date of summary: Thu Oct 6 08:54:10 2016
+##
+## Equations:
+## d_parent = - (alpha/beta) * 1/((time/beta) + 1) * parent
+##
+## Model predictions using solution type analytical
+##
+## Fitted with method Port using 66 model solutions performed in 0.151 s
+##
+## Weighting: none
+##
+## Starting values for parameters to be optimised:
+## value type
+## parent_0 96.6 state
+## alpha 1.0 deparm
+## beta 10.0 deparm
+##
+## Starting values for the transformed parameters actually optimised:
+## value lower upper
+## parent_0 96.600000 -Inf Inf
+## log_alpha 0.000000 -Inf Inf
+## log_beta 2.302585 -Inf Inf
+##
+## Fixed parameter values:
+## None
+##
+## Optimised, transformed parameters with symmetric confidence intervals:
+## Estimate Std. Error Lower Upper
+## parent_0 99.1400 1.6800 94.820 103.5000
+## log_alpha -0.3506 0.3725 -1.308 0.6068
+## log_beta 4.1740 0.5635 2.726 5.6230
+##
+## Parameter correlation:
+## parent_0 log_alpha log_beta
+## parent_0 1.0000 -0.5365 -0.6083
+## log_alpha -0.5365 1.0000 0.9913
+## log_beta -0.6083 0.9913 1.0000
+##
+## Residual standard error: 2.315 on 5 degrees of freedom
+##
+## Backtransformed parameters:
+## Confidence intervals for internally transformed parameters are asymmetric.
+## t-test (unrealistically) based on the assumption of normal distribution
+## for estimators of untransformed parameters.
+## Estimate t value Pr(&gt;t) Lower Upper
+## parent_0 99.1400 59.020 1.322e-08 94.8200 103.500
+## alpha 0.7042 2.685 2.178e-02 0.2703 1.835
+## beta 64.9800 1.775 6.807e-02 15.2600 276.600
+##
+## Chi2 error levels in percent:
+## err.min n.optim df
+## All data 2.029 3 5
+## parent 2.029 3 5
+##
+## Estimated disappearance times:
+## DT50 DT90 DT50back
+## parent 108.9 1644 494.9</code></pre>
+</div>
+<div id="references" class="section level1 unnumbered">
+<h1>References</h1>
+<div id="refs" class="references">
+<div id="ref-ranke2014">
+<p>Ranke, Johannes. n.d. &ldquo;Pr&uuml;fung und Validierung von Modellierungssoftware als Alternative zu ModelMaker 4.0.&rdquo; Umweltbundesamt Projektnummer 27452.</p>
+</div>
+</div>
+</div>
+ </div>
+
+ <div class="col-md-3 hidden-xs">
+ <div id="tocnav">
+ <h2>Contents</h2>
+ <ul class="nav nav-pills nav-stacked"><li><a href="#laboratory-data-l1">Laboratory Data L1</a></li>
+ <li><a href="#laboratory-data-l2">Laboratory Data L2</a><ul class="nav nav-pills nav-stacked"><li><a href="#sfo-fit-for-l2">SFO fit for L2</a></li>
+ <li><a href="#fomc-fit-for-l2">FOMC fit for L2</a></li>
+ <li><a href="#dfop-fit-for-l2">DFOP fit for L2</a></li>
+ </ul></li>
+ <li><a href="#laboratory-data-l3">Laboratory Data L3</a><ul class="nav nav-pills nav-stacked"><li><a href="#use-mmkin-to-fit-multiple-models">Use mmkin to fit multiple models</a></li>
+ <li><a href="#accessing-elements-of-mmkin-objects">Accessing elements of mmkin objects</a></li>
+ </ul></li>
+ <li><a href="#laboratory-data-l4">Laboratory Data L4</a></li>
+ <li><a href="#references">References</a></li>
+ </ul></div>
+ </div>
+
+</div>
+
+
+ <footer><p>Built by <a href="http://hadley.github.io/pkgdown/">pkgdown</a>. Styled with <a href="http://getbootstrap.com">Bootstrap 3</a>.</p>
+ </footer></div>
+
+ </body></html>
diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-10-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-10-1.png
new file mode 100644
index 00000000..bb174c01
--- /dev/null
+++ b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-10-1.png
Binary files differ
diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-12-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-12-1.png
new file mode 100644
index 00000000..cab1f123
--- /dev/null
+++ b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-12-1.png
Binary files differ
diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-13-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-13-1.png
new file mode 100644
index 00000000..4ef79892
--- /dev/null
+++ b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-13-1.png
Binary files differ
diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-15-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-15-1.png
new file mode 100644
index 00000000..b8eef14c
--- /dev/null
+++ b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-15-1.png
Binary files differ
diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-4-1.png
new file mode 100644
index 00000000..860ec47b
--- /dev/null
+++ b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-4-1.png
Binary files differ
diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-5-1.png
new file mode 100644
index 00000000..5131f700
--- /dev/null
+++ b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-5-1.png
Binary files differ
diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-6-1.png
new file mode 100644
index 00000000..2908e5ea
--- /dev/null
+++ b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-6-1.png
Binary files differ
diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-8-1.png
new file mode 100644
index 00000000..b4bcc8fc
--- /dev/null
+++ b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-8-1.png
Binary files differ
diff --git a/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-9-1.png
new file mode 100644
index 00000000..21a8c2e3
--- /dev/null
+++ b/docs/articles/FOCUS_L_files/figure-html/unnamed-chunk-9-1.png
Binary files differ
diff --git a/docs/articles/compiled_models.html b/docs/articles/compiled_models.html
new file mode 100644
index 00000000..1eeb78c6
--- /dev/null
+++ b/docs/articles/compiled_models.html
@@ -0,0 +1,146 @@
+<!DOCTYPE html>
+<!-- Generated by pkgdown: do not edit by hand --><html><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>Performance benefit by using compiled model definitions in mkin. mkin</title><!-- jquery --><script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/cerulean/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"><script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script><!-- Font Awesome icons --><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><!-- mathjax --><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><!--[if lt IE 9]>
+<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
+<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
+<![endif]--></head><body>
+ <div class="container">
+ <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">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="../index.html">mkin</a>
+ </div>
+ <div id="navbar" class="navbar-collapse collapse">
+ <ul class="nav navbar-nav"><li>
+ <a href="../index.html">Home</a>
+</li>
+<li>
+ <a href="../reference/index.html">Reference</a>
+</li>
+ </ul><ul class="nav navbar-nav navbar-right"><li>
+ <a href="https://github.com/jranke/mkin">
+ <span class="fa fa-github fa-lg"></span>
+
+ </a>
+</li>
+ </ul></div><!--/.nav-collapse -->
+ </div><!--/.container -->
+</div><!--/.navbar -->
+
+ </header><div class="row">
+ <div class="col-md-9">
+ <div class="page-header toc-ignore">
+ <h1>Performance benefit by using compiled model definitions in mkin</h1>
+ <h4 class="author">Johannes Ranke</h4>
+
+ <h4 class="date">2016-10-06</h4>
+ </div>
+
+
+
+<div id="benchmark-for-a-model-that-can-also-be-solved-with-eigenvalues" class="section level2">
+<h2>Benchmark for a model that can also be solved with Eigenvalues</h2>
+<p>This evaluation is taken from the example section of mkinfit. When using an mkin version equal to or greater than 0.9-36 and a C compiler (gcc) is available, you will see a message that the model is being compiled from autogenerated C code when defining a model using mkinmod. The <code><a href="../reference/mkinmod.html">mkinmod()</a></code> function checks for presence of the gcc compiler using</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">Sys.which</span>(<span class="st">"gcc"</span>)</code></pre></div>
+<pre><code>## gcc
+## "/usr/bin/gcc"</code></pre>
+<p>First, we build a simple degradation model for a parent compound with one metabolite.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">library</span>(<span class="st">"mkin"</span>)
+SFO_SFO &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mkinmod.html">mkinmod</a></span>(
+ <span class="dt">parent =</span> <span class="kw"><a href="../reference/mkinsub.html">mkinsub</a></span>(<span class="st">"SFO"</span>, <span class="st">"m1"</span>),
+ <span class="dt">m1 =</span> <span class="kw"><a href="../reference/mkinsub.html">mkinsub</a></span>(<span class="st">"SFO"</span>))</code></pre></div>
+<pre><code>## Successfully compiled differential equation model from auto-generated C code.</code></pre>
+<p>We can compare the performance of the Eigenvalue based solution against the compiled version and the R implementation of the differential equations using the microbenchmark package.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">library</span>(<span class="st">"microbenchmark"</span>)
+<span class="kw">library</span>(<span class="st">"ggplot2"</span>)
+mb<span class="fl">.1</span> &lt;-<span class="st"> </span><span class="kw">microbenchmark</span>(
+ <span class="st">"deSolve, not compiled"</span> =<span class="st"> </span><span class="kw"><a href="../reference/mkinfit.html">mkinfit</a></span>(SFO_SFO, FOCUS_2006_D,
+ <span class="dt">solution_type =</span> <span class="st">"deSolve"</span>,
+ <span class="dt">use_compiled =</span> <span class="ot">FALSE</span>, <span class="dt">quiet =</span> <span class="ot">TRUE</span>),
+ <span class="st">"Eigenvalue based"</span> =<span class="st"> </span><span class="kw"><a href="../reference/mkinfit.html">mkinfit</a></span>(SFO_SFO, FOCUS_2006_D,
+ <span class="dt">solution_type =</span> <span class="st">"eigen"</span>, <span class="dt">quiet =</span> <span class="ot">TRUE</span>),
+ <span class="st">"deSolve, compiled"</span> =<span class="st"> </span><span class="kw"><a href="../reference/mkinfit.html">mkinfit</a></span>(SFO_SFO, FOCUS_2006_D,
+ <span class="dt">solution_type =</span> <span class="st">"deSolve"</span>, <span class="dt">quiet =</span> <span class="ot">TRUE</span>),
+ <span class="dt">times =</span> <span class="dv">3</span>, <span class="dt">control =</span> <span class="kw">list</span>(<span class="dt">warmup =</span> <span class="dv">0</span>))</code></pre></div>
+<pre><code>## Warning in microbenchmark(`deSolve, not compiled` = mkinfit(SFO_SFO,
+## FOCUS_2006_D, : Could not measure overhead. Your clock might lack
+## precision.</code></pre>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">smb<span class="fl">.1</span> &lt;-<span class="st"> </span><span class="kw">summary</span>(mb<span class="fl">.1</span>)
+<span class="kw">print</span>(mb<span class="fl">.1</span>)</code></pre></div>
+<pre><code>## Unit: milliseconds
+## expr min lq mean median uq
+## deSolve, not compiled 6407.0333 6420.1971 6434.6510 6433.3609 6448.4598
+## Eigenvalue based 887.4338 891.8401 906.9270 896.2463 916.6735
+## deSolve, compiled 720.2433 727.8793 733.2019 735.5152 739.6812
+## max neval cld
+## 6463.5587 3 c
+## 937.1007 3 b
+## 743.8472 3 a</code></pre>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">autoplot</span>(mb<span class="fl">.1</span>)</code></pre></div>
+<p><img src="compiled_models_files/figure-html/benchmark_SFO_SFO-1.png" width="672"></p>
+<p>We see that using the compiled model is by a factor of 8.7 faster than using the R version with the default ode solver, and it is even faster than the Eigenvalue based solution implemented in R which does not need iterative solution of the ODEs:</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">rownames</span>(smb<span class="fl">.1</span>) &lt;-<span class="st"> </span>smb<span class="fl">.1</span>$expr
+smb<span class="fl">.1</span>[<span class="st">"median"</span>]/smb<span class="fl">.1</span>[<span class="st">"deSolve, compiled"</span>, <span class="st">"median"</span>]</code></pre></div>
+<pre><code>## median
+## deSolve, not compiled 8.746741
+## Eigenvalue based 1.218529
+## deSolve, compiled 1.000000</code></pre>
+</div>
+<div id="benchmark-for-a-model-that-can-not-be-solved-with-eigenvalues" class="section level2">
+<h2>Benchmark for a model that can not be solved with Eigenvalues</h2>
+<p>This evaluation is also taken from the example section of mkinfit.</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">FOMC_SFO &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mkinmod.html">mkinmod</a></span>(
+ <span class="dt">parent =</span> <span class="kw"><a href="../reference/mkinsub.html">mkinsub</a></span>(<span class="st">"FOMC"</span>, <span class="st">"m1"</span>),
+ <span class="dt">m1 =</span> <span class="kw"><a href="../reference/mkinsub.html">mkinsub</a></span>( <span class="st">"SFO"</span>))</code></pre></div>
+<pre><code>## Successfully compiled differential equation model from auto-generated C code.</code></pre>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">mb<span class="fl">.2</span> &lt;-<span class="st"> </span><span class="kw">microbenchmark</span>(
+ <span class="st">"deSolve, not compiled"</span> =<span class="st"> </span><span class="kw"><a href="../reference/mkinfit.html">mkinfit</a></span>(FOMC_SFO, FOCUS_2006_D,
+ <span class="dt">use_compiled =</span> <span class="ot">FALSE</span>, <span class="dt">quiet =</span> <span class="ot">TRUE</span>),
+ <span class="st">"deSolve, compiled"</span> =<span class="st"> </span><span class="kw"><a href="../reference/mkinfit.html">mkinfit</a></span>(FOMC_SFO, FOCUS_2006_D, <span class="dt">quiet =</span> <span class="ot">TRUE</span>),
+ <span class="dt">times =</span> <span class="dv">3</span>, <span class="dt">control =</span> <span class="kw">list</span>(<span class="dt">warmup =</span> <span class="dv">0</span>))</code></pre></div>
+<pre><code>## Warning in microbenchmark(`deSolve, not compiled` = mkinfit(FOMC_SFO,
+## FOCUS_2006_D, : Could not measure overhead. Your clock might lack
+## precision.</code></pre>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">smb<span class="fl">.2</span> &lt;-<span class="st"> </span><span class="kw">summary</span>(mb<span class="fl">.2</span>)
+<span class="kw">print</span>(mb<span class="fl">.2</span>)</code></pre></div>
+<pre><code>## Unit: seconds
+## expr min lq mean median uq
+## deSolve, not compiled 13.501761 13.52142 13.697021 13.541086 13.794651
+## deSolve, compiled 1.359921 1.35996 1.366796 1.359999 1.370233
+## max neval cld
+## 14.048217 3 b
+## 1.380468 3 a</code></pre>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">smb<span class="fl">.2</span>[<span class="st">"median"</span>]/smb<span class="fl">.2</span>[<span class="st">"deSolve, compiled"</span>, <span class="st">"median"</span>]</code></pre></div>
+<pre><code>## median
+## 1 NA
+## 2 NA</code></pre>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">autoplot</span>(mb<span class="fl">.2</span>)</code></pre></div>
+<p><img src="compiled_models_files/figure-html/benchmark_FOMC_SFO-1.png" width="672"></p>
+<p>Here we get a performance benefit of a factor of 10 using the version of the differential equation model compiled from C code!</p>
+<p>This vignette was built with mkin 0.9.44.9000 on</p>
+<pre><code>## R version 3.3.1 (2016-06-21)
+## Platform: x86_64-pc-linux-gnu (64-bit)
+## Running under: Debian GNU/Linux 8 (jessie)</code></pre>
+<pre><code>## CPU model: Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz</code></pre>
+</div>
+ </div>
+
+ <div class="col-md-3 hidden-xs">
+ <div id="tocnav">
+ <h2>Contents</h2>
+ <ul class="nav nav-pills nav-stacked"><li><a href="#benchmark-for-a-model-that-can-also-be-solved-with-eigenvalues">Benchmark for a model that can also be solved with Eigenvalues</a></li>
+ <li><a href="#benchmark-for-a-model-that-can-not-be-solved-with-eigenvalues">Benchmark for a model that can not be solved with Eigenvalues</a></li>
+ </ul></div>
+ </div>
+
+</div>
+
+
+ <footer><p>Built by <a href="http://hadley.github.io/pkgdown/">pkgdown</a>. Styled with <a href="http://getbootstrap.com">Bootstrap 3</a>.</p>
+ </footer></div>
+
+ </body></html>
diff --git a/docs/articles/compiled_models_files/figure-html/benchmark_FOMC_SFO-1.png b/docs/articles/compiled_models_files/figure-html/benchmark_FOMC_SFO-1.png
new file mode 100644
index 00000000..e64a4b92
--- /dev/null
+++ b/docs/articles/compiled_models_files/figure-html/benchmark_FOMC_SFO-1.png
Binary files differ
diff --git a/docs/articles/compiled_models_files/figure-html/benchmark_SFO_SFO-1.png b/docs/articles/compiled_models_files/figure-html/benchmark_SFO_SFO-1.png
new file mode 100644
index 00000000..e19fbe7f
--- /dev/null
+++ b/docs/articles/compiled_models_files/figure-html/benchmark_SFO_SFO-1.png
Binary files differ
diff --git a/docs/articles/index.html b/docs/articles/index.html
new file mode 100644
index 00000000..4ed79733
--- /dev/null
+++ b/docs/articles/index.html
@@ -0,0 +1,99 @@
+<!-- Generated by pkgdown: do not edit by hand -->
+<!DOCTYPE html>
+<html>
+ <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://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script>
+
+<!-- Bootstrap -->
+<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/cerulean/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
+
+<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
+
+<!-- Font Awesome icons -->
+<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
+
+
+<!-- pkgdown -->
+<link href="../pkgdown.css" rel="stylesheet">
+<script src="../pkgdown.js"></script>
+
+<!-- mathjax -->
+<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>
+
+<!--[if lt IE 9]>
+<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
+<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
+<![endif]-->
+ </head>
+
+ <body>
+ <div class="container">
+ <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">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="../index.html">mkin</a>
+ </div>
+ <div id="navbar" class="navbar-collapse collapse">
+ <ul class="nav navbar-nav">
+ <li>
+ <a href="../index.html">Home</a>
+</li>
+<li>
+ <a href="../reference/index.html">Reference</a>
+</li>
+ </ul>
+ <ul class="nav navbar-nav navbar-right">
+ <li>
+ <a href="https://github.com/jranke/mkin">
+ <span class="fa fa-github fa-lg"></span>
+
+ </a>
+</li>
+ </ul>
+ </div><!--/.nav-collapse -->
+ </div><!--/.container -->
+</div><!--/.navbar -->
+
+ </header>
+
+ <div class="page-header">
+ <h1>Vignette reference <small>version&nbsp;0.9.44.9000</small></h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+ <div class="section ">
+ <h3>All vignettes</h3>
+ <p class="section-desc"></p>
+
+ <ul>
+ <li><a href="compiled_models.html">Performance benefit by using compiled model definitions in mkin</a></li>
+ <li><a href="FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a></li>
+ <li><a href="FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a></li>
+ <li><a href="mkin.html">mkin - Kinetic evaluation of chemical degradation data</a></li>
+ </ul>
+ </div>
+ </div>
+</div>
+
+ <footer>
+ <p>Built by <a href="http://hadley.github.io/pkgdown/">pkgdown</a>. Styled with <a href="http://getbootstrap.com">Bootstrap 3</a>.</p>
+ </footer>
+ </div>
+
+ </body>
+</html>
diff --git a/docs/articles/mkin.html b/docs/articles/mkin.html
new file mode 100644
index 00000000..44c9e9c5
--- /dev/null
+++ b/docs/articles/mkin.html
@@ -0,0 +1,171 @@
+<!DOCTYPE html>
+<!-- Generated by pkgdown: do not edit by hand --><html><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>mkin - Kinetic evaluation of chemical degradation data. mkin</title><!-- jquery --><script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/cerulean/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"><script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script><!-- Font Awesome icons --><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><!-- mathjax --><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><!--[if lt IE 9]>
+<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
+<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
+<![endif]--></head><body>
+ <div class="container">
+ <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">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="../index.html">mkin</a>
+ </div>
+ <div id="navbar" class="navbar-collapse collapse">
+ <ul class="nav navbar-nav"><li>
+ <a href="../index.html">Home</a>
+</li>
+<li>
+ <a href="../reference/index.html">Reference</a>
+</li>
+ </ul><ul class="nav navbar-nav navbar-right"><li>
+ <a href="https://github.com/jranke/mkin">
+ <span class="fa fa-github fa-lg"></span>
+
+ </a>
+</li>
+ </ul></div><!--/.nav-collapse -->
+ </div><!--/.container -->
+</div><!--/.navbar -->
+
+ </header><div class="row">
+ <div class="col-md-9">
+ <div class="page-header toc-ignore">
+ <h1>mkin - Kinetic evaluation of chemical degradation data</h1>
+ <h4 class="author">Johannes Ranke</h4>
+
+ <h4 class="date">2016-10-06</h4>
+ </div>
+
+
+
+<p><a href="http://www.jrwb.de">Wissenschaftlicher Berater, Kronacher Str. 8, 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>Abstract</h1>
+<p>In the regulatory evaluation of chemical substances like plant protection products (pesticides), biocides and other chemicals, degradation data play an important role. For the evaluation of pesticide degradation experiments, detailed guidance has been developed, based on nonlinear optimisation. The <code>R</code> add-on package <code>mkin</code> <span class="citation">(Ranke 2016)</span> 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"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">require</span>(mkin)
+m_SFO_SFO_SFO &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mkinmod.html">mkinmod</a></span>(<span class="dt">parent =</span> <span class="kw"><a href="../reference/mkinsub.html">mkinsub</a></span>(<span class="st">"SFO"</span>, <span class="st">"M1"</span>),
+ <span class="dt">M1 =</span> <span class="kw"><a href="../reference/mkinsub.html">mkinsub</a></span>(<span class="st">"SFO"</span>, <span class="st">"M2"</span>),
+ <span class="dt">M2 =</span> <span class="kw"><a href="../reference/mkinsub.html">mkinsub</a></span>(<span class="st">"SFO"</span>),
+ <span class="dt">use_of_ff =</span> <span class="st">"max"</span>, <span class="dt">quiet =</span> <span class="ot">TRUE</span>)
+
+sampling_times =<span class="st"> </span><span class="kw">c</span>(<span class="dv">0</span>, <span class="dv">1</span>, <span class="dv">3</span>, <span class="dv">7</span>, <span class="dv">14</span>, <span class="dv">28</span>, <span class="dv">60</span>, <span class="dv">90</span>, <span class="dv">120</span>)
+
+d_SFO_SFO_SFO &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mkinpredict.html">mkinpredict</a></span>(m_SFO_SFO_SFO,
+ <span class="kw">c</span>(<span class="dt">k_parent =</span> <span class="fl">0.03</span>,
+ <span class="dt">f_parent_to_M1 =</span> <span class="fl">0.5</span>, <span class="dt">k_M1 =</span> <span class="kw">log</span>(<span class="dv">2</span>)/<span class="dv">100</span>,
+ <span class="dt">f_M1_to_M2 =</span> <span class="fl">0.9</span>, <span class="dt">k_M2 =</span> <span class="kw">log</span>(<span class="dv">2</span>)/<span class="dv">50</span>),
+ <span class="kw">c</span>(<span class="dt">parent =</span> <span class="dv">100</span>, <span class="dt">M1 =</span> <span class="dv">0</span>, <span class="dt">M2 =</span> <span class="dv">0</span>),
+ sampling_times)
+
+d_SFO_SFO_SFO_err &lt;-<span class="st"> </span><span class="kw"><a href="../reference/add_err.html">add_err</a></span>(d_SFO_SFO_SFO, function(x) <span class="dv">3</span>, <span class="dt">n =</span> <span class="dv">1</span>, <span class="dt">seed =</span> <span class="dv">123456789</span> )
+
+f_SFO_SFO_SFO &lt;-<span class="st"> </span><span class="kw"><a href="../reference/mkinfit.html">mkinfit</a></span>(m_SFO_SFO_SFO, d_SFO_SFO_SFO_err[[<span class="dv">1</span>]], <span class="dt">quiet =</span> <span class="ot">TRUE</span>)
+
+<span class="kw"><a href="../reference/plot.mkinfit.html">plot_sep</a></span>(f_SFO_SFO_SFO, <span class="dt">lpos =</span> <span class="kw">c</span>(<span class="st">"topright"</span>, <span class="st">"bottomright"</span>, <span class="st">"bottomright"</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>Background</h1>
+<p>Many approaches are possible regarding the evaluation of chemical degradation data.</p>
+<p>The now deprecated <code>kinfit</code> package <span class="citation">(Ranke 2015)</span> in <code>R</code> <span class="citation">(R Development Core Team 2016)</span> implements the approach recommended in the kinetics report provided by the FOrum for Co-ordination of pesticide fate models and their USe <span class="citation">(FOCUS Work Group on Degradation Kinetics 2006; 2014)</span> for simple data series for one parent compound in one compartment.</p>
+<p>The <code>mkin</code> package <span class="citation">(Ranke 2016)</span> extends this approach to data series with transformation products, commonly termed metabolites, and to more than one compartment. It is also possible to include back reactions, so equilibrium reactions and equilibrium partitioning can be specified, although this oftentimes leads to an overparameterisation of the model.</p>
+<p>When the first <code>mkin</code> code was published in 2010, the most commonly used tools for fitting more complex kinetic degradation models to experimental data were KinGUI <span class="citation">(Sch&auml;fer et al. 2007)</span>, a MATLAB based tool with a graphical user interface that was specifically tailored to the task and included some output as proposed by the FOCUS Kinetics Workgroup, and ModelMaker, a general purpose compartment based tool providing infrastructure for fitting dynamic simulation models based on differential equations to data.</p>
+<p>The code was first uploaded to the BerliOS platform. When this was taken down, the version control history was imported into the R-Forge site, where the code is still mirrored today (see <em>e.g.</em> <a href="http://cgit.jrwb.de/mkin/commit/?id=30cbb4092f6d2d3beff5800603374a0d009ad770">the initial commit on 11 May 2010</a>).</p>
+<p>At that time, the R package <code>FME</code> (Flexible Modelling Environment) <span class="citation">(Soetaert and Petzoldt 2010)</span> was already available, and provided a good basis for developing a package specifically tailored to the task. The remaining challenge was to make it as easy as possible for the users (including the author of this vignette) to specify the system of differential equations and to include the output requested by the FOCUS guidance, such as the relative standard deviation that has to be assumed for the residuals, such that the <span class="math inline">\(\chi^2\)</span> goodness-of-fit test as defined by the FOCUS kinetics workgroup would pass using an significance level <span class="math inline">\(\alpha\)</span> of 0.05.</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.</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>Derived software tools</h2>
+<p>Soon after the publication of <code>mkin</code>, two derived tools were published, namely KinGUII (available from Bayer Crop Science) and CAKE (commissioned to Tessella by Syngenta), which added a graphical user interface (GUI), and added fitting by iteratively reweighted least squares (IRLS) and characterisation of likely parameter distributions by Markov Chain Monte Carlo (MCMC) sampling.</p>
+<p>CAKE focuses on a smooth use experience, sacrificing some flexibility in the model definition, originally allowing only two primary metabolites in parallel. The current version 3.2 of CAKE release in March 2016 uses a basic scheme for up to six metabolites in a flexible arrangement, but does not support back-reactions (non-instantaneous equilibria) or biphasic kinetics for metabolites.</p>
+<p>KinGUI offers an even more flexible widget for specifying complex kinetic models. Back-reactions (non-instanteneous 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="http://kinfit.r-forge.r-project.org/gmkin_static">documentation page</a> and <a href="http://kinfit.r-forge.r-project.org/gmkin_static/vignettes/gmkin_manual.html">manual</a> for further information.</p>
+</div>
+<div id="recent-developments" class="section level2">
+<h2>Recent developments</h2>
+<p>Currently (June 2016), the main features available in <code>mkin</code> which are not present in KinGUII or CAKE, are the speed increase by using compiled code when a compiler is present, parallel model fitting on multicore machines using the <code>mmkin</code> function, and the estimation of parameter confidence intervals based on transformed parameters. These are explained in more detail below.</p>
+</div>
+</div>
+<div id="internal-parameter-transformations" class="section level1">
+<h1>Internal parameter transformations</h1>
+<p>For rate constants, the log transformation is used, as proposed by Bates and Watts <span class="citation">(1988, 77, 149)</span>. Approximate intervals are constructed for the transformed rate constants <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&eacute; 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.</p>
+<div id="confidence-intervals-based-on-transformed-parameters" class="section level2">
+<h2>Confidence intervals based on transformed parameters</h2>
+<p>In the first attempt at providing improved parameter confidence intervals introduced to <code>mkin</code> in 2013, confidence intervals obtained from FME on the transformed parameters were simply all backtransformed one by one to yield asymetric 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 only one formation fraction is to be estimated, directly corresponding to one component of the ilr transformed parameter.</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>Parameter t-test based on untransformed parameters</h2>
+<p>The standard output of many nonlinear regression software packages includes the results from a test for significant difference from zero for all parameters. Such a test is also recommended to check the validity of rate constants in the FOCUS guidance <span class="citation">(FOCUS Work Group on Degradation Kinetics 2014, 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>References</h1>
+<!-- vim: set foldmethod=syntax: -->
+<div id="refs" class="references">
+<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://focus.jrc.ec.europa.eu/dk" class="uri">http://focus.jrc.ec.europa.eu/dk</a>.</p>
+</div>
+<div id="ref-FOCUSkinetics2014">
+<p>&mdash;&mdash;&mdash;. 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://focus.jrc.ec.europa.eu/dk" class="uri">http://focus.jrc.ec.europa.eu/dk</a>.</p>
+</div>
+<div id="ref-rcore2016">
+<p>R Development Core Team. 2016. <em>R: A Language and Environment for Statistical Computing</em>. Vienna, Austria: R Foundation for Statistical Computing. <a href="http://www.R-project.org" class="uri">http://www.R-project.org</a>.</p>
+</div>
+<div id="ref-pkg:kinfit">
+<p>Ranke, J. 2015. <em>&lsquo;Kinfit&lsquo;: Routines for Fitting Simple Kinetic Models to Chemical Degradation Data</em>. <a href="http://CRAN.R-project.org/package=kinfit" class="uri">http://CRAN.R-project.org/package=kinfit</a>.</p>
+</div>
+<div id="ref-pkg:mkin">
+<p>&mdash;&mdash;&mdash;. 2016. <em>&lsquo;Mkin&lsquo;: Kinetic Evaluation of Chemical Degradation Data</em>. <a href="http://CRAN.R-project.org/package=mkin" class="uri">http://CRAN.R-project.org/package=mkin</a>.</p>
+</div>
+<div id="ref-ranke2012">
+<p>Ranke, J., and R. Lehmann. 2012. &ldquo;Parameter Reliability in Kinetic Evaluation of Environmental Metabolism Data - Assessment and the Influence of Model Specification.&rdquo; In <em>SETAC World 20-24 May</em>. Berlin.</p>
+</div>
+<div id="ref-ranke2015">
+<p>&mdash;&mdash;&mdash;. 2015. &ldquo;To T-Test or Not to T-Test, That Is the Question.&rdquo; 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="uri">http://chem.uft.uni-bremen.de/ranke/posters/piacenza_2015.pdf</a>.</p>
+</div>
+<div id="ref-schaefer2007">
+<p>Sch&auml;fer, D., B. Mikolasch, P. Rainbird, and B. Harvey. 2007. &ldquo;KinGUI: A New Kinetic Software Tool for Evaluations According to FOCUS Degradation Kinetics.&rdquo; 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&ndash;23. Piacenza.</p>
+</div>
+<div id="ref-soetaert2010">
+<p>Soetaert, Karline, and Thomas Petzoldt. 2010. &ldquo;Inverse Modelling, Sensitivity and Monte Carlo Analysis in R Using Package FME.&rdquo; <em>Journal of Statistical Software</em> 33 (3): 1&ndash;28. <a href="http://www.jstatsoft.org/v33/i03/" class="uri">http://www.jstatsoft.org/v33/i03/</a>.</p>
+</div>
+</div>
+</div>
+ </div>
+
+ <div class="col-md-3 hidden-xs">
+ <div id="tocnav">
+ <h2>Contents</h2>
+ <ul class="nav nav-pills nav-stacked"><li><a href="#abstract">Abstract</a></li>
+ <li><a href="#background">Background</a><ul class="nav nav-pills nav-stacked"><li><a href="#derived-software-tools">Derived software tools</a></li>
+ <li><a href="#recent-developments">Recent developments</a></li>
+ </ul></li>
+ <li><a href="#internal-parameter-transformations">Internal parameter transformations</a><ul class="nav nav-pills nav-stacked"><li><a href="#confidence-intervals-based-on-transformed-parameters">Confidence intervals based on transformed parameters</a></li>
+ <li><a href="#parameter-t-test-based-on-untransformed-parameters">Parameter t-test based on untransformed parameters</a></li>
+ </ul></li>
+ <li><a href="#references">References</a></li>
+ </ul></div>
+ </div>
+
+</div>
+
+
+ <footer><p>Built by <a href="http://hadley.github.io/pkgdown/">pkgdown</a>. Styled with <a href="http://getbootstrap.com">Bootstrap 3</a>.</p>
+ </footer></div>
+
+ </body></html>
diff --git a/docs/articles/mkin_files/figure-html/unnamed-chunk-2-1.png b/docs/articles/mkin_files/figure-html/unnamed-chunk-2-1.png
new file mode 100644
index 00000000..d34e3805
--- /dev/null
+++ b/docs/articles/mkin_files/figure-html/unnamed-chunk-2-1.png
Binary files differ

Contact - Imprint