aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-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
-rw-r--r--docs/index.html330
-rw-r--r--docs/news/index.html401
-rw-r--r--docs/pkgdown.css59
-rw-r--r--docs/pkgdown.js13
-rw-r--r--docs/reference/DFOP.solution.html132
-rw-r--r--docs/reference/Extract.mmkin.html1192
-rw-r--r--docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html129
-rw-r--r--docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html128
-rw-r--r--docs/reference/FOCUS_2006_HS_ref_A_to_F.html129
-rw-r--r--docs/reference/FOCUS_2006_SFO_ref_A_to_F.html127
-rw-r--r--docs/reference/FOCUS_2006_datasets.html130
-rw-r--r--docs/reference/FOMC.solution.html147
-rw-r--r--docs/reference/HS.solution.html131
-rw-r--r--docs/reference/IORE.solution.html149
-rw-r--r--docs/reference/SFO.solution.html124
-rw-r--r--docs/reference/SFORB.solution.html133
-rw-r--r--docs/reference/add_err.html196
-rw-r--r--docs/reference/endpoints.html123
-rw-r--r--docs/reference/geometric_mean.html115
-rw-r--r--docs/reference/ilr.html152
-rw-r--r--docs/reference/index.html111
-rw-r--r--docs/reference/mccall81_245T.html229
-rw-r--r--docs/reference/mkin_long_to_wide.html152
-rw-r--r--docs/reference/mkin_wide_to_long.html131
-rw-r--r--docs/reference/mkinds.html120
-rw-r--r--docs/reference/mkinerrmin.html150
-rw-r--r--docs/reference/mkinfit.html531
-rw-r--r--docs/reference/mkinmod.html206
-rw-r--r--docs/reference/mkinparplot.html122
-rw-r--r--docs/reference/mkinplot.html118
-rw-r--r--docs/reference/mkinpredict.html318
-rw-r--r--docs/reference/mkinresplot.html166
-rw-r--r--docs/reference/mkinsub.html147
-rw-r--r--docs/reference/mmkin.html178
-rw-r--r--docs/reference/plot.mkinfit.html231
-rw-r--r--docs/reference/plot.mmkin.html156
-rw-r--r--docs/reference/print.mkinds.html109
-rw-r--r--docs/reference/print.mkinmod.html109
-rw-r--r--docs/reference/schaefer07_complex_case.html131
-rw-r--r--docs/reference/summary.mkinfit.html229
-rw-r--r--docs/reference/synthetic_data_for_UBA.html157
-rw-r--r--docs/reference/transform_odeparms.html276
-rw-r--r--docs/reference/unknown-10.pngbin0 -> 18197 bytes
-rw-r--r--docs/reference/unknown-2.pngbin0 -> 10552 bytes
-rw-r--r--docs/reference/unknown-4.pngbin0 -> 10559 bytes
-rw-r--r--docs/reference/unknown-6.pngbin0 -> 7945 bytes
-rw-r--r--docs/reference/unknown-8.pngbin0 -> 13728 bytes
66 files changed, 9217 insertions, 222 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
diff --git a/docs/index.html b/docs/index.html
index 0f351a2d..e5edc17c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1,244 +1,130 @@
+<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
-<html lang="en">
+<html>
<head>
- <meta charset="utf-8">
-<title>Home. mkin 0.9.44.9000</title>
+ <meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<meta name="author" content="">
-<link href="css/bootstrap.css" rel="stylesheet">
-<link href="css/bootstrap-responsive.css" rel="stylesheet">
-<link href="css/highlight.css" rel="stylesheet">
-<link href="css/staticdocs.css" rel="stylesheet">
+<title>Home. mkin</title>
-<!--[if lt IE 9]>
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
-<![endif]-->
-
-<script type="text/x-mathjax-config">
- MathJax.Hub.Config({
- tex2jax: {
- inlineMath: [ ['$','$'], ["\\(","\\)"] ],
- processEscapes: true
- }
- });
-</script>
-<script type="text/javascript"
- src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
-</script>
- </head>
+<!-- jquery -->
+<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script>
- <body>
- <div class="navbar">
- <div class="navbar-inner">
- <div class="container">
- <a class="brand" href="index.html">mkin 0.9.44.9000</a>
- <div class="nav">
- <ul class="nav">
- <li><a href="index.html">Home</a></li>
- <li><a href="reference.html">Reference</a></li>
- </ul>
- </div>
- </div>
- </div>
-</div>
+<!-- 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>
- <div class="container">
- <header>
-
- </header>
-
- <div class="row">
- <div class="span8">
- <h1>mkin</h1>
+<!-- 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">
-<p><a href="http://cran.r-project.org/package=mkin"><img src="http://www.r-pkg.org/badges/version/mkin" alt=""/></a></p>
-<p>The R package <strong>mkin</strong> provides calculation routines for the analysis of
-chemical degradation data, including <b>m</b>ulticompartment <b>kin</b>etics as
-needed for modelling the formation and decline of transformation products, or
-if several compartments are involved.</p>
+<!-- pkgdown -->
+<link href="pkgdown.css" rel="stylesheet">
+<script src="pkgdown.js"></script>
-<h2>Installation</h2>
+<!-- mathjax -->
+<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>
-<p>You can install the latest released version from
-<a href="http://cran.r-project.org/package=mkin">CRAN</a> from within R:</p>
-
-<pre><code class="r">install.packages(&quot;mkin&quot;)
-</code></pre>
-
-<h2>Background</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 and helpful tools have been developed as detailed in
-&#39;Credits and historical remarks&#39; below.</p>
-
-<h2>Usage</h2>
-
-<p>For a start, have a look a the code examples provided for
-<a href="http://kinfit.r-forge.r-project.org/mkin_static/plot.mkinfit.html"><code>plot.mkinfit</code></a>
-and
-<a href="http://kinfit.r-forge.r-project.org/mkin_static/plot.mmkin.html"><code>plot.mmkin</code></a>, and
-at the package vignettes
-<a href="http://kinfit.r-forge.r-project.org/mkin_static/vignettes/FOCUS_L.html"><code>FOCUS L</code></a> and
-<a href="http://kinfit.r-forge.r-project.org/mkin_static/vignettes/FOCUS_D.html"><code>FOCUS D</code></a>.</p>
-
-<h2>Documentation</h2>
-
-<p>The <a href="http://kinfit.r-forge.r-project.org/mkin_static">HTML documentation</a> is
-maintained at the R-Forge project site.</p>
+<!--[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>
-<h2>Features</h2>
+ <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">
+
+<h1 id="mkin">mkin</h1>
+<p><a href="http://cran.r-project.org/package=mkin"><img src="http://www.r-pkg.org/badges/version/mkin"></a></p>
+<p>The R package <strong>mkin</strong> provides calculation routines for the analysis of chemical degradation data, including <b>m</b>ulticompartment <b>kin</b>etics as needed for modelling the formation and decline of transformation products, or if several compartments are involved.</p>
+<h2 id="installation">Installation</h2>
+<p>You can install the latest released version from <a href="http://cran.r-project.org/package=mkin">CRAN</a> from within R:</p>
+<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">install.packages</span>(<span class="st">"mkin"</span>)</code></pre></div>
+<h2 id="background">Background</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 and helpful tools have been developed as detailed in &lsquo;Credits and historical remarks&rsquo; below.</p>
+<h2 id="usage">Usage</h2>
+<p>For a start, have a look a the code examples provided for <a href="http://kinfit.r-forge.r-project.org/mkin_static/plot.mkinfit.html"><code>plot.mkinfit</code></a> and <a href="http://kinfit.r-forge.r-project.org/mkin_static/plot.mmkin.html"><code>plot.mmkin</code></a>, and at the package vignettes <a href="http://kinfit.r-forge.r-project.org/mkin_static/vignettes/FOCUS_L.html"><code>FOCUS L</code></a> and <a href="http://kinfit.r-forge.r-project.org/mkin_static/vignettes/FOCUS_D.html"><code>FOCUS D</code></a>.</p>
+<h2 id="documentation">Documentation</h2>
+<p>The <a href="http://kinfit.r-forge.r-project.org/mkin_static">HTML documentation</a> is maintained at the R-Forge project site.</p>
+<h2 id="features">Features</h2>
<ul>
-<li>Highly flexible model specification using
-<a href="http://kinfit.r-forge.r-project.org/mkin_static/mkinmod.html"><code>mkinmod</code></a>,
-including equilibrium reactions and using the single first-order
-reversible binding (SFORB) model, which will automatically create
-two latent state variables for the observed variable.</li>
-<li>As of version 0.9-39, fitting of several models to several datasets, optionally in
-parallel, is supported, see for example
-<a href="http://kinfit.r-forge.r-project.org/mkin_static/plot.mmkin.html"><code>plot.mmkin</code></a>.</li>
-<li>Model solution (forward modelling) in the function
-<a href="http://kinfit.r-forge.r-project.org/mkin_static/mkinpredict.html"><code>mkinpredict</code></a>
-is performed either using the analytical solution for the case of
-parent only degradation, an eigenvalue based solution if only simple
-first-order (SFO) or SFORB kinetics are used in the model, or
-using a numeric solver from the <code>deSolve</code> package (default is <code>lsoda</code>).</li>
-<li>If a C compiler is installed, the kinetic models are compiled from automatically
-generated C code, see<br/>
-<a href="http://kinfit.r-forge.r-project.org/mkin_static/vignettes/compiled_models.html">vignette <code>compiled_models</code></a>.
-The autogeneration of C code was
-inspired by the <a href="https://github.com/karlines/ccSolve"><code>ccSolve</code></a> package. Thanks
-to Karline Soetaert for her work on that.</li>
-<li>By default, kinetic rate constants and kinetic formation fractions are
-transformed internally using
-<a href="http://kinfit.r-forge.r-project.org/mkin_static/transform_odeparms.html"><code>transform_odeparms</code></a>
-so their estimators can more reasonably be expected to follow
-a normal distribution. This has the side effect that no constraints
-are needed in the optimisation. Thanks to René Lehmann for the nice
-cooperation on this, especially the isometric logration transformation
-that is now used for the formation fractions.</li>
-<li>A side effect of this is that when parameter estimates are backtransformed
-to match the model definition, confidence intervals calculated from
-standard errors are also backtransformed to the correct scale, and will
-not include meaningless values like negative rate constants or
-formation fractions adding up to more than 1, which can not occur in
-a single experiment with a single defined radiolabel position.</li>
-<li>The usual one-sided t-test for significant difference from zero is nevertheless
-shown based on estimators for the untransformed parameters.</li>
-<li>Summary and plotting functions. The <code>summary</code> of an <code>mkinfit</code> object is in
-fact a full report that should give enough information to be able to
-approximately reproduce the fit with other tools.</li>
-<li>The chi-squared error level as defined in the FOCUS kinetics guidance
-(see below) is calculated for each observed variable.</li>
-<li>Iteratively reweighted least squares fitting is implemented in a similar way
-as in KinGUII and CAKE (see below). Simply add the argument
-<code>reweight = &quot;obs&quot;</code> to your call to <code>mkinfit</code> and a separate variance
-componenent for each of the observed variables will be optimised
-in a second stage after the primary optimisation algorithm has converged.</li>
-<li>When a metabolite decline phase is not described well by SFO kinetics,
-SFORB kinetics can be used for the metabolite.</li>
+<li>Highly flexible model specification using <a href="http://kinfit.r-forge.r-project.org/mkin_static/mkinmod.html"><code>mkinmod</code></a>, including equilibrium reactions and using the single first-order reversible binding (SFORB) model, which will automatically create two latent state variables for the observed variable.</li>
+<li>As of version 0.9-39, fitting of several models to several datasets, optionally in parallel, is supported, see for example <a href="http://kinfit.r-forge.r-project.org/mkin_static/plot.mmkin.html"><code>plot.mmkin</code></a>.</li>
+<li>Model solution (forward modelling) in the function <a href="http://kinfit.r-forge.r-project.org/mkin_static/mkinpredict.html"><code>mkinpredict</code></a> is performed either using the analytical solution for the case of parent only degradation, an eigenvalue based solution if only simple first-order (SFO) or SFORB kinetics are used in the model, or using a numeric solver from the <code>deSolve</code> package (default is <code>lsoda</code>).</li>
+<li>If a C compiler is installed, the kinetic models are compiled from automatically generated C code, see<br><a href="http://kinfit.r-forge.r-project.org/mkin_static/vignettes/compiled_models.html">vignette <code>compiled_models</code></a>. The autogeneration of C code was inspired by the <a href="https://github.com/karlines/ccSolve"><code>ccSolve</code></a> package. Thanks to Karline Soetaert for her work on that.</li>
+<li>By default, kinetic rate constants and kinetic formation fractions are transformed internally using <a href="http://kinfit.r-forge.r-project.org/mkin_static/transform_odeparms.html"><code>transform_odeparms</code></a> so their estimators can more reasonably be expected to follow a normal distribution. This has the side effect that no constraints are needed in the optimisation. Thanks to Ren&eacute; Lehmann for the nice cooperation on this, especially the isometric logration transformation that is now used for the formation fractions.</li>
+<li>A side effect of this is that when parameter estimates are backtransformed to match the model definition, confidence intervals calculated from standard errors are also backtransformed to the correct scale, and will not include meaningless values like negative rate constants or formation fractions adding up to more than 1, which can not occur in a single experiment with a single defined radiolabel position.</li>
+<li>The usual one-sided t-test for significant difference from zero is nevertheless shown based on estimators for the untransformed parameters.</li>
+<li>Summary and plotting functions. The <code>summary</code> of an <code>mkinfit</code> object is in fact a full report that should give enough information to be able to approximately reproduce the fit with other tools.</li>
+<li>The chi-squared error level as defined in the FOCUS kinetics guidance (see below) is calculated for each observed variable.</li>
+<li>Iteratively reweighted least squares fitting is implemented in a similar way as in KinGUII and CAKE (see below). Simply add the argument <code>reweight = "obs"</code> to your call to <code>mkinfit</code> and a separate variance componenent for each of the observed variables will be optimised in a second stage after the primary optimisation algorithm has converged.</li>
+<li>When a metabolite decline phase is not described well by SFO kinetics, SFORB kinetics can be used for the metabolite.</li>
</ul>
-
-<h2>GUI</h2>
-
-<p>There is a graphical user interface that I consider useful for real work. Please
-refer to its <a href="http://kinfit.r-forge.r-project.org/gmkin_static">documentation page</a>
-for installation instructions and a manual.</p>
-
-<h2>News</h2>
-
-<p>Yes, there is a ChangeLog, for the latest <a href="http://cran.r-project.org/web/packages/mkin/news.html">CRAN release</a>
-and one for the <a href="https://github.com/jranke/mkin/blob/master/NEWS.md">github master branch</a>.</p>
-
-<h2>Credits and historical remarks</h2>
-
-<p><code>mkin</code> would not be possible without the underlying software stack consisting
-of R and the packages <a href="http://cran.r-project.org/package=deSolve">deSolve</a>
-and <a href="http://cran.r-project.org/package=FME">FME</a>, to say the least.</p>
-
-<p>It could not have been written without me being introduced to regulatory fate
-modelling of pesticides by Adrian Gurney during my time at Harlan Laboratories
-Ltd (formerly RCC Ltd). <code>mkin</code> greatly profits from and largely follows
-the work done by the
-<a href="http://focus.jrc.ec.europa.eu/dk">FOCUS Degradation Kinetics Workgroup</a>,
-as detailed in their guidance document from 2006, slightly updated in 2011 and
-2014.</p>
-
-<p>Also, it was inspired by the first version of KinGUI developed by
-BayerCropScience, which is based on the MatLab runtime environment.</p>
-
-<p>The companion package
-<a href="http://kinfit.r-forge.r-project.org/kinfit_static/index.html">kinfit</a> (now deprecated) was
-<a href="https://r-forge.r-project.org/scm/viewvc.php?view=rev&amp;root=kinfit&amp;revision=2">started in 2008</a> and
-<a href="http://cran.r-project.org/src/contrib/Archive/kinfit/">first published</a> on
-CRAN on 01 May 2010.</p>
-
-<p>The first <code>mkin</code> code was
-<a href="https://r-forge.r-project.org/scm/viewvc.php?view=rev&amp;root=kinfit&amp;revision=8">published on 11 May 2010</a> and the
-<a href="http://cran.r-project.org/src/contrib/Archive/mkin">first CRAN version</a>
-on 18 May 2010.</p>
-
-<p>In 2011, Bayer Crop Science started to distribute an R based successor to KinGUI named
-KinGUII whose R code is based on <code>mkin</code>, but which added, amongst other
-refinements, a closed source graphical user interface (GUI), iteratively
-reweighted least squares (IRLS) optimisation of the variance for each of the
-observed variables, and Markov Chain Monte Carlo (MCMC) simulation
-functionality, similar to what is available e.g. in the <code>FME</code> package.</p>
-
-<p>Somewhat in parallel, Syngenta has sponsored the development of an <code>mkin</code> and
-KinGUII based GUI application called CAKE, which also adds IRLS and MCMC, is
-more limited in the model formulation, but puts more weight on usability.
-CAKE is available for download from the <a href="http://projects.tessella.com/cake">CAKE
-website</a>, where you can also
-find a zip archive of the R scripts derived from <code>mkin</code>, published under the GPL
-license.</p>
-
-<p>Finally, there is
-<a href="http://github.com/zhenglei-gao/KineticEval">KineticEval</a>, which contains
-a further development of the scripts used for KinGUII, so the different tools
-will hopefully be able to learn from each other in the future as well.</p>
-
-<h2>Development</h2>
-
-<p>Contributions are welcome! Your
-<a href="https://help.github.com/articles/fork-a-repo">mkin fork</a> is just a mouse click
-away&hellip; The master branch on github should always be in good shape, I implement
-new features in separate branches now. If you prefer subversion, project
-members for the
-<a href="http://r-forge.r-project.org/R/?group_id=615">r-forge project</a> are welcome as well.
-Generally, the source code of the latest CRAN version should be available there.
-You can also browse the source code at <a href="http://cgit.jrwb.de/mkin">cgit.jrwb.de/mkin</a>.</p>
+<h2 id="gui">GUI</h2>
+<p>There is a graphical user interface that I consider useful for real work. Please refer to its <a href="http://kinfit.r-forge.r-project.org/gmkin_static">documentation page</a> for installation instructions and a manual.</p>
+<h2 id="news">News</h2>
+<p>Yes, there is a ChangeLog, for the latest <a href="http://cran.r-project.org/web/packages/mkin/news.html">CRAN release</a> and one for the <a href="https://github.com/jranke/mkin/blob/master/NEWS.md">github master branch</a>.</p>
+<h2 id="credits-and-historical-remarks">Credits and historical remarks</h2>
+<p><code>mkin</code> would not be possible without the underlying software stack consisting of R and the packages <a href="http://cran.r-project.org/package=deSolve">deSolve</a> and <a href="http://cran.r-project.org/package=FME">FME</a>, to say the least.</p>
+<p>It could not have been written without me being introduced to regulatory fate modelling of pesticides by Adrian Gurney during my time at Harlan Laboratories Ltd (formerly RCC Ltd). <code>mkin</code> greatly profits from and largely follows the work done by the <a href="http://focus.jrc.ec.europa.eu/dk">FOCUS Degradation Kinetics Workgroup</a>, as detailed in their guidance document from 2006, slightly updated in 2011 and</p>
+<ol>
+<li>
+</ol>
+<p>Also, it was inspired by the first version of KinGUI developed by BayerCropScience, which is based on the MatLab runtime environment.</p>
+<p>The companion package <a href="http://kinfit.r-forge.r-project.org/kinfit_static/index.html">kinfit</a> (now deprecated) was <a href="https://r-forge.r-project.org/scm/viewvc.php?view=rev&amp;root=kinfit&amp;revision=2">started in 2008</a> and <a href="http://cran.r-project.org/src/contrib/Archive/kinfit/">first published</a> on CRAN on 01 May 2010.</p>
+<p>The first <code>mkin</code> code was <a href="https://r-forge.r-project.org/scm/viewvc.php?view=rev&amp;root=kinfit&amp;revision=8">published on 11 May 2010</a> and the <a href="http://cran.r-project.org/src/contrib/Archive/mkin">first CRAN version</a> on 18 May 2010.</p>
+<p>In 2011, Bayer Crop Science started to distribute an R based successor to KinGUI named KinGUII whose R code is based on <code>mkin</code>, but which added, amongst other refinements, a closed source graphical user interface (GUI), iteratively reweighted least squares (IRLS) optimisation of the variance for each of the observed variables, and Markov Chain Monte Carlo (MCMC) simulation functionality, similar to what is available e.g.&nbsp;in the <code>FME</code> package.</p>
+<p>Somewhat in parallel, Syngenta has sponsored the development of an <code>mkin</code> and KinGUII based GUI application called CAKE, which also adds IRLS and MCMC, is more limited in the model formulation, but puts more weight on usability. CAKE is available for download from the <a href="http://projects.tessella.com/cake">CAKE website</a>, where you can also find a zip archive of the R scripts derived from <code>mkin</code>, published under the GPL license.</p>
+<p>Finally, there is <a href="http://github.com/zhenglei-gao/KineticEval">KineticEval</a>, which contains a further development of the scripts used for KinGUII, so the different tools will hopefully be able to learn from each other in the future as well.</p>
+<h2 id="development">Development</h2>
+<p>Contributions are welcome! Your <a href="https://help.github.com/articles/fork-a-repo">mkin fork</a> is just a mouse click away&hellip; The master branch on github should always be in good shape, I implement new features in separate branches now. If you prefer subversion, project members for the <a href="http://r-forge.r-project.org/R/?group_id=615">r-forge project</a> are welcome as well. Generally, the source code of the latest CRAN version should be available there. You can also browse the source code at <a href="http://cgit.jrwb.de/mkin">cgit.jrwb.de/mkin</a>.</p>
</div>
-
- <div class="span3 offset1 sidebar">
- <h2>Vignettes</h2>
- <ul>
- <li><a href="vignettes/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a></li>
- <li><a href="vignettes/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a></li>
- <li><a href="vignettes/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a></li>
- <li><a href="vignettes/mkin.html">mkin - Kinetic evaluation of chemical degradation data</a></li>
- <li><a href="vignettes/FOCUS_Z.pdf">Example evaluation of FOCUS dataset Z</a></li>
- </ul>
- <h2>Authors</h2>
- <ul>
- <li><a href='mailto:jranke@uni-bremen.de'>Johannes Ranke</a> [aut, cre, cph]</li>
- <li>Katrin Lindenberger [ctb]</li>
- <li>René Lehmann [ctb]</li>
- <li>Eurofins Regulatory AG [cph]</li>
- </ul>
- </div>
</div>
-
+
<footer>
- <p class="pull-right"><a href="#">Back to top</a></p>
-<p>Built by <a href="https://github.com/hadley/staticdocs">staticdocs</a>. Styled with <a href="https://getbootstrap.com/2.0.4/">bootstrap</a>.</p>
+ <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>
+ </div>
+
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/docs/news/index.html b/docs/news/index.html
new file mode 100644
index 00000000..4e321474
--- /dev/null
+++ b/docs/news/index.html
@@ -0,0 +1,401 @@
+<!-- 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>All news. 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 id="mkin-0.9.45" class="section level1">
+<h1>mkin 0.9.45</h1>
+<div id="minor-changes" class="section level2">
+<h2>Minor changes</h2>
+<ul><li>
+<code>plot.mkinfit</code>: Plotting does not fail any more when the compiled model is not available, e.g. because it was removed from the temporary directory. In this case, the uncompiled model is now used for plotting</li>
+</ul></div>
+</div>
+ <div id="mkin-0.9.44-2016-06-29" class="section level1">
+<h1>mkin 0.9.44 (2016-06-29)</h1>
+<div id="bug-fixes" class="section level2">
+<h2>Bug fixes</h2>
+<ul><li>The test <code>test_FOMC_ill-defined</code> failed on several architectures, so the test is now skipped</li>
+</ul></div>
+</div>
+ <div id="mkin-0.9.43-2016-06-28" class="section level1">
+<h1>mkin 0.9.43 (2016-06-28)</h1>
+<div id="major-changes" class="section level2">
+<h2>Major changes</h2>
+<ul><li><p>The title was changed to <code>Kinetic evaluations of chemical degradation data</code></p></li>
+<li><p><code>plot.mkinfit</code>: Add the possibility to show fits (and residual plots if requested) separately for the observed variables</p></li>
+<li><p><code>plot.mkinfit</code>: Add the possibility to show the chi2 error levels in the plot, similar to the way they are shown in <code>plot.mmkin</code></p></li>
+<li><p><code>plot_sep</code>: Add this function as a convenience wrapper for plotting observed variables of mkinfit objects separately, with chi2 error values and residual plots.</p></li>
+<li><p>Vignettes: The main vignette <code>mkin</code> was converted to R markdown and updated. The other vignettes were also updated to show current improved functionality.</p></li>
+<li><p>The function <code>add_err</code> was added to the package, making it easy to generate simulated data using an error model based on the normal distribution</p></li>
+</ul></div>
+<div id="minor-changes-1" class="section level2">
+<h2>Minor changes</h2>
+<ul><li><p>Remove an outdated reference to the inline package in the <code>compiled_models</code> vignette</p></li>
+<li><p><code>mkinfit</code>: Do not error out in cases where the fit converges, but the Jacobian for the untransformed model cost can not be estimated. Give a warning instead and return NA for the t-test results.</p></li>
+<li><p><code>summary.mkinfit</code>: Give a warning message when the covariance matrix can not be obtained.</p></li>
+<li><p>A test has been added to containing a corresponding edge case to check that the warnings are correctly issued and the fit does not terminate.</p></li>
+<li><p><code>plot.mmkin</code>: Round the chi2 error value to three significant digits, instead of two decimal digits.</p></li>
+<li><p><code>mkinfit</code>: Return the <code>err</code> values used on weighted fits as a column named <code>err</code>. Also include these inverse weights when the column <code>value</code> in the observed data is used, which is returned as <code>observed</code> in the data component of the mkinfit object.</p></li>
+</ul></div>
+<div id="bug-fixes-1" class="section level2">
+<h2>Bug fixes</h2>
+<ul><li><p><code>endpoints</code>: When the name of a substance degrading to a metabolite (e.g. a parent compound) used in the model formulation ended in the letter <code>f</code>, some rate parameters could be listed as formation fractions with mixed up names. These would also appear in the summary.</p></li>
+<li><p><code>mkinfit</code>: Check for all observed variables when checking if the user tried to fix formation fractions when fitting them using ilr transformation.</p></li>
+<li><p><code>plot.mmkin</code>: Set the plot margins correctly, also in the case of a single fit to be plotted, so the main title is placed in a reasonable way.</p></li>
+<li><p><code>plot.mkinfit</code>: Correct default values for <code>col_obs</code>, <code>pch_obs</code> and <code>lty_obs</code> for the case that <code>obs_vars</code> is specified.</p></li>
+</ul></div>
+</div>
+ <div id="mkin-0.9.42-2016-03-25" class="section level1">
+<h1>mkin 0.9.42 (2016-03-25)</h1>
+<div id="major-changes-1" class="section level2">
+<h2>Major changes</h2>
+<ul><li>Add the argument <code>from_max_mean</code> to <code>mkinfit</code>, for fitting only the decline from the maximum observed value for models with a single observed variable</li>
+</ul></div>
+<div id="minor-changes-2" class="section level2">
+<h2>Minor changes</h2>
+<ul><li><p>Add plots to <code>compiled_models</code> vignette</p></li>
+<li><p>Give an explanatory error message when mkinmod fails due to a missing definition of a target variable</p></li>
+<li><p><code><a href="../reference/print.mkinmod.html">print.mkinmod()</a></code>: Improve formatting when printing mkinmod model definitions</p></li>
+</ul></div>
+</div>
+ <div id="mkin-0.9-41-2015-11-09" class="section level1">
+<h1>mkin 0.9-41 (2015-11-09)</h1>
+<div id="minor-changes-3" class="section level2">
+<h2>Minor changes</h2>
+<ul><li><p>Add an R6 class <code>mkinds</code> representing datasets with a printing method</p></li>
+<li><p>Add a printing method for mkinmod objects</p></li>
+<li><p>Make it possible to specify arbitrary strings as names for the compounds in <code>mkinmod</code>, and show them in the plot</p></li>
+<li><p>Use an index.r file to group help topics in static documentation</p></li>
+</ul></div>
+<div id="bug-fixes-2" class="section level2">
+<h2>Bug fixes</h2>
+<ul><li>
+<code><a href="../reference/summary.mkinfit.html">print.summary.mkinfit()</a></code>: Avoid an error that occurred when printing summaries generated with mkin versions before 0.9-36</li>
+</ul></div>
+</div>
+ <div id="mkin-0.9-40-2015-07-21" class="section level1">
+<h1>mkin 0.9-40 (2015-07-21)</h1>
+<div id="bug-fixes-3" class="section level2">
+<h2>Bug fixes</h2>
+<ul><li>
+<code><a href="../reference/endpoints.html">endpoints()</a></code>: For DFOP and SFORB models, where <code>optimize()</code> is used, make use of the fact that the DT50 must be between DT50_k1 and DT50_k2 (DFOP) or DT50_b1 and DT50_b2 (SFORB), as <code>optimize()</code> sometimes did not find the minimum. Likewise for finding DT90 values. Also fit on the log scale to make the function more efficient.</li>
+</ul></div>
+<div id="internal-changes" class="section level2">
+<h2>Internal changes</h2>
+<ul><li>
+<code>DESCRIPTION</code>, <code>NAMESPACE</code>, <code>R/*.R</code>: Import (from) stats, graphics and methods packages, and qualify some function calls for non-base packages installed with R to avoid NOTES made by R CMD check –as-cran with upcoming R versions.</li>
+</ul></div>
+</div>
+ <div id="mkin-0.9-39-2015-06-26" class="section level1">
+<h1>mkin 0.9-39 (2015-06-26)</h1>
+<div id="major-changes-2" class="section level2">
+<h2>Major changes</h2>
+<ul><li><p>New function <code><a href="../reference/mmkin.html">mmkin()</a></code>: This function takes a character vector of model shorthand names, or alternatively a list of mkinmod models, as well as a list of dataset as main arguments. It returns a matrix of mkinfit objects, with a row for each model and a column for each dataset. A subsetting method with single brackets is available. Fitting the models in parallel using the <code>parallel</code> package is supported.</p></li>
+<li><p>New function <code><a href="../reference/plot.mmkin.html">plot.mmkin()</a></code>: Plots single-row or single-column <code>mmkin</code> objects including residual plots.</p></li>
+</ul></div>
+<div id="bug-fixes-4" class="section level2">
+<h2>Bug fixes</h2>
+<ul><li>
+<code><a href="../reference/mkinparplot.html">mkinparplot()</a></code>: Fix the x axis scaling for rate constants and formation fractions that got confused by the introduction of the t-values of transformed parameters.</li>
+</ul></div>
+</div>
+ <div id="mkin-0.9-38-2015-06-24" class="section level1">
+<h1>mkin 0.9-38 (2015-06-24)</h1>
+<div id="minor-changes-4" class="section level2">
+<h2>Minor changes</h2>
+<ul><li><p><code>vignettes/compiled_models.html</code>: Show the performance improvement factor actually obtained when building the vignette, as well as mkin version, some system info and the CPU model used for building the vignette.</p></li>
+<li><p><code>GNUMakefile</code>,<code>vignettes/*</code>: Clean up vignette generation and include table of contents in HTML vignettes.</p></li>
+</ul></div>
+<div id="bug-fixes-5" class="section level2">
+<h2>Bug fixes</h2>
+<ul><li>
+<code><a href="../reference/mkinmod.html">mkinmod()</a></code>: When generating the C code for the derivatives, only declare the time variable when it is needed and remove the ‘-W-no-unused-variable’ compiler flag as the C compiler used in the CRAN checks on Solaris does not know it.</li>
+</ul></div>
+</div>
+ <div id="mkin-0.9-36-2015-06-21" class="section level1">
+<h1>mkin 0.9-36 (2015-06-21)</h1>
+<div id="major-changes-3" class="section level2">
+<h2>Major changes</h2>
+<ul><li><p><code><a href="../reference/summary.mkinfit.html">summary.mkinfit()</a></code>: A one-sided t-test for significant difference of untransformed parameters from zero is now always shown, based on the assumption of normal distribution for estimators of all untransformed parameters. Use with caution, as this assumption is unrealistic e.g. for rate constants in these nonlinear kinetic models.</p></li>
+<li><p>If a compiler (gcc) is installed, use a version of the differential equation model compiled from C code, which is a huge performance boost for models where only the deSolve method works.</p></li>
+<li><p><code><a href="../reference/mkinmod.html">mkinmod()</a></code>: Create a list component $cf (of class CFuncList) in the list returned by mkinmod, if a version can be compiled from autogenerated C code (see above).</p></li>
+<li><p><code><a href="../reference/mkinfit.html">mkinfit()</a></code>: Set the default <code>solution_type</code> to <code>deSolve</code> when a compiled version of the model is present, except when an analytical solution is possible.</p></li>
+</ul></div>
+<div id="minor-changes-5" class="section level2">
+<h2>Minor changes</h2>
+<ul><li>Added a simple showcase vignette with an evaluation of FOCUS example dataset D</li>
+</ul></div>
+</div>
+ <div id="mkin-0.9-35-2015-05-15" class="section level1">
+<h1>mkin 0.9-35 (2015-05-15)</h1>
+<div id="major-changes-4" class="section level2">
+<h2>Major changes</h2>
+<ul><li>Switch from RUnit to testthat for testing</li>
+</ul></div>
+<div id="bug-fixes-6" class="section level2">
+<h2>Bug fixes</h2>
+<ul><li><p><code><a href="../reference/mkinparplot.html">mkinparplot()</a></code>: Avoid warnings that occurred when not all confidence intervals were available in the summary of the fit</p></li>
+<li><p><code><a href="../reference/summary.mkinfit.html">print.summary.mkinfit()</a></code>: Fix printing the summary for the case that the number of iterations is not available</p></li>
+<li><p>NAMESPACE: export S3 methods plot.mkinfit, summary.mkinfit and print.summary.mkinfit to satisfy R CMD check on R-devel</p></li>
+<li><p><code><a href="../reference/mkinparplot.html">mkinparplot()</a></code>: Avoid warning in R CMD check about undeclared global variable <code>Lower</code></p></li>
+</ul></div>
+<div id="new-features" class="section level2">
+<h2>New features</h2>
+<ul><li><p><code><a href="../reference/mkinfit.html">mkinfit()</a></code>: Report successful termination when quiet = FALSE. This is helpful for more difficult problems fitted with reweight.method = obs, as no progress is often indicated during the reweighting.</p></li>
+<li><p>A first test using results established in the expertise written for the German Federal Environmental Agency (UBA) was added.</p></li>
+<li><p>Add synthetic datasets generated for expertise written for the German Federal Environmental Agency UBA</p></li>
+<li><p>Add tests based on these datasets</p></li>
+</ul></div>
+</div>
+ <div id="mkin-0.9-34-2014-11-22" class="section level1">
+<h1>mkin 0.9-34 (2014-11-22)</h1>
+<div id="new-features-1" class="section level2">
+<h2>New features</h2>
+<ul><li><p>Add the convenience function <code><a href="../reference/mkinsub.html">mkinsub()</a></code> for creating the lists used in <code><a href="../reference/mkinmod.html">mkinmod()</a></code></p></li>
+<li><p>Add the possibility to fit indeterminate order rate equation (IORE) models using an analytical solution (parent only) or a numeric solution. Paths from IORE compounds to metabolites are supported when using formation fractions (use_of_ff = ‘max’). Note that the numerical solution (method.ode = ‘deSolve’) of the IORE differential equations sometimes fails due to numerical problems.</p></li>
+<li><p>Switch to using the Port algorithm (using a model/trust region approach) per default. While needing more iterations than the Levenberg-Marquardt algorithm previously used per default, it is less sensitive to starting parameters.</p></li>
+</ul></div>
+<div id="minor-changes-6" class="section level2">
+<h2>Minor changes</h2>
+<ul><li><p>The formatting of differential equations in the summary was further improved</p></li>
+<li><p>Always include 0 on y axis when plotting during the fit</p></li>
+</ul></div>
+</div>
+ <div id="mkin-0.9-33-2014-10-22" class="section level1">
+<h1>mkin 0.9-33 (2014-10-22)</h1>
+<div id="new-features-2" class="section level2">
+<h2>New features</h2>
+<ul><li><p>The initial value (state.ini) for the observed variable with the highest observed residue is set to 100 in case it has no time zero observation and <code>state.ini = "auto"</code></p></li>
+<li><p>A basic unit test for <code><a href="../reference/mkinerrmin.html">mkinerrmin()</a></code> was written</p></li>
+</ul></div>
+<div id="bug-fixes-7" class="section level2">
+<h2>Bug fixes</h2>
+<ul><li><p><code><a href="../reference/mkinfit.html">mkinfit()</a></code>: The internally fitted parameter for <code>g</code> was named <code>g_ilr</code> even when <code>transform_fractions=FALSE</code></p></li>
+<li><p><code><a href="../reference/mkinfit.html">mkinfit()</a></code>: The initial value (state.ini) for the parent compound was not set when the parent was not the (only) variable with the highest value in the observed data.</p></li>
+<li><p><code><a href="../reference/mkinerrmin.html">mkinerrmin()</a></code>: When checking for degrees of freedom for metabolites, check if their time zero value is fixed instead of checking if the observed value is zero. This ensures correct calculation of degrees of freedom also in cases where the metabolite residue at time zero is greater zero.</p></li>
+<li><p><code><a href="../reference/plot.mkinfit.html">plot.mkinfit()</a></code>: Avoid a warning message about only using the first component of ylim that occurred when ylim was specified explicitly</p></li>
+</ul></div>
+<div id="minor-changes-7" class="section level2">
+<h2>Minor changes</h2>
+<ul><li><p>The formatting of differential equations in the summary was improved by wrapping overly long lines</p></li>
+<li><p>The FOCUS_Z vignette was rebuilt with the above improvement and using a width of 70 to avoid output outside of the grey area</p></li>
+<li><p><code><a href="../reference/summary.mkinfit.html">print.summary.mkinfit()</a></code>: Avoid a warning that occurred when gmkin showed summaries ofinitial fits without iterations</p></li>
+<li><p><code><a href="../reference/mkinfit.html">mkinfit()</a></code>: Avoid a warning that occurred when summarising a fit that was performed with maxitmodFit = 0 as done in gmkin for configuring new fits.</p></li>
+</ul></div>
+</div>
+ <div id="mkin-0.9-32-2014-07-24" class="section level1">
+<h1>mkin 0.9-32 (2014-07-24)</h1>
+<div id="new-features-3" class="section level2">
+<h2>New features</h2>
+<ul><li><p>The number of degrees of freedom is difficult to define in the case of ilr transformation of formation fractions. Now for each source compartment the number of ilr parameters (=number of optimised parameters) is divided by the number of pathways to metabolites (=number of affected data series) which leads to fractional degrees of freedom in some cases.</p></li>
+<li><p>The default for the initial value for the first state value is now taken from the mean of the observations at time zero, if available.</p></li>
+<li><p>The kinetic model can alternatively be specified with a shorthand name for parent only degradation models, e.g. <code>SFO</code>, or <code>DFOP</code>.</p></li>
+<li><p>Optimisation method, number of model evaluations and time elapsed during optimisation are given in the summary of mkinfit objects.</p></li>
+<li><p>The maximum number of iterations in the optimisation algorithm can be specified using the argument <code>maxit.modFit</code> to the mkinfit function.</p></li>
+<li><p>mkinfit gives a warning when the fit does not converge (does not apply to SANN method). This warning is included in the summary.</p></li>
+</ul></div>
+<div id="bug-fixes-8" class="section level2">
+<h2>Bug fixes</h2>
+<ul><li><p>Avoid plotting an artifical 0 residual at time zero in <code>mkinresplot</code></p></li>
+<li><p>In the determination of the degrees of freedom in <code>mkinerrmin</code>, formation fractions were accounted for multiple times in the case of parallel formation of metabolites. See the new feature described above for the solution.</p></li>
+<li><p><code>transform_rates=FALSE</code> in <code>mkinfit</code> now also works for FOMC and HS models.</p></li>
+<li><p>Initial values for formation fractions were not set in all cases.</p></li>
+<li><p>No warning was given when the fit did not converge when a method other than the default Levenberg-Marquardt method <code>Marq</code> was used.</p></li>
+</ul></div>
+<div id="minor-changes-8" class="section level2">
+<h2>Minor changes</h2>
+<ul><li><p>Vignettes were rebuilt to reflect the changes in the summary method.</p></li>
+<li><p>Algorithm <code>Pseudo</code> was excluded because it needs user-defined parameter limits which are not supported.</p></li>
+<li><p>Algorithm <code>Newton</code> was excluded because of its different way to specify the maximum number of iterations and because it does not appear to provide additional benefits.</p></li>
+</ul></div>
+</div>
+ <div id="mkin-0.9-31-2014-07-14" class="section level1">
+<h1>mkin 0.9-31 (2014-07-14)</h1>
+<div id="bug-fixes-9" class="section level2">
+<h2>Bug fixes</h2>
+<ul><li>The internal renaming of optimised parameters in Version 0.9-30 led to errors in the determination of the degrees of freedom for the chi2 error level calulations in <code><a href="../reference/mkinerrmin.html">mkinerrmin()</a></code> used by the summary function.</li>
+</ul></div>
+</div>
+ <div id="mkin-0.9-30-2014-07-11" class="section level1">
+<h1>mkin 0.9-30 (2014-07-11)</h1>
+<div id="new-features-4" class="section level2">
+<h2>New features</h2>
+<ul><li>It is now possible to use formation fractions in combination with turning off the sink in <code><a href="../reference/mkinmod.html">mkinmod()</a></code>.</li>
+</ul></div>
+<div id="major-changes-5" class="section level2">
+<h2>Major changes</h2>
+<ul><li><p>The original and the transformed parameters now have different names (e.g. <code>k_parent</code> and <code>log_k_parent</code>. They also differ in how many they are when we have formation fractions but no pathway to sink.</p></li>
+<li><p>The order of some of the information blocks in <code>print.summary.mkinfit.R()</code> has been ordered in a more logical way.</p></li>
+</ul></div>
+<div id="minor-changes-9" class="section level2">
+<h2>Minor changes</h2>
+<ul><li><p>The vignette FOCUS_Z has been simplified to use formation fractions with turning off the sink, and slightly amended to use the new versions of DT50 values calculated since mkin 0.9-29.</p></li>
+<li><p>All vignettes have been rebuilt so they reflect all changes.</p></li>
+<li><p>The ChangeLog was renamed to NEWS.md and the entries were converted to markdown syntax compatible with the <code>tools::news()</code> function built into R.</p></li>
+<li><p>The test suite was overhauled. Tests of the DFOP and SFORB models with dataset FOCUS_2006_A were removed, as they were too much dependent on the optimisation algorithm and/or starting parameters, because the dataset is SFO (compare kinfit vignette).</p></li>
+<li><p>Also, the Schaefer complex case can now be fitted using formation fractions, and with the ‘Port’ optimisation method we also fit A2 in the same way as published in the Piacenza paper.</p></li>
+<li><p>Some more checks were introduced to <code><a href="../reference/mkinfit.html">mkinfit()</a></code>, leading to warnings or stopping execution if unsupported combinations of methods and parameters are requested.</p></li>
+</ul></div>
+</div>
+ <div id="mkin-0.9-29-2014-06-27" class="section level1">
+<h1>mkin 0.9-29 (2014-06-27)</h1>
+<ul><li><p>R/mkinresplot.R: Make it possible to specify <code>xlim</code></p></li>
+<li><p>R/geometric_mean.R, man/geometric_mean.Rd: Add geometric mean function</p></li>
+<li><p>R/endpoints.R, man/endpoints.Rd: Calculate additional (pseudo)-DT50 values for FOMC, DFOP, HS and SFORB. Avoid calculation of formation fractions from rate constants when they are directly fitted</p></li>
+</ul></div>
+ <div id="mkin-0.9-28-2014-05-20" class="section level1">
+<h1>mkin 0.9-28 (2014-05-20)</h1>
+<ul><li><p>Do not backtransform confidence intervals for formation fractions if more than one compound is formed, as such parameters only define the pathways as a set</p></li>
+<li><p>Add historical remarks and some background to the main package vignette</p></li>
+<li><p>Correct ‘isotropic’ into ‘isometric’ for the ilr transformation</p></li>
+</ul></div>
+ <div id="mkin-0.9-27-2014-05-10" class="section level1">
+<h1>mkin 0.9-27 (2014-05-10)</h1>
+<ul><li><p>Fork the GUI into a separate package <a href="http://github.com/jranke/gmkin">gmkin</a></p></li>
+<li><p>DESCRIPTION, NAMESPACE, TODO: Adapt and add copyright information</p></li>
+<li><p>Remove files belonging to the GUI</p></li>
+<li><p>Possibility to fit without parameter transformations, using bounds as implemented in FME</p></li>
+<li><p>Add McCall 2,4,5-T dataset</p></li>
+<li><p>Enable selection of observed variables in plotting</p></li>
+<li><p>Add possibility to show residual plot in <code>plot.mkinfit</code></p></li>
+<li><p>R/mkinparplot.R, man/mkinparplot.Rd: plot parameters with confidence intervals</p></li>
+<li><p>Change vignette format from Sweave to knitr</p></li>
+<li><p>Split examples vignette to FOCUS_L and FOCUS_Z</p></li>
+<li><p>Remove warning about constant formation fractions in mkinmod as it was based on a misconception</p></li>
+<li><p>Restrict the unit test with the Schaefer data to parent and primary metabolites as formation fraction and DT50 for A2 are higly correlated and passing the test is platform dependent. For example, the test fails in 1 out of 14 platforms on CRAN as of today.</p></li>
+<li><p>Add Eurofins Regulatory AG copyright notices</p></li>
+<li><p>Import FME and deSolve instead of depending on them to have clean startup</p></li>
+<li><p>Add a starter function for the GUI: <code>gmkin()</code></p></li>
+<li><p>Change the format of the workspace files of gmkin so they can be distributed and documented in the package</p></li>
+<li><p>Add gmkin workspace datasets FOCUS_2006_gmkin and FOCUS_2006_Z_gmkin</p></li>
+</ul></div>
+ <div id="mkin-0.9-24-2013-11-06" class="section level1">
+<h1>mkin 0.9-24 (2013-11-06)</h1>
+<ul><li><p>Bugfix re-enabling the fixing of any combination of initial values for state variables</p></li>
+<li><p>Default values for kinetic rate constants are not all 0.1 any more but are “salted” with a small increment to avoid numeric artefacts with the eigenvalue based solutions</p></li>
+<li><p>Backtransform fixed ODE parameters for the summary</p></li>
+</ul></div>
+ <div id="mkin-0.9-22-2013-10-26" class="section level1">
+<h1>mkin 0.9-22 (2013-10-26)</h1>
+<ul><li><p>Get rid of the optimisation step in <code>mkinerrmin</code> - this was unnecessary. Thanks to KinGUII for the inspiration - actually this is equation 6-2 in FOCUS kinetics p. 91 that I had overlooked originally</p></li>
+<li><p>Fix <code>plot.mkinfit</code> as it passed graphical arguments like main to the solver</p></li>
+<li><p>Do not use <code>plot=TRUE</code> in <code><a href="../reference/mkinfit.html">mkinfit()</a></code> example</p></li>
+<li><p>The first successful fits in the not so simple GUI</p></li>
+<li><p>Fix iteratively reweighted least squares for the case of many metabolites</p></li>
+<li><p>Unify naming of initial values of state variables</p></li>
+<li><p>Unify naming in dataframes of optimised and fixed parameters in the summary</p></li>
+<li><p>Show the weighting method for residuals in the summary</p></li>
+<li><p>Correct the output of the data in the case of manual weighting</p></li>
+<li><p>Implement IRLS assuming different variances for observed variables</p></li>
+<li><p>Do not use 0 values at time zero for chi2 error level calculations. This is the way it is done in KinGUII and it makes sense. It does impact the chi2 error levels in the output. Generally they seem to be lower for metabolites now, presumably because the mean of the observed values is higher</p></li>
+</ul><p>For a detailed list of changes to the mkin source please consult the commit history on <a href="http://github.com/jranke/mkin" class="uri">http://github.com/jranke/mkin</a></p>
+</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="#mkin-0.9.45">0.9.45</a></li>
+ <li><a href="#mkin-0.9.44-2016-06-29">0.9.44</a></li>
+ <li><a href="#mkin-0.9.43-2016-06-28">0.9.43</a></li>
+ <li><a href="#mkin-0.9.42-2016-03-25">0.9.42</a></li>
+ <li><a href="#mkin-0.9-41-2015-11-09">0.9</a></li>
+ <li><a href="#mkin-0.9-40-2015-07-21">0.9</a></li>
+ <li><a href="#mkin-0.9-39-2015-06-26">0.9</a></li>
+ <li><a href="#mkin-0.9-38-2015-06-24">0.9</a></li>
+ <li><a href="#mkin-0.9-36-2015-06-21">0.9</a></li>
+ <li><a href="#mkin-0.9-35-2015-05-15">0.9</a></li>
+ <li><a href="#mkin-0.9-34-2014-11-22">0.9</a></li>
+ <li><a href="#mkin-0.9-33-2014-10-22">0.9</a></li>
+ <li><a href="#mkin-0.9-32-2014-07-24">0.9</a></li>
+ <li><a href="#mkin-0.9-31-2014-07-14">0.9</a></li>
+ <li><a href="#mkin-0.9-30-2014-07-11">0.9</a></li>
+ <li><a href="#mkin-0.9-29-2014-06-27">0.9</a></li>
+ <li><a href="#mkin-0.9-28-2014-05-20">0.9</a></li>
+ <li><a href="#mkin-0.9-27-2014-05-10">0.9</a></li>
+ <li><a href="#mkin-0.9-24-2013-11-06">0.9</a></li>
+ <li><a href="#mkin-0.9-22-2013-10-26">0.9</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/pkgdown.css b/docs/pkgdown.css
new file mode 100644
index 00000000..2edd2759
--- /dev/null
+++ b/docs/pkgdown.css
@@ -0,0 +1,59 @@
+body {
+ position: relative;
+}
+
+.icon img {
+ float: right;
+ border: 1px solid #ccc;
+}
+.index .internal {display: none;}
+ul.index li {margin-bottom: 0.5em; clear: both;}
+
+footer {
+ margin-top: 45px;
+ padding: 35px 0 36px;
+ border-top: 1px solid #e5e5e5;
+}
+footer p {
+ margin-bottom: 0;
+ color: #555;
+}
+
+/* Fixes for fixed navbar --------------------------*/
+
+body {
+ position: relative;
+ padding-top: 60px;
+}
+
+.section h1, .section h2, .section h3, .section h4 {
+ padding-top: 60px;
+ margin-top: -60px;
+}
+
+/* Table of contents --------------------------*/
+
+#tocnav h2 {
+ margin-top: 0;
+ font-size: 1.5em;
+}
+
+
+/* Syntax highlighting ---------------------------------------------------- */
+
+.fl,.number {color:rgb(21,20,181);}
+.fu,.functioncall {color:#264D66 ;}
+.ch,.st,.string {color:#375D81 ;}
+.kw,.keyword {font-weight:bolder ;color:black;}
+.argument {color:#264D66 ;}
+.co,.comment {color: #333;}
+.formalargs {color: #264D66;}
+.eqformalargs {color:#264D66;}
+.slot {font-style:italic;}
+.symbol {color:black ;}
+.prompt {color:black ;}
+
+pre img {
+ background-color: #fff;
+ display: block;
+}
diff --git a/docs/pkgdown.js b/docs/pkgdown.js
new file mode 100644
index 00000000..ded9e7df
--- /dev/null
+++ b/docs/pkgdown.js
@@ -0,0 +1,13 @@
+$(function() {
+
+ $('#tocnav').affix({
+ offset: {
+ top: $('#tocnav').offset().top - 80
+ }
+ });
+ $('body').scrollspy({
+ target: '#tocnav',
+ offset: 80
+ });
+
+});
diff --git a/docs/reference/DFOP.solution.html b/docs/reference/DFOP.solution.html
new file mode 100644
index 00000000..3422c206
--- /dev/null
+++ b/docs/reference/DFOP.solution.html
@@ -0,0 +1,132 @@
+<!-- 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>DFOP.solution. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>Function describing decline from a defined starting value using the sum
+ of two exponential decline functions.</p>
+
+
+ <pre><span class='fu'>DFOP.solution</span>(<span class='no'>t</span>, <span class='no'>parent.0</span>, <span class='no'>k1</span>, <span class='no'>k2</span>, <span class='no'>g</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>t</dt>
+ <dd> Time. </dd>
+ <dt>parent.0</dt>
+ <dd> Starting value for the response variable at time zero. </dd>
+ <dt>k1</dt>
+ <dd> First kinetic constant. </dd>
+ <dt>k2</dt>
+ <dd> Second kinetic constant. </dd>
+ <dt>g</dt>
+ <dd> Fraction of the starting value declining according to the
+ first kinetic constant.
+ </dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>The value of the response variable at time <code>t</code>.</p>
+ </div>
+
+ <div class="References">
+ <h2>References</h2>
+
+ <p>FOCUS (2006) &#8220;Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration&#8221; Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ <a href = 'http://focus.jrc.ec.europa.eu/dk'>http://focus.jrc.ec.europa.eu/dk</a></p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'> <span class='fu'>plot</span>(<span class='kw'>function</span>(<span class='no'>x</span>) <span class='fu'>DFOP.solution</span>(<span class='no'>x</span>, <span class='fl'>100</span>, <span class='fl'>5</span>, <span class='fl'>0.5</span>, <span class='fl'>0.3</span>), <span class='fl'>0</span>, <span class='fl'>4</span>, <span class='kw'>ylim</span><span class='kw'>=</span><span class='fu'>c</span>(<span class='fl'>0</span>,<span class='fl'>100</span>))</div><img src='unknown-2.png' alt='' width='540' height='400' /></pre>
+ </div>
+ <div class="col-md-3">
+ </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/reference/Extract.mmkin.html b/docs/reference/Extract.mmkin.html
new file mode 100644
index 00000000..b811eb95
--- /dev/null
+++ b/docs/reference/Extract.mmkin.html
@@ -0,0 +1,1192 @@
+<!-- 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>[.mmkin. 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>Subsetting method for mmkin objects</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>Subsetting method for mmkin objects.</p>
+
+
+ <pre># S3 method for mmkin
+[(x, i, j, ..., drop = FALSE)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>x</dt>
+ <dd>An <code>mmkin object</code></dd>
+ <dt>i</dt>
+ <dd>Row index selecting the fits for specific models</dd>
+ <dt>j</dt>
+ <dd>Column index selecting the fits to specific datasets</dd>
+ <dt>...</dt>
+ <dd>Not used, only there to satisfy the generic method definition</dd>
+ <dt>drop</dt>
+ <dd>If FALSE, the method always returns an mmkin object, otherwise either
+ a list of mkinfit objects or a single mkinfit object.</dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>An object of class <code>mmkin</code>.</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'> <span class='co'># Only use one core, to pass R CMD check --as-cran</span>
+ <span class='no'>fits</span> <span class='kw'>&lt;-</span> <span class='fu'>mmkin</span>(<span class='fu'>c</span>(<span class='st'>"SFO"</span>, <span class='st'>"FOMC"</span>), <span class='fu'>list</span>(<span class='kw'>B</span> <span class='kw'>=</span> <span class='no'>FOCUS_2006_B</span>, <span class='kw'>C</span> <span class='kw'>=</span> <span class='no'>FOCUS_2006_C</span>),
+ <span class='kw'>cores</span> <span class='kw'>=</span> <span class='fl'>1</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
+ <span class='no'>fits</span>[<span class='st'>"FOMC"</span>, ]</div><div class='output co'>#&gt; dataset
+#&gt; model B C
+#&gt; FOMC List,42 List,42
+#&gt; attr(,&quot;class&quot;)
+#&gt; [1] &quot;mmkin&quot;
+#&gt; </div><div class='input'> <span class='no'>fits</span>[, <span class='st'>"B"</span>]</div><div class='output co'>#&gt; dataset
+#&gt; model B
+#&gt; SFO List,42
+#&gt; FOMC List,42
+#&gt; attr(,&quot;class&quot;)
+#&gt; [1] &quot;mmkin&quot;
+#&gt; </div><div class='input'> <span class='no'>fits</span>[, <span class='st'>"B"</span>, <span class='kw'>drop</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>]$<span class='no'>FOMC</span></div><div class='output co'>#&gt; $par
+#&gt; parent_0 log_alpha log_beta
+#&gt; 99.666193 2.549849 5.050586
+#&gt;
+#&gt; $ssr
+#&gt; [1] 28.58291
+#&gt;
+#&gt; $convergence
+#&gt; [1] 0
+#&gt;
+#&gt; $iterations
+#&gt; [1] 21
+#&gt;
+#&gt; $evaluations
+#&gt; function gradient
+#&gt; 25 78
+#&gt;
+#&gt; $counts
+#&gt; [1] &quot;both X-convergence and relative convergence (5)&quot;
+#&gt;
+#&gt; $hessian
+#&gt; parent_0 log_alpha log_beta
+#&gt; parent_0 4.123033 -95.69983 93.17699
+#&gt; log_alpha -95.699832 6618.85833 -6352.46648
+#&gt; log_beta 93.176993 -6352.46648 6101.23483
+#&gt;
+#&gt; $residuals
+#&gt; parent parent parent parent parent parent
+#&gt; 1.046192647 -3.322396479 3.655156669 -1.705316770 0.406306255 -0.123734689
+#&gt; parent parent
+#&gt; -0.036886982 -0.006240458
+#&gt;
+#&gt; $ms
+#&gt; [1] 3.572863
+#&gt;
+#&gt; $var_ms
+#&gt; parent
+#&gt; 3.572863
+#&gt;
+#&gt; $var_ms_unscaled
+#&gt; parent
+#&gt; 3.572863
+#&gt;
+#&gt; $var_ms_unweighted
+#&gt; parent
+#&gt; 3.572863
+#&gt;
+#&gt; $rank
+#&gt; [1] 3
+#&gt;
+#&gt; $df.residual
+#&gt; [1] 5
+#&gt;
+#&gt; $solution_type
+#&gt; [1] &quot;analytical&quot;
+#&gt;
+#&gt; $transform_rates
+#&gt; [1] TRUE
+#&gt;
+#&gt; $transform_fractions
+#&gt; [1] TRUE
+#&gt;
+#&gt; $method.modFit
+#&gt; [1] &quot;Port&quot;
+#&gt;
+#&gt; $maxit.modFit
+#&gt; [1] &quot;auto&quot;
+#&gt;
+#&gt; $calls
+#&gt; [1] 111
+#&gt;
+#&gt; $time
+#&gt; user system elapsed
+#&gt; 0.256 0.000 0.257
+#&gt;
+#&gt; $mkinmod
+#&gt; &lt;mkinmod&gt; model generated with
+#&gt; Use of formation fractions $use_of_ff: min
+#&gt; Specification $spec:
+#&gt; $parent
+#&gt; $type: FOMC; $sink: TRUE
+#&gt;
+#&gt; $observed
+#&gt; name time value
+#&gt; 1 parent 0 98.62
+#&gt; 2 parent 3 81.43
+#&gt; 3 parent 7 53.18
+#&gt; 4 parent 14 34.89
+#&gt; 5 parent 30 10.09
+#&gt; 6 parent 62 1.50
+#&gt; 7 parent 90 0.33
+#&gt; 8 parent 118 0.08
+#&gt;
+#&gt; $obs_vars
+#&gt; [1] &quot;parent&quot;
+#&gt;
+#&gt; $predicted
+#&gt; name time value
+#&gt; 1 parent 0.000000 99.66619265
+#&gt; 2 parent 1.191919 90.41690342
+#&gt; 3 parent 2.383838 82.08630014
+#&gt; 4 parent 3.000000 78.10760352
+#&gt; 5 parent 3.575758 74.57722848
+#&gt; 6 parent 4.767677 67.80342415
+#&gt; 7 parent 5.959596 61.68822425
+#&gt; 8 parent 7.000000 56.83515667
+#&gt; 9 parent 7.151515 56.16343898
+#&gt; 10 parent 8.343434 51.16836285
+#&gt; 11 parent 9.535354 46.64890734
+#&gt; 12 parent 10.727273 42.55683931
+#&gt; 13 parent 11.919192 38.84911158
+#&gt; 14 parent 13.111111 35.48727414
+#&gt; 15 parent 14.000000 33.18468323
+#&gt; 16 parent 14.303030 32.43695565
+#&gt; 17 parent 15.494949 29.66740651
+#&gt; 18 parent 16.686869 27.15109578
+#&gt; 19 parent 17.878788 24.86335532
+#&gt; 20 parent 19.070707 22.78206538
+#&gt; 21 parent 20.262626 20.88737647
+#&gt; 22 parent 21.454545 19.16146324
+#&gt; 23 parent 22.646465 17.58830644
+#&gt; 24 parent 23.838384 16.15349953
+#&gt; 25 parent 25.030303 14.84407724
+#&gt; 26 parent 26.222222 13.64836315
+#&gt; 27 parent 27.414141 12.55583436
+#&gt; 28 parent 28.606061 11.55700107
+#&gt; 29 parent 29.797980 10.64329940
+#&gt; 30 parent 30.000000 10.49630626
+#&gt; 31 parent 30.989899 9.80699593
+#&gt; 32 parent 32.181818 9.04110261
+#&gt; 33 parent 33.373737 8.33930082
+#&gt; 34 parent 34.565657 7.69587362
+#&gt; 35 parent 35.757576 7.10564515
+#&gt; 36 parent 36.949495 6.56392657
+#&gt; 37 parent 38.141414 6.06646759
+#&gt; 38 parent 39.333333 5.60941311
+#&gt; 39 parent 40.525253 5.18926438
+#&gt; 40 parent 41.717172 4.80284421
+#&gt; 41 parent 42.909091 4.44726569
+#&gt; 42 parent 44.101010 4.11990420
+#&gt; 43 parent 45.292929 3.81837216
+#&gt; 44 parent 46.484848 3.54049644
+#&gt; 45 parent 47.676768 3.28429799
+#&gt; 46 parent 48.868687 3.04797350
+#&gt; 47 parent 50.060606 2.82987892
+#&gt; 48 parent 51.252525 2.62851456
+#&gt; 49 parent 52.444444 2.44251172
+#&gt; 50 parent 53.636364 2.27062056
+#&gt; 51 parent 54.828283 2.11169922
+#&gt; 52 parent 56.020202 1.96470393
+#&gt; 53 parent 57.212121 1.82868009
+#&gt; 54 parent 58.404040 1.70275424
+#&gt; 55 parent 59.595960 1.58612677
+#&gt; 56 parent 60.787879 1.47806529
+#&gt; 57 parent 61.979798 1.37789865
+#&gt; 58 parent 62.000000 1.37626531
+#&gt; 59 parent 63.171717 1.28501157
+#&gt; 60 parent 64.363636 1.19883967
+#&gt; 61 parent 65.555556 1.11886504
+#&gt; 62 parent 66.747475 1.04461220
+#&gt; 63 parent 67.939394 0.97564441
+#&gt; 64 parent 69.131313 0.91156031
+#&gt; 65 parent 70.323232 0.85199096
+#&gt; 66 parent 71.515152 0.79659697
+#&gt; 67 parent 72.707071 0.74506609
+#&gt; 68 parent 73.898990 0.69711084
+#&gt; 69 parent 75.090909 0.65246649
+#&gt; 70 parent 76.282828 0.61088912
+#&gt; 71 parent 77.474747 0.57215389
+#&gt; 72 parent 78.666667 0.53605348
+#&gt; 73 parent 79.858586 0.50239663
+#&gt; 74 parent 81.050505 0.47100683
+#&gt; 75 parent 82.242424 0.44172111
+#&gt; 76 parent 83.434343 0.41438896
+#&gt; 77 parent 84.626263 0.38887128
+#&gt; 78 parent 85.818182 0.36503953
+#&gt; 79 parent 87.010101 0.34277481
+#&gt; 80 parent 88.202020 0.32196716
+#&gt; 81 parent 89.393939 0.30251479
+#&gt; 82 parent 90.000000 0.29311302
+#&gt; 83 parent 90.585859 0.28432347
+#&gt; 84 parent 91.777778 0.26730596
+#&gt; 85 parent 92.969697 0.25138141
+#&gt; 86 parent 94.161616 0.23647487
+#&gt; 87 parent 95.353535 0.22251689
+#&gt; 88 parent 96.545455 0.20944302
+#&gt; 89 parent 97.737374 0.19719349
+#&gt; 90 parent 98.929293 0.18571281
+#&gt; 91 parent 100.121212 0.17494947
+#&gt; 92 parent 101.313131 0.16485560
+#&gt; 93 parent 102.505051 0.15538676
+#&gt; 94 parent 103.696970 0.14650163
+#&gt; 95 parent 104.888889 0.13816179
+#&gt; 96 parent 106.080808 0.13033150
+#&gt; 97 parent 107.272727 0.12297753
+#&gt; 98 parent 108.464646 0.11606895
+#&gt; 99 parent 109.656566 0.10957695
+#&gt; 100 parent 110.848485 0.10347470
+#&gt; 101 parent 112.040404 0.09773723
+#&gt; 102 parent 113.232323 0.09234125
+#&gt; 103 parent 114.424242 0.08726506
+#&gt; 104 parent 115.616162 0.08248842
+#&gt; 105 parent 116.808081 0.07799245
+#&gt; 106 parent 118.000000 0.07375954
+#&gt;
+#&gt; $cost
+#&gt; function (P)
+#&gt; {
+#&gt; assign(&quot;calls&quot;, calls + 1, inherits = TRUE)
+#&gt; if (trace_parms)
+#&gt; cat(P, &quot;\n&quot;)
+#&gt; if (length(state.ini.optim) &gt; 0) {
+#&gt; odeini &lt;- c(P[1:length(state.ini.optim)], state.ini.fixed)
+#&gt; names(odeini) &lt;- c(state.ini.optim.boxnames, state.ini.fixed.boxnames)
+#&gt; }
+#&gt; else {
+#&gt; odeini &lt;- state.ini.fixed
+#&gt; names(odeini) &lt;- state.ini.fixed.boxnames
+#&gt; }
+#&gt; odeparms &lt;- c(P[(length(state.ini.optim) + 1):length(P)],
+#&gt; transparms.fixed)
+#&gt; parms &lt;- backtransform_odeparms(odeparms, mkinmod, transform_rates = transform_rates,
+#&gt; transform_fractions = transform_fractions)
+#&gt; out &lt;- mkinpredict(mkinmod, parms, odeini, outtimes, solution_type = solution_type,
+#&gt; use_compiled = use_compiled, method.ode = method.ode,
+#&gt; atol = atol, rtol = rtol, ...)
+#&gt; assign(&quot;out_predicted&quot;, out, inherits = TRUE)
+#&gt; mC &lt;- modCost(out, observed, y = &quot;value&quot;, err = err, weight = weight,
+#&gt; scaleVar = scaleVar)
+#&gt; if (mC$model &lt; cost.old) {
+#&gt; if (!quiet)
+#&gt; cat(&quot;Model cost at call &quot;, calls, &quot;: &quot;, mC$model,
+#&gt; &quot;\n&quot;)
+#&gt; if (plot) {
+#&gt; outtimes_plot = seq(min(observed$time), max(observed$time),
+#&gt; length.out = 100)
+#&gt; out_plot &lt;- mkinpredict(mkinmod, parms, odeini, outtimes_plot,
+#&gt; solution_type = solution_type, use_compiled = use_compiled,
+#&gt; method.ode = method.ode, atol = atol, rtol = rtol,
+#&gt; ...)
+#&gt; plot(0, type = &quot;n&quot;, xlim = range(observed$time),
+#&gt; ylim = c(0, max(observed$value, na.rm = TRUE)),
+#&gt; xlab = &quot;Time&quot;, ylab = &quot;Observed&quot;)
+#&gt; col_obs &lt;- pch_obs &lt;- 1:length(obs_vars)
+#&gt; lty_obs &lt;- rep(1, length(obs_vars))
+#&gt; names(col_obs) &lt;- names(pch_obs) &lt;- names(lty_obs) &lt;- obs_vars
+#&gt; for (obs_var in obs_vars) {
+#&gt; points(subset(observed, name == obs_var, c(time,
+#&gt; value)), pch = pch_obs[obs_var], col = col_obs[obs_var])
+#&gt; }
+#&gt; matlines(out_plot$time, out_plot[-1], col = col_obs,
+#&gt; lty = lty_obs)
+#&gt; legend(&quot;topright&quot;, inset = c(0.05, 0.05), legend = obs_vars,
+#&gt; col = col_obs, pch = pch_obs, lty = 1:length(pch_obs))
+#&gt; }
+#&gt; assign(&quot;cost.old&quot;, mC$model, inherits = TRUE)
+#&gt; }
+#&gt; return(mC)
+#&gt; }
+#&gt; &lt;environment: 0x27fc328&gt;
+#&gt;
+#&gt; $cost_notrans
+#&gt; function (P)
+#&gt; {
+#&gt; if (length(state.ini.optim) &gt; 0) {
+#&gt; odeini &lt;- c(P[1:length(state.ini.optim)], state.ini.fixed)
+#&gt; names(odeini) &lt;- c(state.ini.optim.boxnames, state.ini.fixed.boxnames)
+#&gt; }
+#&gt; else {
+#&gt; odeini &lt;- state.ini.fixed
+#&gt; names(odeini) &lt;- state.ini.fixed.boxnames
+#&gt; }
+#&gt; odeparms &lt;- c(P[(length(state.ini.optim) + 1):length(P)],
+#&gt; parms.fixed)
+#&gt; out &lt;- mkinpredict(mkinmod, odeparms, odeini, outtimes, solution_type = solution_type,
+#&gt; use_compiled = use_compiled, method.ode = method.ode,
+#&gt; atol = atol, rtol = rtol, ...)
+#&gt; mC &lt;- modCost(out, observed, y = &quot;value&quot;, err = err, weight = weight,
+#&gt; scaleVar = scaleVar)
+#&gt; return(mC)
+#&gt; }
+#&gt; &lt;environment: 0x27fc328&gt;
+#&gt;
+#&gt; $hessian_notrans
+#&gt; parent_0 alpha beta
+#&gt; parent_0 4.1230329 -7.473531 0.5968527
+#&gt; alpha -7.4735307 40.365690 -3.1777189
+#&gt; beta 0.5968527 -3.177719 0.2503425
+#&gt;
+#&gt; $start
+#&gt; value type
+#&gt; parent_0 98.62 state
+#&gt; alpha 1.00 deparm
+#&gt; beta 10.00 deparm
+#&gt;
+#&gt; $start_transformed
+#&gt; value lower upper
+#&gt; parent_0 98.620000 -Inf Inf
+#&gt; log_alpha 0.000000 -Inf Inf
+#&gt; log_beta 2.302585 -Inf Inf
+#&gt;
+#&gt; $fixed
+#&gt; [1] value type
+#&gt; &lt;0 rows&gt; (or 0-length row.names)
+#&gt;
+#&gt; $data
+#&gt; time variable observed predicted residual
+#&gt; 1 0 parent 98.62 99.66619265 -1.046192647
+#&gt; 2 3 parent 81.43 78.10760352 3.322396479
+#&gt; 3 7 parent 53.18 56.83515667 -3.655156669
+#&gt; 4 14 parent 34.89 33.18468323 1.705316770
+#&gt; 5 30 parent 10.09 10.49630626 -0.406306255
+#&gt; 6 62 parent 1.50 1.37626531 0.123734689
+#&gt; 7 90 parent 0.33 0.29311302 0.036886982
+#&gt; 8 118 parent 0.08 0.07375954 0.006240458
+#&gt;
+#&gt; $atol
+#&gt; [1] 1e-08
+#&gt;
+#&gt; $rtol
+#&gt; [1] 1e-10
+#&gt;
+#&gt; $weight.ini
+#&gt; [1] &quot;none&quot;
+#&gt;
+#&gt; $reweight.tol
+#&gt; [1] 1e-08
+#&gt;
+#&gt; $reweight.max.iter
+#&gt; [1] 10
+#&gt;
+#&gt; $bparms.optim
+#&gt; parent_0 alpha beta
+#&gt; 99.66619 12.80517 156.11390
+#&gt;
+#&gt; $bparms.fixed
+#&gt; numeric(0)
+#&gt;
+#&gt; $bparms.ode
+#&gt; alpha beta
+#&gt; 12.80517 156.11390
+#&gt;
+#&gt; $bparms.state
+#&gt; parent
+#&gt; 99.66619
+#&gt;
+#&gt; $date
+#&gt; [1] &quot;Thu Oct 6 09:17:52 2016&quot;
+#&gt;
+#&gt; attr(,&quot;class&quot;)
+#&gt; [1] &quot;mkinfit&quot; &quot;modFit&quot;
+#&gt; </div><div class='input'> <span class='no'>fits</span>[<span class='st'>"SFO"</span>, <span class='st'>"B"</span>]</div><div class='output co'>#&gt; dataset
+#&gt; model B
+#&gt; SFO List,42
+#&gt; attr(,&quot;class&quot;)
+#&gt; [1] &quot;mmkin&quot;
+#&gt; </div><div class='input'> <span class='no'>fits</span><span class='kw'>[[</span><span class='st'>"SFO"</span>, <span class='st'>"B"</span>]] <span class='co'># This is equivalent to</span></div><div class='output co'>#&gt; $par
+#&gt; parent_0 log_k_parent_sink
+#&gt; 99.174072 -2.549028
+#&gt;
+#&gt; $ssr
+#&gt; [1] 30.65564
+#&gt;
+#&gt; $convergence
+#&gt; [1] 0
+#&gt;
+#&gt; $iterations
+#&gt; [1] 5
+#&gt;
+#&gt; $evaluations
+#&gt; function gradient
+#&gt; 8 15
+#&gt;
+#&gt; $counts
+#&gt; [1] &quot;relative convergence (4)&quot;
+#&gt;
+#&gt; $hessian
+#&gt; parent_0 log_k_parent_sink
+#&gt; parent_0 4.163631 -94.09343
+#&gt; log_k_parent_sink -94.093431 6311.34610
+#&gt;
+#&gt; $residuals
+#&gt; parent parent parent parent parent parent
+#&gt; 0.55407218 -2.98452128 4.20445742 -1.68599939 -0.58185357 -0.72033730
+#&gt; parent parent
+#&gt; -0.24260405 -0.07020339
+#&gt;
+#&gt; $ms
+#&gt; [1] 3.831956
+#&gt;
+#&gt; $var_ms
+#&gt; parent
+#&gt; 3.831956
+#&gt;
+#&gt; $var_ms_unscaled
+#&gt; parent
+#&gt; 3.831956
+#&gt;
+#&gt; $var_ms_unweighted
+#&gt; parent
+#&gt; 3.831956
+#&gt;
+#&gt; $rank
+#&gt; [1] 2
+#&gt;
+#&gt; $df.residual
+#&gt; [1] 6
+#&gt;
+#&gt; $solution_type
+#&gt; [1] &quot;analytical&quot;
+#&gt;
+#&gt; $transform_rates
+#&gt; [1] TRUE
+#&gt;
+#&gt; $transform_fractions
+#&gt; [1] TRUE
+#&gt;
+#&gt; $method.modFit
+#&gt; [1] &quot;Port&quot;
+#&gt;
+#&gt; $maxit.modFit
+#&gt; [1] &quot;auto&quot;
+#&gt;
+#&gt; $calls
+#&gt; [1] 29
+#&gt;
+#&gt; $time
+#&gt; user system elapsed
+#&gt; 0.068 0.000 0.068
+#&gt;
+#&gt; $mkinmod
+#&gt; &lt;mkinmod&gt; model generated with
+#&gt; Use of formation fractions $use_of_ff: min
+#&gt; Specification $spec:
+#&gt; $parent
+#&gt; $type: SFO; $sink: TRUE
+#&gt; Coefficient matrix $coefmat available
+#&gt;
+#&gt; $observed
+#&gt; name time value
+#&gt; 1 parent 0 98.62
+#&gt; 2 parent 3 81.43
+#&gt; 3 parent 7 53.18
+#&gt; 4 parent 14 34.89
+#&gt; 5 parent 30 10.09
+#&gt; 6 parent 62 1.50
+#&gt; 7 parent 90 0.33
+#&gt; 8 parent 118 0.08
+#&gt;
+#&gt; $obs_vars
+#&gt; [1] &quot;parent&quot;
+#&gt;
+#&gt; $predicted
+#&gt; name time value
+#&gt; 1 parent 0.000000 99.17407218
+#&gt; 2 parent 1.191919 90.35253561
+#&gt; 3 parent 2.383838 82.31567498
+#&gt; 4 parent 3.000000 78.44547872
+#&gt; 5 parent 3.575758 74.99369333
+#&gt; 6 parent 4.767677 68.32300215
+#&gt; 7 parent 5.959596 62.24566915
+#&gt; 8 parent 7.000000 57.38445742
+#&gt; 9 parent 7.151515 56.70891509
+#&gt; 10 parent 8.343434 51.66465547
+#&gt; 11 parent 9.535354 47.06908288
+#&gt; 12 parent 10.727273 42.88228661
+#&gt; 13 parent 11.919192 39.06790599
+#&gt; 14 parent 13.111111 35.59281463
+#&gt; 15 parent 14.000000 33.20400061
+#&gt; 16 parent 14.303030 32.42683275
+#&gt; 17 parent 15.494949 29.54246504
+#&gt; 18 parent 16.686869 26.91466193
+#&gt; 19 parent 17.878788 24.52060198
+#&gt; 20 parent 19.070707 22.33949373
+#&gt; 21 parent 20.262626 20.35239512
+#&gt; 22 parent 21.454545 18.54204899
+#&gt; 23 parent 22.646465 16.89273320
+#&gt; 24 parent 23.838384 15.39012410
+#&gt; 25 parent 25.030303 14.02117212
+#&gt; 26 parent 26.222222 12.77398846
+#&gt; 27 parent 27.414141 11.63774182
+#&gt; 28 parent 28.606061 10.60256435
+#&gt; 29 parent 29.797980 9.65946594
+#&gt; 30 parent 30.000000 9.50814643
+#&gt; 31 parent 30.989899 8.80025617
+#&gt; 32 parent 32.181818 8.01747313
+#&gt; 33 parent 33.373737 7.30431867
+#&gt; 34 parent 34.565657 6.65459931
+#&gt; 35 parent 35.757576 6.06267251
+#&gt; 36 parent 36.949495 5.52339762
+#&gt; 37 parent 38.141414 5.03209124
+#&gt; 38 parent 39.333333 4.58448658
+#&gt; 39 parent 40.525253 4.17669637
+#&gt; 40 parent 41.717172 3.80517911
+#&gt; 41 parent 42.909091 3.46670832
+#&gt; 42 parent 44.101010 3.15834451
+#&gt; 43 parent 45.292929 2.87740968
+#&gt; 44 parent 46.484848 2.62146400
+#&gt; 45 parent 47.676768 2.38828471
+#&gt; 46 parent 48.868687 2.17584671
+#&gt; 47 parent 50.060606 1.98230508
+#&gt; 48 parent 51.252525 1.80597899
+#&gt; 49 parent 52.444444 1.64533711
+#&gt; 50 parent 53.636364 1.49898432
+#&gt; 51 parent 54.828283 1.36564963
+#&gt; 52 parent 56.020202 1.24417505
+#&gt; 53 parent 57.212121 1.13350565
+#&gt; 54 parent 58.404040 1.03268029
+#&gt; 55 parent 59.595960 0.94082335
+#&gt; 56 parent 60.787879 0.85713708
+#&gt; 57 parent 61.979798 0.78089471
+#&gt; 58 parent 62.000000 0.77966270
+#&gt; 59 parent 63.171717 0.71143411
+#&gt; 60 parent 64.363636 0.64815202
+#&gt; 61 parent 65.555556 0.59049888
+#&gt; 62 parent 66.747475 0.53797399
+#&gt; 63 parent 67.939394 0.49012119
+#&gt; 64 parent 69.131313 0.44652489
+#&gt; 65 parent 70.323232 0.40680649
+#&gt; 66 parent 71.515152 0.37062104
+#&gt; 67 parent 72.707071 0.33765429
+#&gt; 68 parent 73.898990 0.30761993
+#&gt; 69 parent 75.090909 0.28025713
+#&gt; 70 parent 76.282828 0.25532825
+#&gt; 71 parent 77.474747 0.23261679
+#&gt; 72 parent 78.666667 0.21192552
+#&gt; 73 parent 79.858586 0.19307474
+#&gt; 74 parent 81.050505 0.17590074
+#&gt; 75 parent 82.242424 0.16025436
+#&gt; 76 parent 83.434343 0.14599973
+#&gt; 77 parent 84.626263 0.13301305
+#&gt; 78 parent 85.818182 0.12118154
+#&gt; 79 parent 87.010101 0.11040244
+#&gt; 80 parent 88.202020 0.10058214
+#&gt; 81 parent 89.393939 0.09163535
+#&gt; 82 parent 90.000000 0.08739595
+#&gt; 83 parent 90.585859 0.08348439
+#&gt; 84 parent 91.777778 0.07605845
+#&gt; 85 parent 92.969697 0.06929305
+#&gt; 86 parent 94.161616 0.06312943
+#&gt; 87 parent 95.353535 0.05751406
+#&gt; 88 parent 96.545455 0.05239819
+#&gt; 89 parent 97.737374 0.04773737
+#&gt; 90 parent 98.929293 0.04349113
+#&gt; 91 parent 100.121212 0.03962259
+#&gt; 92 parent 101.313131 0.03609816
+#&gt; 93 parent 102.505051 0.03288723
+#&gt; 94 parent 103.696970 0.02996191
+#&gt; 95 parent 104.888889 0.02729679
+#&gt; 96 parent 106.080808 0.02486874
+#&gt; 97 parent 107.272727 0.02265667
+#&gt; 98 parent 108.464646 0.02064136
+#&gt; 99 parent 109.656566 0.01880531
+#&gt; 100 parent 110.848485 0.01713257
+#&gt; 101 parent 112.040404 0.01560863
+#&gt; 102 parent 113.232323 0.01422024
+#&gt; 103 parent 114.424242 0.01295535
+#&gt; 104 parent 115.616162 0.01180297
+#&gt; 105 parent 116.808081 0.01075310
+#&gt; 106 parent 118.000000 0.00979661
+#&gt;
+#&gt; $cost
+#&gt; function (P)
+#&gt; {
+#&gt; assign(&quot;calls&quot;, calls + 1, inherits = TRUE)
+#&gt; if (trace_parms)
+#&gt; cat(P, &quot;\n&quot;)
+#&gt; if (length(state.ini.optim) &gt; 0) {
+#&gt; odeini &lt;- c(P[1:length(state.ini.optim)], state.ini.fixed)
+#&gt; names(odeini) &lt;- c(state.ini.optim.boxnames, state.ini.fixed.boxnames)
+#&gt; }
+#&gt; else {
+#&gt; odeini &lt;- state.ini.fixed
+#&gt; names(odeini) &lt;- state.ini.fixed.boxnames
+#&gt; }
+#&gt; odeparms &lt;- c(P[(length(state.ini.optim) + 1):length(P)],
+#&gt; transparms.fixed)
+#&gt; parms &lt;- backtransform_odeparms(odeparms, mkinmod, transform_rates = transform_rates,
+#&gt; transform_fractions = transform_fractions)
+#&gt; out &lt;- mkinpredict(mkinmod, parms, odeini, outtimes, solution_type = solution_type,
+#&gt; use_compiled = use_compiled, method.ode = method.ode,
+#&gt; atol = atol, rtol = rtol, ...)
+#&gt; assign(&quot;out_predicted&quot;, out, inherits = TRUE)
+#&gt; mC &lt;- modCost(out, observed, y = &quot;value&quot;, err = err, weight = weight,
+#&gt; scaleVar = scaleVar)
+#&gt; if (mC$model &lt; cost.old) {
+#&gt; if (!quiet)
+#&gt; cat(&quot;Model cost at call &quot;, calls, &quot;: &quot;, mC$model,
+#&gt; &quot;\n&quot;)
+#&gt; if (plot) {
+#&gt; outtimes_plot = seq(min(observed$time), max(observed$time),
+#&gt; length.out = 100)
+#&gt; out_plot &lt;- mkinpredict(mkinmod, parms, odeini, outtimes_plot,
+#&gt; solution_type = solution_type, use_compiled = use_compiled,
+#&gt; method.ode = method.ode, atol = atol, rtol = rtol,
+#&gt; ...)
+#&gt; plot(0, type = &quot;n&quot;, xlim = range(observed$time),
+#&gt; ylim = c(0, max(observed$value, na.rm = TRUE)),
+#&gt; xlab = &quot;Time&quot;, ylab = &quot;Observed&quot;)
+#&gt; col_obs &lt;- pch_obs &lt;- 1:length(obs_vars)
+#&gt; lty_obs &lt;- rep(1, length(obs_vars))
+#&gt; names(col_obs) &lt;- names(pch_obs) &lt;- names(lty_obs) &lt;- obs_vars
+#&gt; for (obs_var in obs_vars) {
+#&gt; points(subset(observed, name == obs_var, c(time,
+#&gt; value)), pch = pch_obs[obs_var], col = col_obs[obs_var])
+#&gt; }
+#&gt; matlines(out_plot$time, out_plot[-1], col = col_obs,
+#&gt; lty = lty_obs)
+#&gt; legend(&quot;topright&quot;, inset = c(0.05, 0.05), legend = obs_vars,
+#&gt; col = col_obs, pch = pch_obs, lty = 1:length(pch_obs))
+#&gt; }
+#&gt; assign(&quot;cost.old&quot;, mC$model, inherits = TRUE)
+#&gt; }
+#&gt; return(mC)
+#&gt; }
+#&gt; &lt;environment: 0x2e966b0&gt;
+#&gt;
+#&gt; $cost_notrans
+#&gt; function (P)
+#&gt; {
+#&gt; if (length(state.ini.optim) &gt; 0) {
+#&gt; odeini &lt;- c(P[1:length(state.ini.optim)], state.ini.fixed)
+#&gt; names(odeini) &lt;- c(state.ini.optim.boxnames, state.ini.fixed.boxnames)
+#&gt; }
+#&gt; else {
+#&gt; odeini &lt;- state.ini.fixed
+#&gt; names(odeini) &lt;- state.ini.fixed.boxnames
+#&gt; }
+#&gt; odeparms &lt;- c(P[(length(state.ini.optim) + 1):length(P)],
+#&gt; parms.fixed)
+#&gt; out &lt;- mkinpredict(mkinmod, odeparms, odeini, outtimes, solution_type = solution_type,
+#&gt; use_compiled = use_compiled, method.ode = method.ode,
+#&gt; atol = atol, rtol = rtol, ...)
+#&gt; mC &lt;- modCost(out, observed, y = &quot;value&quot;, err = err, weight = weight,
+#&gt; scaleVar = scaleVar)
+#&gt; return(mC)
+#&gt; }
+#&gt; &lt;environment: 0x2e966b0&gt;
+#&gt;
+#&gt; $hessian_notrans
+#&gt; parent_0 k_parent_sink
+#&gt; parent_0 4.163631 -1203.894
+#&gt; k_parent_sink -1203.893702 1033188.753
+#&gt;
+#&gt; $start
+#&gt; value type
+#&gt; parent_0 98.62 state
+#&gt; k_parent_sink 0.10 deparm
+#&gt;
+#&gt; $start_transformed
+#&gt; value lower upper
+#&gt; parent_0 98.620000 -Inf Inf
+#&gt; log_k_parent_sink -2.302585 -Inf Inf
+#&gt;
+#&gt; $fixed
+#&gt; [1] value type
+#&gt; &lt;0 rows&gt; (or 0-length row.names)
+#&gt;
+#&gt; $data
+#&gt; time variable observed predicted residual
+#&gt; 1 0 parent 98.62 99.17407218 -0.55407218
+#&gt; 2 3 parent 81.43 78.44547872 2.98452128
+#&gt; 3 7 parent 53.18 57.38445742 -4.20445742
+#&gt; 4 14 parent 34.89 33.20400061 1.68599939
+#&gt; 5 30 parent 10.09 9.50814643 0.58185357
+#&gt; 6 62 parent 1.50 0.77966270 0.72033730
+#&gt; 7 90 parent 0.33 0.08739595 0.24260405
+#&gt; 8 118 parent 0.08 0.00979661 0.07020339
+#&gt;
+#&gt; $atol
+#&gt; [1] 1e-08
+#&gt;
+#&gt; $rtol
+#&gt; [1] 1e-10
+#&gt;
+#&gt; $weight.ini
+#&gt; [1] &quot;none&quot;
+#&gt;
+#&gt; $reweight.tol
+#&gt; [1] 1e-08
+#&gt;
+#&gt; $reweight.max.iter
+#&gt; [1] 10
+#&gt;
+#&gt; $bparms.optim
+#&gt; parent_0 k_parent_sink
+#&gt; 99.17407218 0.07815759
+#&gt;
+#&gt; $bparms.fixed
+#&gt; numeric(0)
+#&gt;
+#&gt; $bparms.ode
+#&gt; k_parent_sink
+#&gt; 0.07815759
+#&gt;
+#&gt; $bparms.state
+#&gt; parent
+#&gt; 99.17407
+#&gt;
+#&gt; $date
+#&gt; [1] &quot;Thu Oct 6 09:17:51 2016&quot;
+#&gt;
+#&gt; attr(,&quot;class&quot;)
+#&gt; [1] &quot;mkinfit&quot; &quot;modFit&quot;
+#&gt; </div><div class='input'> <span class='no'>fits</span>[<span class='st'>"SFO"</span>, <span class='st'>"B"</span>, <span class='kw'>drop</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>]</div><div class='output co'>#&gt; [[1]]
+#&gt; $par
+#&gt; parent_0 log_k_parent_sink
+#&gt; 99.174072 -2.549028
+#&gt;
+#&gt; $ssr
+#&gt; [1] 30.65564
+#&gt;
+#&gt; $convergence
+#&gt; [1] 0
+#&gt;
+#&gt; $iterations
+#&gt; [1] 5
+#&gt;
+#&gt; $evaluations
+#&gt; function gradient
+#&gt; 8 15
+#&gt;
+#&gt; $counts
+#&gt; [1] &quot;relative convergence (4)&quot;
+#&gt;
+#&gt; $hessian
+#&gt; parent_0 log_k_parent_sink
+#&gt; parent_0 4.163631 -94.09343
+#&gt; log_k_parent_sink -94.093431 6311.34610
+#&gt;
+#&gt; $residuals
+#&gt; parent parent parent parent parent parent
+#&gt; 0.55407218 -2.98452128 4.20445742 -1.68599939 -0.58185357 -0.72033730
+#&gt; parent parent
+#&gt; -0.24260405 -0.07020339
+#&gt;
+#&gt; $ms
+#&gt; [1] 3.831956
+#&gt;
+#&gt; $var_ms
+#&gt; parent
+#&gt; 3.831956
+#&gt;
+#&gt; $var_ms_unscaled
+#&gt; parent
+#&gt; 3.831956
+#&gt;
+#&gt; $var_ms_unweighted
+#&gt; parent
+#&gt; 3.831956
+#&gt;
+#&gt; $rank
+#&gt; [1] 2
+#&gt;
+#&gt; $df.residual
+#&gt; [1] 6
+#&gt;
+#&gt; $solution_type
+#&gt; [1] &quot;analytical&quot;
+#&gt;
+#&gt; $transform_rates
+#&gt; [1] TRUE
+#&gt;
+#&gt; $transform_fractions
+#&gt; [1] TRUE
+#&gt;
+#&gt; $method.modFit
+#&gt; [1] &quot;Port&quot;
+#&gt;
+#&gt; $maxit.modFit
+#&gt; [1] &quot;auto&quot;
+#&gt;
+#&gt; $calls
+#&gt; [1] 29
+#&gt;
+#&gt; $time
+#&gt; user system elapsed
+#&gt; 0.068 0.000 0.068
+#&gt;
+#&gt; $mkinmod
+#&gt; &lt;mkinmod&gt; model generated with
+#&gt; Use of formation fractions $use_of_ff: min
+#&gt; Specification $spec:
+#&gt; $parent
+#&gt; $type: SFO; $sink: TRUE
+#&gt; Coefficient matrix $coefmat available
+#&gt;
+#&gt; $observed
+#&gt; name time value
+#&gt; 1 parent 0 98.62
+#&gt; 2 parent 3 81.43
+#&gt; 3 parent 7 53.18
+#&gt; 4 parent 14 34.89
+#&gt; 5 parent 30 10.09
+#&gt; 6 parent 62 1.50
+#&gt; 7 parent 90 0.33
+#&gt; 8 parent 118 0.08
+#&gt;
+#&gt; $obs_vars
+#&gt; [1] &quot;parent&quot;
+#&gt;
+#&gt; $predicted
+#&gt; name time value
+#&gt; 1 parent 0.000000 99.17407218
+#&gt; 2 parent 1.191919 90.35253561
+#&gt; 3 parent 2.383838 82.31567498
+#&gt; 4 parent 3.000000 78.44547872
+#&gt; 5 parent 3.575758 74.99369333
+#&gt; 6 parent 4.767677 68.32300215
+#&gt; 7 parent 5.959596 62.24566915
+#&gt; 8 parent 7.000000 57.38445742
+#&gt; 9 parent 7.151515 56.70891509
+#&gt; 10 parent 8.343434 51.66465547
+#&gt; 11 parent 9.535354 47.06908288
+#&gt; 12 parent 10.727273 42.88228661
+#&gt; 13 parent 11.919192 39.06790599
+#&gt; 14 parent 13.111111 35.59281463
+#&gt; 15 parent 14.000000 33.20400061
+#&gt; 16 parent 14.303030 32.42683275
+#&gt; 17 parent 15.494949 29.54246504
+#&gt; 18 parent 16.686869 26.91466193
+#&gt; 19 parent 17.878788 24.52060198
+#&gt; 20 parent 19.070707 22.33949373
+#&gt; 21 parent 20.262626 20.35239512
+#&gt; 22 parent 21.454545 18.54204899
+#&gt; 23 parent 22.646465 16.89273320
+#&gt; 24 parent 23.838384 15.39012410
+#&gt; 25 parent 25.030303 14.02117212
+#&gt; 26 parent 26.222222 12.77398846
+#&gt; 27 parent 27.414141 11.63774182
+#&gt; 28 parent 28.606061 10.60256435
+#&gt; 29 parent 29.797980 9.65946594
+#&gt; 30 parent 30.000000 9.50814643
+#&gt; 31 parent 30.989899 8.80025617
+#&gt; 32 parent 32.181818 8.01747313
+#&gt; 33 parent 33.373737 7.30431867
+#&gt; 34 parent 34.565657 6.65459931
+#&gt; 35 parent 35.757576 6.06267251
+#&gt; 36 parent 36.949495 5.52339762
+#&gt; 37 parent 38.141414 5.03209124
+#&gt; 38 parent 39.333333 4.58448658
+#&gt; 39 parent 40.525253 4.17669637
+#&gt; 40 parent 41.717172 3.80517911
+#&gt; 41 parent 42.909091 3.46670832
+#&gt; 42 parent 44.101010 3.15834451
+#&gt; 43 parent 45.292929 2.87740968
+#&gt; 44 parent 46.484848 2.62146400
+#&gt; 45 parent 47.676768 2.38828471
+#&gt; 46 parent 48.868687 2.17584671
+#&gt; 47 parent 50.060606 1.98230508
+#&gt; 48 parent 51.252525 1.80597899
+#&gt; 49 parent 52.444444 1.64533711
+#&gt; 50 parent 53.636364 1.49898432
+#&gt; 51 parent 54.828283 1.36564963
+#&gt; 52 parent 56.020202 1.24417505
+#&gt; 53 parent 57.212121 1.13350565
+#&gt; 54 parent 58.404040 1.03268029
+#&gt; 55 parent 59.595960 0.94082335
+#&gt; 56 parent 60.787879 0.85713708
+#&gt; 57 parent 61.979798 0.78089471
+#&gt; 58 parent 62.000000 0.77966270
+#&gt; 59 parent 63.171717 0.71143411
+#&gt; 60 parent 64.363636 0.64815202
+#&gt; 61 parent 65.555556 0.59049888
+#&gt; 62 parent 66.747475 0.53797399
+#&gt; 63 parent 67.939394 0.49012119
+#&gt; 64 parent 69.131313 0.44652489
+#&gt; 65 parent 70.323232 0.40680649
+#&gt; 66 parent 71.515152 0.37062104
+#&gt; 67 parent 72.707071 0.33765429
+#&gt; 68 parent 73.898990 0.30761993
+#&gt; 69 parent 75.090909 0.28025713
+#&gt; 70 parent 76.282828 0.25532825
+#&gt; 71 parent 77.474747 0.23261679
+#&gt; 72 parent 78.666667 0.21192552
+#&gt; 73 parent 79.858586 0.19307474
+#&gt; 74 parent 81.050505 0.17590074
+#&gt; 75 parent 82.242424 0.16025436
+#&gt; 76 parent 83.434343 0.14599973
+#&gt; 77 parent 84.626263 0.13301305
+#&gt; 78 parent 85.818182 0.12118154
+#&gt; 79 parent 87.010101 0.11040244
+#&gt; 80 parent 88.202020 0.10058214
+#&gt; 81 parent 89.393939 0.09163535
+#&gt; 82 parent 90.000000 0.08739595
+#&gt; 83 parent 90.585859 0.08348439
+#&gt; 84 parent 91.777778 0.07605845
+#&gt; 85 parent 92.969697 0.06929305
+#&gt; 86 parent 94.161616 0.06312943
+#&gt; 87 parent 95.353535 0.05751406
+#&gt; 88 parent 96.545455 0.05239819
+#&gt; 89 parent 97.737374 0.04773737
+#&gt; 90 parent 98.929293 0.04349113
+#&gt; 91 parent 100.121212 0.03962259
+#&gt; 92 parent 101.313131 0.03609816
+#&gt; 93 parent 102.505051 0.03288723
+#&gt; 94 parent 103.696970 0.02996191
+#&gt; 95 parent 104.888889 0.02729679
+#&gt; 96 parent 106.080808 0.02486874
+#&gt; 97 parent 107.272727 0.02265667
+#&gt; 98 parent 108.464646 0.02064136
+#&gt; 99 parent 109.656566 0.01880531
+#&gt; 100 parent 110.848485 0.01713257
+#&gt; 101 parent 112.040404 0.01560863
+#&gt; 102 parent 113.232323 0.01422024
+#&gt; 103 parent 114.424242 0.01295535
+#&gt; 104 parent 115.616162 0.01180297
+#&gt; 105 parent 116.808081 0.01075310
+#&gt; 106 parent 118.000000 0.00979661
+#&gt;
+#&gt; $cost
+#&gt; function (P)
+#&gt; {
+#&gt; assign(&quot;calls&quot;, calls + 1, inherits = TRUE)
+#&gt; if (trace_parms)
+#&gt; cat(P, &quot;\n&quot;)
+#&gt; if (length(state.ini.optim) &gt; 0) {
+#&gt; odeini &lt;- c(P[1:length(state.ini.optim)], state.ini.fixed)
+#&gt; names(odeini) &lt;- c(state.ini.optim.boxnames, state.ini.fixed.boxnames)
+#&gt; }
+#&gt; else {
+#&gt; odeini &lt;- state.ini.fixed
+#&gt; names(odeini) &lt;- state.ini.fixed.boxnames
+#&gt; }
+#&gt; odeparms &lt;- c(P[(length(state.ini.optim) + 1):length(P)],
+#&gt; transparms.fixed)
+#&gt; parms &lt;- backtransform_odeparms(odeparms, mkinmod, transform_rates = transform_rates,
+#&gt; transform_fractions = transform_fractions)
+#&gt; out &lt;- mkinpredict(mkinmod, parms, odeini, outtimes, solution_type = solution_type,
+#&gt; use_compiled = use_compiled, method.ode = method.ode,
+#&gt; atol = atol, rtol = rtol, ...)
+#&gt; assign(&quot;out_predicted&quot;, out, inherits = TRUE)
+#&gt; mC &lt;- modCost(out, observed, y = &quot;value&quot;, err = err, weight = weight,
+#&gt; scaleVar = scaleVar)
+#&gt; if (mC$model &lt; cost.old) {
+#&gt; if (!quiet)
+#&gt; cat(&quot;Model cost at call &quot;, calls, &quot;: &quot;, mC$model,
+#&gt; &quot;\n&quot;)
+#&gt; if (plot) {
+#&gt; outtimes_plot = seq(min(observed$time), max(observed$time),
+#&gt; length.out = 100)
+#&gt; out_plot &lt;- mkinpredict(mkinmod, parms, odeini, outtimes_plot,
+#&gt; solution_type = solution_type, use_compiled = use_compiled,
+#&gt; method.ode = method.ode, atol = atol, rtol = rtol,
+#&gt; ...)
+#&gt; plot(0, type = &quot;n&quot;, xlim = range(observed$time),
+#&gt; ylim = c(0, max(observed$value, na.rm = TRUE)),
+#&gt; xlab = &quot;Time&quot;, ylab = &quot;Observed&quot;)
+#&gt; col_obs &lt;- pch_obs &lt;- 1:length(obs_vars)
+#&gt; lty_obs &lt;- rep(1, length(obs_vars))
+#&gt; names(col_obs) &lt;- names(pch_obs) &lt;- names(lty_obs) &lt;- obs_vars
+#&gt; for (obs_var in obs_vars) {
+#&gt; points(subset(observed, name == obs_var, c(time,
+#&gt; value)), pch = pch_obs[obs_var], col = col_obs[obs_var])
+#&gt; }
+#&gt; matlines(out_plot$time, out_plot[-1], col = col_obs,
+#&gt; lty = lty_obs)
+#&gt; legend(&quot;topright&quot;, inset = c(0.05, 0.05), legend = obs_vars,
+#&gt; col = col_obs, pch = pch_obs, lty = 1:length(pch_obs))
+#&gt; }
+#&gt; assign(&quot;cost.old&quot;, mC$model, inherits = TRUE)
+#&gt; }
+#&gt; return(mC)
+#&gt; }
+#&gt; &lt;environment: 0x2e966b0&gt;
+#&gt;
+#&gt; $cost_notrans
+#&gt; function (P)
+#&gt; {
+#&gt; if (length(state.ini.optim) &gt; 0) {
+#&gt; odeini &lt;- c(P[1:length(state.ini.optim)], state.ini.fixed)
+#&gt; names(odeini) &lt;- c(state.ini.optim.boxnames, state.ini.fixed.boxnames)
+#&gt; }
+#&gt; else {
+#&gt; odeini &lt;- state.ini.fixed
+#&gt; names(odeini) &lt;- state.ini.fixed.boxnames
+#&gt; }
+#&gt; odeparms &lt;- c(P[(length(state.ini.optim) + 1):length(P)],
+#&gt; parms.fixed)
+#&gt; out &lt;- mkinpredict(mkinmod, odeparms, odeini, outtimes, solution_type = solution_type,
+#&gt; use_compiled = use_compiled, method.ode = method.ode,
+#&gt; atol = atol, rtol = rtol, ...)
+#&gt; mC &lt;- modCost(out, observed, y = &quot;value&quot;, err = err, weight = weight,
+#&gt; scaleVar = scaleVar)
+#&gt; return(mC)
+#&gt; }
+#&gt; &lt;environment: 0x2e966b0&gt;
+#&gt;
+#&gt; $hessian_notrans
+#&gt; parent_0 k_parent_sink
+#&gt; parent_0 4.163631 -1203.894
+#&gt; k_parent_sink -1203.893702 1033188.753
+#&gt;
+#&gt; $start
+#&gt; value type
+#&gt; parent_0 98.62 state
+#&gt; k_parent_sink 0.10 deparm
+#&gt;
+#&gt; $start_transformed
+#&gt; value lower upper
+#&gt; parent_0 98.620000 -Inf Inf
+#&gt; log_k_parent_sink -2.302585 -Inf Inf
+#&gt;
+#&gt; $fixed
+#&gt; [1] value type
+#&gt; &lt;0 rows&gt; (or 0-length row.names)
+#&gt;
+#&gt; $data
+#&gt; time variable observed predicted residual
+#&gt; 1 0 parent 98.62 99.17407218 -0.55407218
+#&gt; 2 3 parent 81.43 78.44547872 2.98452128
+#&gt; 3 7 parent 53.18 57.38445742 -4.20445742
+#&gt; 4 14 parent 34.89 33.20400061 1.68599939
+#&gt; 5 30 parent 10.09 9.50814643 0.58185357
+#&gt; 6 62 parent 1.50 0.77966270 0.72033730
+#&gt; 7 90 parent 0.33 0.08739595 0.24260405
+#&gt; 8 118 parent 0.08 0.00979661 0.07020339
+#&gt;
+#&gt; $atol
+#&gt; [1] 1e-08
+#&gt;
+#&gt; $rtol
+#&gt; [1] 1e-10
+#&gt;
+#&gt; $weight.ini
+#&gt; [1] &quot;none&quot;
+#&gt;
+#&gt; $reweight.tol
+#&gt; [1] 1e-08
+#&gt;
+#&gt; $reweight.max.iter
+#&gt; [1] 10
+#&gt;
+#&gt; $bparms.optim
+#&gt; parent_0 k_parent_sink
+#&gt; 99.17407218 0.07815759
+#&gt;
+#&gt; $bparms.fixed
+#&gt; numeric(0)
+#&gt;
+#&gt; $bparms.ode
+#&gt; k_parent_sink
+#&gt; 0.07815759
+#&gt;
+#&gt; $bparms.state
+#&gt; parent
+#&gt; 99.17407
+#&gt;
+#&gt; $date
+#&gt; [1] &quot;Thu Oct 6 09:17:51 2016&quot;
+#&gt;
+#&gt; attr(,&quot;class&quot;)
+#&gt; [1] &quot;mkinfit&quot; &quot;modFit&quot;
+#&gt;
+#&gt; </div></pre>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </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/reference/FOCUS_2006_DFOP_ref_A_to_B.html b/docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html
new file mode 100644
index 00000000..5c0faa43
--- /dev/null
+++ b/docs/reference/FOCUS_2006_DFOP_ref_A_to_B.html
@@ -0,0 +1,129 @@
+<!-- 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>FOCUS_2006_DFOP_ref_A_to_B. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>A table with the fitted parameters and the resulting DT50 and DT90 values
+generated with different software packages. Taken directly from FOCUS (2006).
+The results from fitting the data with the Topfit software was removed, as
+the initial concentration of the parent compound was fixed to a value of 100
+in this fit.</p>
+
+
+ <pre><span class='fu'>data</span>(<span class='no'>FOCUS_2006_DFOP_ref_A_to_B</span>)</pre>
+
+ <div class="Format">
+ <h2>Format</h2>
+
+ <p>A data frame containing the following variables.
+ <dl class='dl-horizontal'>
+ <dt><code>package</code></dt><dd>a factor giving the name of the software package</dd>
+ <dt><code>M0</code></dt><dd>The fitted initial concentration of the parent compound</dd>
+ <dt><code>f</code></dt><dd>The fitted f parameter</dd>
+ <dt><code>k1</code></dt><dd>The fitted k1 parameter</dd>
+ <dt><code>k2</code></dt><dd>The fitted k2 parameter</dd>
+ <dt><code>DT50</code></dt><dd>The resulting half-life of the parent compound</dd>
+ <dt><code>DT90</code></dt><dd>The resulting DT90 of the parent compound</dd>
+ <dt><code>dataset</code></dt><dd>The FOCUS dataset that was used</dd>
+ </dl></p>
+ </div>
+
+ <div class="Source">
+ <h2>Source</h2>
+
+ <p>FOCUS (2006) &#8220;Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration&#8221; Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ <a href = 'http://focus.jrc.ec.europa.eu/dk'>http://focus.jrc.ec.europa.eu/dk</a></p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='fu'>data</span>(<span class='no'>FOCUS_2006_DFOP_ref_A_to_B</span>)</div></pre>
+ </div>
+ <div class="col-md-3">
+ </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/reference/FOCUS_2006_FOMC_ref_A_to_F.html b/docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html
new file mode 100644
index 00000000..89faecbf
--- /dev/null
+++ b/docs/reference/FOCUS_2006_FOMC_ref_A_to_F.html
@@ -0,0 +1,128 @@
+<!-- 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>FOCUS_2006_FOMC_ref_A_to_F. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>A table with the fitted parameters and the resulting DT50 and DT90 values
+generated with different software packages. Taken directly from FOCUS (2006).
+The results from fitting the data with the Topfit software was removed, as
+the initial concentration of the parent compound was fixed to a value of 100
+in this fit.</p>
+
+
+ <pre><span class='fu'>data</span>(<span class='no'>FOCUS_2006_FOMC_ref_A_to_F</span>)</pre>
+
+ <div class="Format">
+ <h2>Format</h2>
+
+ <p>A data frame containing the following variables.
+ <dl class='dl-horizontal'>
+ <dt><code>package</code></dt><dd>a factor giving the name of the software package</dd>
+ <dt><code>M0</code></dt><dd>The fitted initial concentration of the parent compound</dd>
+ <dt><code>alpha</code></dt><dd>The fitted alpha parameter</dd>
+ <dt><code>beta</code></dt><dd>The fitted beta parameter</dd>
+ <dt><code>DT50</code></dt><dd>The resulting half-life of the parent compound</dd>
+ <dt><code>DT90</code></dt><dd>The resulting DT90 of the parent compound</dd>
+ <dt><code>dataset</code></dt><dd>The FOCUS dataset that was used</dd>
+ </dl></p>
+ </div>
+
+ <div class="Source">
+ <h2>Source</h2>
+
+ <p>FOCUS (2006) &#8220;Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration&#8221; Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ <a href = 'http://focus.jrc.ec.europa.eu/dk'>http://focus.jrc.ec.europa.eu/dk</a></p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='fu'>data</span>(<span class='no'>FOCUS_2006_FOMC_ref_A_to_F</span>)</div></pre>
+ </div>
+ <div class="col-md-3">
+ </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/reference/FOCUS_2006_HS_ref_A_to_F.html b/docs/reference/FOCUS_2006_HS_ref_A_to_F.html
new file mode 100644
index 00000000..2dfafec6
--- /dev/null
+++ b/docs/reference/FOCUS_2006_HS_ref_A_to_F.html
@@ -0,0 +1,129 @@
+<!-- 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>FOCUS_2006_HS_ref_A_to_F. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>A table with the fitted parameters and the resulting DT50 and DT90 values
+generated with different software packages. Taken directly from FOCUS (2006).
+The results from fitting the data with the Topfit software was removed, as
+the initial concentration of the parent compound was fixed to a value of 100
+in this fit.</p>
+
+
+ <pre><span class='fu'>data</span>(<span class='no'>FOCUS_2006_HS_ref_A_to_F</span>)</pre>
+
+ <div class="Format">
+ <h2>Format</h2>
+
+ <p>A data frame containing the following variables.
+ <dl class='dl-horizontal'>
+ <dt><code>package</code></dt><dd>a factor giving the name of the software package</dd>
+ <dt><code>M0</code></dt><dd>The fitted initial concentration of the parent compound</dd>
+ <dt><code>tb</code></dt><dd>The fitted tb parameter</dd>
+ <dt><code>k1</code></dt><dd>The fitted k1 parameter</dd>
+ <dt><code>k2</code></dt><dd>The fitted k2 parameter</dd>
+ <dt><code>DT50</code></dt><dd>The resulting half-life of the parent compound</dd>
+ <dt><code>DT90</code></dt><dd>The resulting DT90 of the parent compound</dd>
+ <dt><code>dataset</code></dt><dd>The FOCUS dataset that was used</dd>
+ </dl></p>
+ </div>
+
+ <div class="Source">
+ <h2>Source</h2>
+
+ <p>FOCUS (2006) &#8220;Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration&#8221; Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ <a href = 'http://focus.jrc.ec.europa.eu/dk'>http://focus.jrc.ec.europa.eu/dk</a></p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='fu'>data</span>(<span class='no'>FOCUS_2006_HS_ref_A_to_F</span>)</div></pre>
+ </div>
+ <div class="col-md-3">
+ </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/reference/FOCUS_2006_SFO_ref_A_to_F.html b/docs/reference/FOCUS_2006_SFO_ref_A_to_F.html
new file mode 100644
index 00000000..ed3a4aff
--- /dev/null
+++ b/docs/reference/FOCUS_2006_SFO_ref_A_to_F.html
@@ -0,0 +1,127 @@
+<!-- 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>FOCUS_2006_SFO_ref_A_to_F. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>A table with the fitted parameters and the resulting DT50 and DT90 values
+generated with different software packages. Taken directly from FOCUS (2006).
+The results from fitting the data with the Topfit software was removed, as
+the initial concentration of the parent compound was fixed to a value of 100
+in this fit.</p>
+
+
+ <pre><span class='fu'>data</span>(<span class='no'>FOCUS_2006_SFO_ref_A_to_F</span>)</pre>
+
+ <div class="Format">
+ <h2>Format</h2>
+
+ <p>A data frame containing the following variables.
+ <dl class='dl-horizontal'>
+ <dt><code>package</code></dt><dd>a factor giving the name of the software package</dd>
+ <dt><code>M0</code></dt><dd>The fitted initial concentration of the parent compound</dd>
+ <dt><code>k</code></dt><dd>The fitted first-order degradation rate constant</dd>
+ <dt><code>DT50</code></dt><dd>The resulting half-life of the parent compound</dd>
+ <dt><code>DT90</code></dt><dd>The resulting DT90 of the parent compound</dd>
+ <dt><code>dataset</code></dt><dd>The FOCUS dataset that was used</dd>
+ </dl></p>
+ </div>
+
+ <div class="Source">
+ <h2>Source</h2>
+
+ <p>FOCUS (2006) &#8220;Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration&#8221; Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ <a href = 'http://focus.jrc.ec.europa.eu/dk'>http://focus.jrc.ec.europa.eu/dk</a></p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='fu'>data</span>(<span class='no'>FOCUS_2006_SFO_ref_A_to_F</span>)</div></pre>
+ </div>
+ <div class="col-md-3">
+ </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/reference/FOCUS_2006_datasets.html b/docs/reference/FOCUS_2006_datasets.html
new file mode 100644
index 00000000..c1eacbd8
--- /dev/null
+++ b/docs/reference/FOCUS_2006_datasets.html
@@ -0,0 +1,130 @@
+<!-- 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>FOCUS_2006_datasets. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>Data taken from FOCUS (2006), p. 258.</p>
+
+
+ <pre><span class='no'>FOCUS_2006_datasets</span></pre>
+
+ <div class="Format">
+ <h2>Format</h2>
+
+ <p>6 datasets with observations on the following variables.
+ <dl class='dl-horizontal'>
+ <dt><code>name</code></dt><dd>a factor containing the name of the observed variable</dd>
+ <dt><code>time</code></dt><dd>a numeric vector containing time points</dd>
+ <dt><code>value</code></dt><dd>a numeric vector containing concentrations in percent of applied radioactivity</dd>
+ </dl></p>
+ </div>
+
+ <div class="Source">
+ <h2>Source</h2>
+
+ <p>FOCUS (2006) &#8220;Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration&#8221; Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ <a href = 'http://focus.jrc.ec.europa.eu/dk'>http://focus.jrc.ec.europa.eu/dk</a></p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='no'>FOCUS_2006_C</span></div><div class='output co'>#&gt; name time value
+#&gt; 1 parent 0 85.1
+#&gt; 2 parent 1 57.9
+#&gt; 3 parent 3 29.9
+#&gt; 4 parent 7 14.6
+#&gt; 5 parent 14 9.7
+#&gt; 6 parent 28 6.6
+#&gt; 7 parent 63 4.0
+#&gt; 8 parent 91 3.9
+#&gt; 9 parent 119 0.6
+#&gt; </div></pre>
+ </div>
+ <div class="col-md-3">
+ </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/reference/FOMC.solution.html b/docs/reference/FOMC.solution.html
new file mode 100644
index 00000000..912cf414
--- /dev/null
+++ b/docs/reference/FOMC.solution.html
@@ -0,0 +1,147 @@
+<!-- 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>FOMC.solution. 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> First-Order Multi-Compartment kinetics </h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>Function describing exponential decline from a defined starting value, with
+ a decreasing rate constant.</p>
+
+ <p>The form given here differs slightly from the original reference by Gustafson
+ and Holden (1990). The parameter <code>beta</code> corresponds to 1/beta in the
+ original equation.</p>
+
+
+ <pre><span class='fu'>FOMC.solution</span>(<span class='no'>t</span>, <span class='no'>parent.0</span>, <span class='no'>alpha</span>, <span class='no'>beta</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>t</dt>
+ <dd> Time. </dd>
+ <dt>parent.0</dt>
+ <dd> Starting value for the response variable at time zero. </dd>
+ <dt>alpha</dt>
+ <dd>
+ Shape parameter determined by coefficient of variation of rate constant
+ values. </dd>
+ <dt>beta</dt>
+ <dd>
+ Location parameter.
+</dd>
+ </dl>
+
+ <div class="Note">
+ <h2>Note</h2>
+
+ <p>The solution of the FOMC kinetic model reduces to the
+ <code>SFO.solution</code> for large values of <code>alpha</code> and
+ <code>beta</code> with
+ \(k = \frac{\beta}{\alpha}\).</p>
+ </div>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>The value of the response variable at time <code>t</code>.</p>
+ </div>
+
+ <div class="References">
+ <h2>References</h2>
+
+ <p>FOCUS (2006) &#8220;Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration&#8221; Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ <a href = 'http://focus.jrc.ec.europa.eu/dk'>http://focus.jrc.ec.europa.eu/dk</a></p>
+ <p>Gustafson DI and Holden LR (1990) Nonlinear pesticide dissipation in soil: A
+ new model based on spatial variability. <em>Environmental Science and
+ Technology</em> <b>24</b>, 1032-1038</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'> <span class='fu'>plot</span>(<span class='kw'>function</span>(<span class='no'>x</span>) <span class='fu'>FOMC.solution</span>(<span class='no'>x</span>, <span class='fl'>100</span>, <span class='fl'>10</span>, <span class='fl'>2</span>), <span class='fl'>0</span>, <span class='fl'>2</span>, <span class='kw'>ylim</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='fl'>0</span>, <span class='fl'>100</span>))</div><img src='unknown-2.png' alt='' width='540' height='400' /></pre>
+ </div>
+ <div class="col-md-3">
+ </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/reference/HS.solution.html b/docs/reference/HS.solution.html
new file mode 100644
index 00000000..994f8373
--- /dev/null
+++ b/docs/reference/HS.solution.html
@@ -0,0 +1,131 @@
+<!-- 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>HS.solution. 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> Hockey-Stick kinetics </h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>Function describing two exponential decline functions with a break point
+ between them.</p>
+
+
+ <pre><span class='fu'>HS.solution</span>(<span class='no'>t</span>, <span class='no'>parent.0</span>, <span class='no'>k1</span>, <span class='no'>k2</span>, <span class='no'>tb</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>t</dt>
+ <dd> Time. </dd>
+ <dt>parent.0</dt>
+ <dd> Starting value for the response variable at time zero. </dd>
+ <dt>k1</dt>
+ <dd> First kinetic constant. </dd>
+ <dt>k2</dt>
+ <dd> Second kinetic constant. </dd>
+ <dt>tb</dt>
+ <dd> Break point. Before this time, exponential decline according
+ to <code>k1</code> is calculated, after this time, exponential decline proceeds
+ according to <code>k2</code>. </dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>The value of the response variable at time <code>t</code>.</p>
+ </div>
+
+ <div class="References">
+ <h2>References</h2>
+
+ <p>FOCUS (2006) &#8220;Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration&#8221; Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ <a href = 'http://focus.jrc.ec.europa.eu/dk'>http://focus.jrc.ec.europa.eu/dk</a></p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'> <span class='fu'>plot</span>(<span class='kw'>function</span>(<span class='no'>x</span>) <span class='fu'>HS.solution</span>(<span class='no'>x</span>, <span class='fl'>100</span>, <span class='fl'>2</span>, <span class='fl'>0.3</span>, <span class='fl'>0.5</span>), <span class='fl'>0</span>, <span class='fl'>2</span>, <span class='kw'>ylim</span><span class='kw'>=</span><span class='fu'>c</span>(<span class='fl'>0</span>,<span class='fl'>100</span>))</div><img src='unknown-2.png' alt='' width='540' height='400' /></pre>
+ </div>
+ <div class="col-md-3">
+ </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/reference/IORE.solution.html b/docs/reference/IORE.solution.html
new file mode 100644
index 00000000..06f5c1ad
--- /dev/null
+++ b/docs/reference/IORE.solution.html
@@ -0,0 +1,149 @@
+<!-- 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>IORE.solution. 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> Indeterminate order rate equation kinetics </h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>Function describing exponential decline from a defined starting value, with
+ a concentration dependent rate constant.</p>
+
+
+ <pre><span class='fu'>IORE.solution</span>(<span class='no'>t</span>, <span class='no'>parent.0</span>, <span class='no'>k__iore</span>, <span class='no'>N</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>t</dt>
+ <dd> Time. </dd>
+ <dt>parent.0</dt>
+ <dd> Starting value for the response variable at time zero. </dd>
+ <dt>k__iore</dt>
+ <dd> Rate constant. Note that this depends on the concentration units used. </dd>
+ <dt>N</dt>
+ <dd> Exponent describing the nonlinearity of the rate equation </dd>
+ </dl>
+
+ <div class="Note">
+ <h2>Note</h2>
+
+ <p>The solution of the IORE kinetic model reduces to the
+ <code>SFO.solution</code> if N = 1.
+ The parameters of the IORE model can be transformed to equivalent parameters
+ of the FOMC mode - see the NAFTA guidance for details.</p>
+ </div>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>The value of the response variable at time <code>t</code>.</p>
+ </div>
+
+ <div class="References">
+ <h2>References</h2>
+
+ <p>NAFTA Technical Working Group on Pesticides (not dated) Guidance for
+ Evaluating and Calculating Degradation Kinetics in Environmental
+ Media</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'> <span class='fu'>plot</span>(<span class='kw'>function</span>(<span class='no'>x</span>) <span class='fu'>IORE.solution</span>(<span class='no'>x</span>, <span class='fl'>100</span>, <span class='fl'>0.2</span>, <span class='fl'>1.3</span>), <span class='fl'>0</span>, <span class='fl'>2</span>,
+ <span class='kw'>ylim</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='fl'>0</span>, <span class='fl'>100</span>))</div><img src='unknown-2.png' alt='' width='540' height='400' /><div class='input'> <span class='no'>fit.fomc</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='st'>"FOMC"</span>, <span class='no'>FOCUS_2006_C</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
+ <span class='no'>fit.iore</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='st'>"IORE"</span>, <span class='no'>FOCUS_2006_C</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
+ <span class='no'>fit.iore.deS</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='st'>"IORE"</span>, <span class='no'>FOCUS_2006_C</span>, <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"deSolve"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
+
+ <span class='fu'>print</span>(<span class='fu'>data.frame</span>(<span class='fu'>coef</span>(<span class='no'>fit.fomc</span>), <span class='fu'>coef</span>(<span class='no'>fit.iore</span>), <span class='fu'>coef</span>(<span class='no'>fit.iore.deS</span>),
+ <span class='kw'>row.names</span> <span class='kw'>=</span> <span class='fu'>paste</span>(<span class='st'>"model par"</span>, <span class='fl'>1</span>:<span class='fl'>3</span>)))</div><div class='output co'>#&gt; coef.fit.fomc. coef.fit.iore. coef.fit.iore.deS.
+#&gt; model par 1 85.87489063 85.874891 85.874890
+#&gt; model par 2 0.05192238 -4.826631 -4.826631
+#&gt; model par 3 0.65096665 1.949403 1.949403
+#&gt; </div><div class='input'> <span class='fu'>print</span>(<span class='fu'>rbind</span>(<span class='kw'>fomc</span> <span class='kw'>=</span> <span class='fu'>endpoints</span>(<span class='no'>fit.fomc</span>)$<span class='no'>distimes</span>, <span class='kw'>iore</span> <span class='kw'>=</span> <span class='fu'>endpoints</span>(<span class='no'>fit.iore</span>)$<span class='no'>distimes</span>,
+ <span class='kw'>iore.deS</span> <span class='kw'>=</span> <span class='fu'>endpoints</span>(<span class='no'>fit.iore</span>)$<span class='no'>distimes</span>))</div><div class='output co'>#&gt; DT50 DT90 DT50back
+#&gt; fomc 1.785233 15.1479 4.559973
+#&gt; iore 1.785233 15.1479 4.559973
+#&gt; iore.deS 1.785233 15.1479 4.559973
+#&gt; </div></pre>
+ </div>
+ <div class="col-md-3">
+ </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/reference/SFO.solution.html b/docs/reference/SFO.solution.html
new file mode 100644
index 00000000..9cf069d7
--- /dev/null
+++ b/docs/reference/SFO.solution.html
@@ -0,0 +1,124 @@
+<!-- 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>SFO.solution. 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> Single First-Order kinetics </h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>Function describing exponential decline from a defined starting value.</p>
+
+
+ <pre><span class='fu'>SFO.solution</span>(<span class='no'>t</span>, <span class='no'>parent.0</span>, <span class='no'>k</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>t</dt>
+ <dd> Time. </dd>
+ <dt>parent.0</dt>
+ <dd> Starting value for the response variable at time zero. </dd>
+ <dt>k</dt>
+ <dd> Kinetic constant. </dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>The value of the response variable at time <code>t</code>.</p>
+ </div>
+
+ <div class="References">
+ <h2>References</h2>
+
+ <p>FOCUS (2006) &#8220;Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration&#8221; Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ <a href = 'http://focus.jrc.ec.europa.eu/dk'>http://focus.jrc.ec.europa.eu/dk</a></p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'> <span class='co'>## Not run: plot(function(x) SFO.solution(x, 100, 3), 0, 2)</span></div></pre>
+ </div>
+ <div class="col-md-3">
+ </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/reference/SFORB.solution.html b/docs/reference/SFORB.solution.html
new file mode 100644
index 00000000..57959f26
--- /dev/null
+++ b/docs/reference/SFORB.solution.html
@@ -0,0 +1,133 @@
+<!-- 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>SFORB.solution. 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> Single First-Order Reversible Binding kinetics </h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>Function describing the solution of the differential equations describing
+ the kinetic model with first-order terms for a two-way transfer from a free
+ to a bound fraction, and a first-order degradation term for the free
+ fraction. The initial condition is a defined amount in the free fraction and
+ no substance in the bound fraction.</p>
+
+
+ <pre><span class='fu'>SFORB.solution</span>(<span class='no'>t</span>, <span class='no'>parent.0</span>, <span class='no'>k_12</span>, <span class='no'>k_21</span>, <span class='no'>k_1output</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>t</dt>
+ <dd> Time. </dd>
+ <dt>parent.0</dt>
+ <dd> Starting value for the response variable at time zero. </dd>
+ <dt>k_12</dt>
+ <dd> Kinetic constant describing transfer from free to bound. </dd>
+ <dt>k_21</dt>
+ <dd> Kinetic constant describing transfer from bound to free. </dd>
+ <dt>k_1output</dt>
+ <dd> Kinetic constant describing degradation of the free fraction. </dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>The value of the response variable, which is the sum of free and bound
+ fractions at time <code>t</code>.</p>
+ </div>
+
+ <div class="References">
+ <h2>References</h2>
+
+ <p>FOCUS (2006) &#8220;Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration&#8221; Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ <a href = 'http://focus.jrc.ec.europa.eu/dk'>http://focus.jrc.ec.europa.eu/dk</a></p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'> <span class='co'>## Not run: plot(function(x) SFORB.solution(x, 100, 0.5, 2, 3), 0, 2)</span></div></pre>
+ </div>
+ <div class="col-md-3">
+ </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/reference/add_err.html b/docs/reference/add_err.html
new file mode 100644
index 00000000..cbc925ca
--- /dev/null
+++ b/docs/reference/add_err.html
@@ -0,0 +1,196 @@
+<!-- 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>add_err. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>Normally distributed errors are added to data predicted for a specific
+ degradation model using <code>mkinpredict</code>. The variance of the error
+ may depend on the predicted value and is specified as a standard deviation.</p>
+
+
+ <pre><span class='fu'>add_err</span>(<span class='no'>prediction</span>, <span class='no'>sdfunc</span>,
+ <span class='kw'>n</span> <span class='kw'>=</span> <span class='fl'>1000</span>, <span class='kw'>LOD</span> <span class='kw'>=</span> <span class='fl'>0.1</span>, <span class='kw'>reps</span> <span class='kw'>=</span> <span class='fl'>2</span>,
+ <span class='kw'>digits</span> <span class='kw'>=</span> <span class='fl'>1</span>, <span class='kw'>seed</span> <span class='kw'>=</span> <span class='fl'>NA</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>prediction</dt>
+ <dd>
+ A prediction from a kinetic model as produced by <code>mkinpredict</code>.
+ </dd>
+ <dt>sdfunc</dt>
+ <dd>
+ A function taking the predicted value as its only argument and returning
+ a standard deviation that should be used for generating the random error
+ terms for this value.
+ </dd>
+ <dt>n</dt>
+ <dd>
+ The number of datasets to be generated.
+ </dd>
+ <dt>LOD</dt>
+ <dd>
+ The limit of detection (LOD). Values that are below the LOD after adding
+ the random error will be set to NA.
+ </dd>
+ <dt>reps</dt>
+ <dd>
+ The number of replicates to be generated within the datasets.
+ </dd>
+ <dt>digits</dt>
+ <dd>
+ The number of digits to which the values will be rounded.
+ </dd>
+ <dt>seed</dt>
+ <dd>
+ The seed used for the generation of random numbers. If NA, the seed
+ is not set.
+ </dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>A list of datasets compatible with <code>mmkin</code>, i.e.
+ the components of the list are datasets compatible with
+ <code>mkinfit</code>.</p>
+ </div>
+
+ <div class="References">
+ <h2>References</h2>
+
+ <p>Ranke J and Lehmann R (2015) To t-test or not to t-test, that is the question. XV Symposium on Pesticide Chemistry 2-4 September 2015, Piacenza, Italy
+ http://chem.uft.uni-bremen.de/ranke/posters/piacenza_2015.pdf</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='co'># The kinetic model</span>
+<span class='no'>m_SFO_SFO</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinmod</span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>, <span class='st'>"M1"</span>),
+ <span class='kw'>M1</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>), <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output'><strong class='text-info'>Successfully compiled differential equation model from auto-generated C code.</strong></div><div class='input'>
+<span class='co'># Generate a prediction for a specific set of parameters</span>
+<span class='no'>sampling_times</span> <span class='kw'>=</span> <span class='fu'>c</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='co'># This is the prediction used for the "Type 2 datasets" on the Piacenza poster</span>
+<span class='co'># from 2015</span>
+<span class='no'>d_SFO_SFO</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinpredict</span>(<span class='no'>m_SFO_SFO</span>,
+ <span class='fu'>c</span>(<span class='kw'>k_parent</span> <span class='kw'>=</span> <span class='fl'>0.1</span>, <span class='kw'>f_parent_to_M1</span> <span class='kw'>=</span> <span class='fl'>0.5</span>,
+ <span class='kw'>k_M1</span> <span class='kw'>=</span> <span class='fu'>log</span>(<span class='fl'>2</span>)/<span class='fl'>1000</span>),
+ <span class='fu'>c</span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fl'>100</span>, <span class='kw'>M1</span> <span class='kw'>=</span> <span class='fl'>0</span>),
+ <span class='no'>sampling_times</span>)
+
+<span class='co'># Add an error term with a constant (independent of the value) standard deviation</span>
+<span class='co'># of 10, and generate three datasets</span>
+<span class='no'>d_SFO_SFO_err</span> <span class='kw'>&lt;-</span> <span class='fu'>add_err</span>(<span class='no'>d_SFO_SFO</span>, <span class='kw'>function</span>(<span class='no'>x</span>) <span class='fl'>10</span>, <span class='kw'>n</span> <span class='kw'>=</span> <span class='fl'>3</span>, <span class='kw'>seed</span> <span class='kw'>=</span> <span class='fl'>123456789</span> )
+
+<span class='co'># Name the datasets for nicer plotting</span>
+<span class='fu'>names</span>(<span class='no'>d_SFO_SFO_err</span>) <span class='kw'>&lt;-</span> <span class='fu'>paste</span>(<span class='st'>"Dataset"</span>, <span class='fl'>1</span>:<span class='fl'>3</span>)
+
+<span class='co'># Name the model in the list of models (with only one member in this case)</span>
+<span class='co'># for nicer plotting later on.</span>
+<span class='co'># Be quiet and use the faster Levenberg-Marquardt algorithm, as the datasets</span>
+<span class='co'># are easy and examples are run often. Use only one core not to offend CRAN</span>
+<span class='co'># checks</span>
+<span class='no'>f_SFO_SFO</span> <span class='kw'>&lt;-</span> <span class='fu'>mmkin</span>(<span class='fu'>list</span>(<span class='st'>"SFO-SFO"</span> <span class='kw'>=</span> <span class='no'>m_SFO_SFO</span>),
+ <span class='no'>d_SFO_SFO_err</span>, <span class='kw'>cores</span> <span class='kw'>=</span> <span class='fl'>1</span>,
+ <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>method.modFit</span> <span class='kw'>=</span> <span class='st'>"Marq"</span>)
+
+<span class='fu'>plot</span>(<span class='no'>f_SFO_SFO</span>)</div><img src='unknown-4.png' alt='' width='540' height='400' /><div class='input'>
+<span class='co'># We would like to inspect the fit for dataset 3 more closely</span>
+<span class='co'># Using double brackets makes the returned object an mkinfit object</span>
+<span class='co'># instead of a list of mkinfit objects, so plot.mkinfit is used</span>
+<span class='fu'>plot</span>(<span class='no'>f_SFO_SFO</span><span class='kw'>[[</span><span class='fl'>3</span>]], <span class='kw'>show_residuals</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><img src='unknown-6.png' alt='' width='540' height='400' /><div class='input'>
+<span class='co'># If we use single brackets, we should give two indices (model and dataset),</span>
+<span class='co'># and plot.mmkin is used</span>
+<span class='fu'>plot</span>(<span class='no'>f_SFO_SFO</span>[<span class='fl'>1</span>, <span class='fl'>3</span>])</div><img src='unknown-8.png' alt='' width='540' height='400' /><div class='input'>
+</div></pre>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </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/reference/endpoints.html b/docs/reference/endpoints.html
new file mode 100644
index 00000000..8ceb39d9
--- /dev/null
+++ b/docs/reference/endpoints.html
@@ -0,0 +1,123 @@
+<!-- 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>endpoints. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>This function calculates DT50 and DT90 values as well as formation fractions from kinetic models
+fitted with mkinfit. If the SFORB model was specified for one of the parents or metabolites,
+the Eigenvalues are returned. These are equivalent to the rate constantes of the DFOP model, but
+with the advantage that the SFORB model can also be used for metabolites.</p>
+
+
+ <pre><span class='fu'>endpoints</span>(<span class='no'>fit</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>fit</dt>
+ <dd>
+ An object of class <code>mkinfit</code>.
+ </dd>
+ </dl>
+
+ <div class="Note">
+ <h2>Note</h2>
+
+ <p>The function is used internally by <code>summary.mkinfit</code>.</p>
+ </div>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>A list with the components mentioned above.</p>
+ </div>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </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/reference/geometric_mean.html b/docs/reference/geometric_mean.html
new file mode 100644
index 00000000..1d9a9e66
--- /dev/null
+++ b/docs/reference/geometric_mean.html
@@ -0,0 +1,115 @@
+<!-- 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>geometric_mean. 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> Calculate the geometric mean </h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>Function calculating the geometric mean of numeric vectors</p>
+
+
+ <pre><span class='fu'>geometric_mean</span>(<span class='no'>x</span>, <span class='kw'>na.rm</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>x</dt>
+ <dd> A numeric vector </dd>
+ <dt>na.rm</dt>
+ <dd> Should NA values be ignored </dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>The geometric mean.</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'> <span class='fu'>geometric_mean</span>(<span class='fu'>c</span>(<span class='fl'>1</span>,<span class='fl'>3</span>, <span class='fl'>9</span>))</div><div class='output co'>#&gt; [1] 3
+#&gt; </div><div class='input'> <span class='fu'>geometric_mean</span>(<span class='fu'>c</span>(<span class='fl'>1</span>,<span class='fl'>3</span>, <span class='fl'>NA</span>))</div><div class='output co'>#&gt; [1] NA
+#&gt; </div><div class='input'> <span class='fu'>geometric_mean</span>(<span class='fu'>c</span>(<span class='fl'>1</span>,<span class='fl'>3</span>, <span class='fl'>NA</span>), <span class='kw'>na.rm</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><div class='output co'>#&gt; [1] 1.732051
+#&gt; </div></pre>
+ </div>
+ <div class="col-md-3">
+ </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/reference/ilr.html b/docs/reference/ilr.html
new file mode 100644
index 00000000..355cbb78
--- /dev/null
+++ b/docs/reference/ilr.html
@@ -0,0 +1,152 @@
+<!-- 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>ilr. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>This implementation is a special case of the class of isometric log-ratio transformations.</p>
+
+
+ <pre><span class='fu'>ilr</span>(<span class='no'>x</span>)
+ <span class='fu'>invilr</span>(<span class='no'>x</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>x</dt>
+ <dd>
+ A numeric vector. Naturally, the forward transformation is only sensible for
+ vectors with all elements being greater than zero.
+ </dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>The result of the forward or backward transformation. The returned components always
+ sum to 1 for the case of the inverse log-ratio transformation.</p>
+ </div>
+
+ <div class="References">
+ <h2>References</h2>
+
+ <p>Peter Filzmoser, Karel Hron (2008) Outlier Detection for Compositional Data Using Robust Methods. Math Geosci 40 233-248</p>
+ </div>
+
+ <div class="See also">
+ <h2>See also</h2>
+
+ <p>Another implementation can be found in R package <code>robCompositions</code>.</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='co'># Order matters</span>
+<span class='fu'>ilr</span>(<span class='fu'>c</span>(<span class='fl'>0.1</span>, <span class='fl'>1</span>, <span class='fl'>10</span>))</div><div class='output co'>#&gt; [1] -1.628174 -2.820079
+#&gt; </div><div class='input'><span class='fu'>ilr</span>(<span class='fu'>c</span>(<span class='fl'>10</span>, <span class='fl'>1</span>, <span class='fl'>0.1</span>))</div><div class='output co'>#&gt; [1] 1.628174 2.820079
+#&gt; </div><div class='input'><span class='co'># Equal entries give ilr transformations with zeros as elements</span>
+<span class='fu'>ilr</span>(<span class='fu'>c</span>(<span class='fl'>3</span>, <span class='fl'>3</span>, <span class='fl'>3</span>))</div><div class='output co'>#&gt; [1] 0 0
+#&gt; </div><div class='input'><span class='co'># Almost equal entries give small numbers</span>
+<span class='fu'>ilr</span>(<span class='fu'>c</span>(<span class='fl'>0.3</span>, <span class='fl'>0.4</span>, <span class='fl'>0.3</span>))</div><div class='output co'>#&gt; [1] -0.2034219 0.1174457
+#&gt; </div><div class='input'><span class='co'># Only the ratio between the numbers counts, not their sum</span>
+<span class='fu'>invilr</span>(<span class='fu'>ilr</span>(<span class='fu'>c</span>(<span class='fl'>0.7</span>, <span class='fl'>0.29</span>, <span class='fl'>0.01</span>)))</div><div class='output co'>#&gt; [1] 0.70 0.29 0.01
+#&gt; </div><div class='input'><span class='fu'>invilr</span>(<span class='fu'>ilr</span>(<span class='fl'>2.1</span> * <span class='fu'>c</span>(<span class='fl'>0.7</span>, <span class='fl'>0.29</span>, <span class='fl'>0.01</span>)))</div><div class='output co'>#&gt; [1] 0.70 0.29 0.01
+#&gt; </div><div class='input'><span class='co'># Inverse transformation of larger numbers gives unequal elements</span>
+<span class='fu'>invilr</span>(-<span class='fl'>10</span>)</div><div class='output co'>#&gt; [1] 7.213536e-07 9.999993e-01
+#&gt; </div><div class='input'><span class='fu'>invilr</span>(<span class='fu'>c</span>(-<span class='fl'>10</span>, <span class='fl'>0</span>))</div><div class='output co'>#&gt; [1] 7.207415e-07 9.991507e-01 8.486044e-04
+#&gt; </div><div class='input'><span class='co'># The sum of the elements of the inverse ilr is 1</span>
+<span class='fu'>sum</span>(<span class='fu'>invilr</span>(<span class='fu'>c</span>(-<span class='fl'>10</span>, <span class='fl'>0</span>)))</div><div class='output co'>#&gt; [1] 1
+#&gt; </div><div class='input'><span class='co'># This is why we do not need all elements of the inverse transformation to go back:</span>
+<span class='no'>a</span> <span class='kw'>&lt;-</span> <span class='fu'>c</span>(<span class='fl'>0.1</span>, <span class='fl'>0.3</span>, <span class='fl'>0.5</span>)
+<span class='no'>b</span> <span class='kw'>&lt;-</span> <span class='fu'>invilr</span>(<span class='no'>a</span>)
+<span class='fu'>length</span>(<span class='no'>b</span>) <span class='co'># Four elements</span></div><div class='output co'>#&gt; [1] 4
+#&gt; </div><div class='input'><span class='fu'>ilr</span>(<span class='fu'>c</span>(<span class='no'>b</span>[<span class='fl'>1</span>:<span class='fl'>3</span>], <span class='fl'>1</span> - <span class='fu'>sum</span>(<span class='no'>b</span>[<span class='fl'>1</span>:<span class='fl'>3</span>]))) <span class='co'># Gives c(0.1, 0.3, 0.5)</span></div><div class='output co'>#&gt; [1] 0.1 0.3 0.5
+#&gt; </div></pre>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ René Lehmann and Johannes Ranke
+
+ </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/reference/index.html b/docs/reference/index.html
new file mode 100644
index 00000000..869f61dd
--- /dev/null
+++ b/docs/reference/index.html
@@ -0,0 +1,111 @@
+<!-- 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>Function reference. 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>Function reference <small>version&nbsp;0.9.44.9000</small></h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+ <div class="section ">
+ <h2>Main functions</h2>
+ <p class="section-desc"><p>Essential functionality</p></p>
+
+ <dl class="dl-horizontal">
+ <dt><a href="mkinfit.html">mkinfit</a></dt>
+ <dd>
+</dd>
+ <dt><a href="mkinmod.html">mkinmod</a></dt>
+ <dd>
+</dd>
+ <dt><a href="mmkin.html">mmkin</a></dt>
+ <dd>
+</dd>
+ </dl>
+ </div>
+ <div class="section ">
+ <h2>Show results</h2>
+ <p class="section-desc"></p>
+
+ <dl class="dl-horizontal">
+ </dl>
+ </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/reference/mccall81_245T.html b/docs/reference/mccall81_245T.html
new file mode 100644
index 00000000..edfce55a
--- /dev/null
+++ b/docs/reference/mccall81_245T.html
@@ -0,0 +1,229 @@
+<!-- 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>mccall81_245T. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>Time course of 2,4,5-trichlorophenoxyacetic acid, and the corresponding
+ 2,4,5-trichlorophenol and 2,4,5-trichloroanisole as recovered in diethylether
+ extracts.</p>
+
+
+ <pre><span class='no'>mccall81_245T</span></pre>
+
+ <div class="Format">
+ <h2>Format</h2>
+
+ <p>A dataframe containing the following variables.
+ <dl class='dl-horizontal'>
+ <dt><code>name</code></dt><dd>the name of the compound observed. Note that T245 is used as
+ an acronym for 2,4,5-T. T245 is a legitimate object name
+ in R, which is necessary for specifying models using
+ <code>mkinmod</code>.</dd>
+ <dt><code>time</code></dt><dd>a numeric vector containing sampling times in days after
+ treatment</dd>
+ <dt><code>value</code></dt><dd>a numeric vector containing concentrations in percent of applied radioactivity</dd>
+ <dt><code>soil</code></dt><dd>a factor containing the name of the soil</dd>
+ </dl></p>
+ </div>
+
+ <div class="Source">
+ <h2>Source</h2>
+
+ <p>McCall P, Vrona SA, Kelley SS (1981) Fate of uniformly carbon-14 ring labeled 2,4,5-Trichlorophenoxyacetic acid and 2,4-dichlorophenoxyacetic acid. J Agric Chem 29, 100-107
+ <a href = 'http://dx.doi.org/10.1021/jf00103a026'>http://dx.doi.org/10.1021/jf00103a026</a></p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'> <span class='no'>SFO_SFO_SFO</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinmod</span>(<span class='kw'>T245</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"phenol"</span>),
+ <span class='kw'>phenol</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"anisole"</span>),
+ <span class='kw'>anisole</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>))</div><div class='output'><strong class='text-info'>Successfully compiled differential equation model from auto-generated C code.</strong></div><div class='input'> <span class='co'>## Not run: ------------------------------------</span>
+<span class='co'># fit.1 &lt;- mkinfit(SFO_SFO_SFO, subset(mccall81_245T, soil == "Commerce"))</span>
+<span class='co'># summary(fit.1, data = FALSE)</span>
+<span class='co'># </span>
+<span class='co'>## ---------------------------------------------</span>
+ <span class='co'># No covariance matrix and k_phenol_sink is really small, therefore fix it to zero</span>
+ <span class='no'>fit.2</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO_SFO</span>, <span class='fu'>subset</span>(<span class='no'>mccall81_245T</span>, <span class='no'>soil</span> <span class='kw'>==</span> <span class='st'>"Commerce"</span>),
+ <span class='kw'>parms.ini</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='kw'>k_phenol_sink</span> <span class='kw'>=</span> <span class='fl'>0</span>),
+ <span class='kw'>fixed_parms</span> <span class='kw'>=</span> <span class='st'>"k_phenol_sink"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
+ <span class='fu'>summary</span>(<span class='no'>fit.2</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</div><div class='output co'>#&gt; mkin version: 0.9.44.9000
+#&gt; R version: 3.3.1
+#&gt; Date of fit: Thu Oct 6 09:17:57 2016
+#&gt; Date of summary: Thu Oct 6 09:17:57 2016
+#&gt;
+#&gt; Equations:
+#&gt; d_T245 = - k_T245_sink * T245 - k_T245_phenol * T245
+#&gt; d_phenol = + k_T245_phenol * T245 - k_phenol_sink * phenol -
+#&gt; k_phenol_anisole * phenol
+#&gt; d_anisole = + k_phenol_anisole * phenol - k_anisole_sink * anisole
+#&gt;
+#&gt; Model predictions using solution type deSolve
+#&gt;
+#&gt; Fitted with method Port using 246 model solutions performed in 1.508 s
+#&gt;
+#&gt; Weighting: none
+#&gt;
+#&gt; Starting values for parameters to be optimised:
+#&gt; value type
+#&gt; T245_0 100.9000 state
+#&gt; k_T245_sink 0.1000 deparm
+#&gt; k_T245_phenol 0.1001 deparm
+#&gt; k_phenol_anisole 0.1002 deparm
+#&gt; k_anisole_sink 0.1003 deparm
+#&gt;
+#&gt; Starting values for the transformed parameters actually optimised:
+#&gt; value lower upper
+#&gt; T245_0 100.900000 -Inf Inf
+#&gt; log_k_T245_sink -2.302585 -Inf Inf
+#&gt; log_k_T245_phenol -2.301586 -Inf Inf
+#&gt; log_k_phenol_anisole -2.300587 -Inf Inf
+#&gt; log_k_anisole_sink -2.299590 -Inf Inf
+#&gt;
+#&gt; Fixed parameter values:
+#&gt; value type
+#&gt; phenol_0 0 state
+#&gt; anisole_0 0 state
+#&gt; k_phenol_sink 0 deparm
+#&gt;
+#&gt; Optimised, transformed parameters with symmetric confidence intervals:
+#&gt; Estimate Std. Error Lower Upper
+#&gt; T245_0 103.9000 2.35200 98.930 108.8000
+#&gt; log_k_T245_sink -4.1130 0.13250 -4.390 -3.8350
+#&gt; log_k_T245_phenol -3.6120 0.05002 -3.716 -3.5070
+#&gt; log_k_phenol_anisole -0.9037 0.30580 -1.544 -0.2637
+#&gt; log_k_anisole_sink -5.0090 0.11180 -5.243 -4.7750
+#&gt;
+#&gt; Parameter correlation:
+#&gt; T245_0 log_k_T245_sink log_k_T245_phenol
+#&gt; T245_0 1.00000 0.63761 -0.1742
+#&gt; log_k_T245_sink 0.63761 1.00000 -0.3831
+#&gt; log_k_T245_phenol -0.17416 -0.38313 1.0000
+#&gt; log_k_phenol_anisole -0.05948 0.08745 -0.3047
+#&gt; log_k_anisole_sink -0.16208 -0.60469 0.5227
+#&gt; log_k_phenol_anisole log_k_anisole_sink
+#&gt; T245_0 -0.05948 -0.1621
+#&gt; log_k_T245_sink 0.08745 -0.6047
+#&gt; log_k_T245_phenol -0.30470 0.5227
+#&gt; log_k_phenol_anisole 1.00000 -0.1774
+#&gt; log_k_anisole_sink -0.17744 1.0000
+#&gt;
+#&gt; Residual standard error: 2.706 on 19 degrees of freedom
+#&gt;
+#&gt; Backtransformed parameters:
+#&gt; Confidence intervals for internally transformed parameters are asymmetric.
+#&gt; t-test (unrealistically) based on the assumption of normal distribution
+#&gt; for estimators of untransformed parameters.
+#&gt; Estimate t value Pr(&gt;t) Lower Upper
+#&gt; T245_0 1.039e+02 44.160 6.462e-21 98.930000 108.80000
+#&gt; k_T245_sink 1.636e-02 7.545 1.978e-07 0.012400 0.02159
+#&gt; k_T245_phenol 2.701e-02 19.990 1.607e-14 0.024320 0.02999
+#&gt; k_phenol_anisole 4.051e-01 3.270 2.014e-03 0.213600 0.76820
+#&gt; k_anisole_sink 6.679e-03 8.942 1.544e-08 0.005285 0.00844
+#&gt;
+#&gt; Chi2 error levels in percent:
+#&gt; err.min n.optim df
+#&gt; All data 9.831 5 17
+#&gt; T245 7.908 3 5
+#&gt; phenol 99.808 1 6
+#&gt; anisole 5.379 1 6
+#&gt;
+#&gt; Resulting formation fractions:
+#&gt; ff
+#&gt; T245_sink 0.3772
+#&gt; T245_phenol 0.6228
+#&gt; phenol_anisole 1.0000
+#&gt; phenol_sink 0.0000
+#&gt; anisole_sink 1.0000
+#&gt;
+#&gt; Estimated disappearance times:
+#&gt; DT50 DT90
+#&gt; T245 15.982 53.091
+#&gt; phenol 1.711 5.685
+#&gt; anisole 103.784 344.763
+#&gt; </div></pre>
+ </div>
+ <div class="col-md-3">
+ </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/reference/mkin_long_to_wide.html b/docs/reference/mkin_long_to_wide.html
new file mode 100644
index 00000000..5b1a8353
--- /dev/null
+++ b/docs/reference/mkin_long_to_wide.html
@@ -0,0 +1,152 @@
+<!-- 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>mkin_long_to_wide. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>This function takes a dataframe in the long form as required by <code>modCost</code>
+ and converts it into a dataframe with one independent variable and several
+ dependent variables as columns.</p>
+
+
+ <pre><span class='fu'>mkin_long_to_wide</span>(<span class='no'>long_data</span>, <span class='kw'>time</span> <span class='kw'>=</span> <span class='st'>"time"</span>, <span class='kw'>outtime</span> <span class='kw'>=</span> <span class='st'>"time"</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>long_data</dt>
+ <dd>
+ The dataframe must contain one variable called &quot;time&quot; with the time values specified by the
+ <code>time</code> argument, one column called &quot;name&quot; with the grouping of the observed values, and
+ finally one column of observed values called &quot;value&quot;.
+</dd>
+ <dt>time</dt>
+ <dd>
+ The name of the time variable in the long input data.
+</dd>
+ <dt>outtime</dt>
+ <dd>
+ The name of the time variable in the wide output data.
+</dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>Dataframe in wide format.</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='fu'>mkin_long_to_wide</span>(<span class='no'>FOCUS_2006_D</span>)</div><div class='output co'>#&gt; time parent m1
+#&gt; 1 0 99.46 0.00
+#&gt; 2 0 102.04 0.00
+#&gt; 3 1 93.50 4.84
+#&gt; 4 1 92.50 5.64
+#&gt; 5 3 63.23 12.91
+#&gt; 6 3 68.99 12.96
+#&gt; 7 7 52.32 22.97
+#&gt; 8 7 55.13 24.47
+#&gt; 9 14 27.27 41.69
+#&gt; 10 14 26.64 33.21
+#&gt; 11 21 11.50 44.37
+#&gt; 12 21 11.64 46.44
+#&gt; 13 35 2.85 41.22
+#&gt; 14 35 2.91 37.95
+#&gt; 15 50 0.69 41.19
+#&gt; 16 50 0.63 40.01
+#&gt; 17 75 0.05 40.09
+#&gt; 18 75 0.06 33.85
+#&gt; 19 100 NA 31.04
+#&gt; 20 100 NA 33.13
+#&gt; 21 120 NA 25.15
+#&gt; 22 120 NA 33.31
+#&gt; </div></pre>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </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/reference/mkin_wide_to_long.html b/docs/reference/mkin_wide_to_long.html
new file mode 100644
index 00000000..2a70ebbe
--- /dev/null
+++ b/docs/reference/mkin_wide_to_long.html
@@ -0,0 +1,131 @@
+<!-- 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>mkin_wide_to_long. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>This function simply takes a dataframe with one independent variable and several
+ dependent variable and converts it into the long form as required by <code>modCost</code>.</p>
+
+
+ <pre><span class='fu'>mkin_wide_to_long</span>(<span class='no'>wide_data</span>, <span class='kw'>time</span> <span class='kw'>=</span> <span class='st'>"t"</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>wide_data</dt>
+ <dd>
+ The dataframe must contain one variable with the time values specified by the
+ <code>time</code> argument and usually more than one column of observed values.
+</dd>
+ <dt>time</dt>
+ <dd>
+ The name of the time variable.
+</dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>Dataframe in long format as needed for <code>modCost</code>.</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='no'>wide</span> <span class='kw'>&lt;-</span> <span class='fu'>data.frame</span>(<span class='kw'>t</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='fl'>1</span>,<span class='fl'>2</span>,<span class='fl'>3</span>), <span class='kw'>x</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='fl'>1</span>,<span class='fl'>4</span>,<span class='fl'>7</span>), <span class='kw'>y</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='fl'>3</span>,<span class='fl'>4</span>,<span class='fl'>5</span>))
+<span class='fu'>mkin_wide_to_long</span>(<span class='no'>wide</span>)</div><div class='output co'>#&gt; name time value
+#&gt; 1 x 1 1
+#&gt; 2 x 2 4
+#&gt; 3 x 3 7
+#&gt; 4 y 1 3
+#&gt; 5 y 2 4
+#&gt; 6 y 3 5
+#&gt; </div></pre>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </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/reference/mkinds.html b/docs/reference/mkinds.html
new file mode 100644
index 00000000..0b4341aa
--- /dev/null
+++ b/docs/reference/mkinds.html
@@ -0,0 +1,120 @@
+<!-- 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>mkinds. 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>A dataset class for mkin</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>A dataset class for mkin</p>
+
+
+ <pre><span class='no'>mkinds</span></pre>
+
+ <div class="Format">
+ <h2>Format</h2>
+
+ <p>An <code>R6Class</code> generator object.</p>
+ </div>
+
+ <div class="Fields">
+ <h2>Fields</h2>
+
+ <p></p>
+ <p><dl class='dl-horizontal'>
+<dt><code>title</code></dt><dd>A full title for the dataset</dd></p>
+ <p><dt><code>sampling</code></dt><dd>times The sampling times</dd></p>
+ <p><dt><code>time_unit</code></dt><dd>The time unit</dd></p>
+ <p><dt><code>observed</code></dt><dd>Names of the observed compounds</dd></p>
+ <p><dt><code>unit</code></dt><dd>The unit of the observations</dd></p>
+ <p><dt><code>replicates</code></dt><dd>The number of replicates</dd></p>
+ <p><dt><code>data</code></dt><dd>A dataframe with at least the columns name, time and value
+in order to be compatible with mkinfit</dd>
+</dl></p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='no'>mds</span> <span class='kw'>&lt;-</span> <span class='no'>mkinds</span>$<span class='fu'>new</span>(<span class='st'>"FOCUS A"</span>, <span class='no'>FOCUS_2006_A</span>)</div></pre>
+ </div>
+ <div class="col-md-3">
+ </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/reference/mkinerrmin.html b/docs/reference/mkinerrmin.html
new file mode 100644
index 00000000..cd9faf1a
--- /dev/null
+++ b/docs/reference/mkinerrmin.html
@@ -0,0 +1,150 @@
+<!-- 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>mkinerrmin. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>This function uses <code>optimize</code> in order to iteratively find the
+smallest relative error still resulting in passing the chi-squared test
+as defined in the FOCUS kinetics report from 2006.</p>
+
+
+ <pre><span class='fu'>mkinerrmin</span>(<span class='no'>fit</span>, <span class='kw'>alpha</span> <span class='kw'>=</span> <span class='fl'>0.05</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>fit</dt>
+ <dd>
+ an object of class <code>mkinfit</code>.
+ </dd>
+ <dt>alpha</dt>
+ <dd>
+ The confidence level chosen for the chi-squared test.
+</dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>A dataframe with the following components:</p>
+ <p>The dataframe has one row for the total dataset and one further row for
+ each observed state variable in the model.</p>
+ </div>
+
+ <div class="Details">
+ <h2>Details</h2>
+
+ <p>This function is used internally by <code>summary.mkinfit</code>.</p>
+ </div>
+
+ <div class="References">
+ <h2>References</h2>
+
+ <p>FOCUS (2006) &#8220;Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration&#8221; Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ <a href = 'http://focus.jrc.ec.europa.eu/dk'>http://focus.jrc.ec.europa.eu/dk</a></p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='no'>SFO_SFO</span> <span class='kw'>=</span> <span class='fu'>mkinmod</span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"m1"</span>),
+ <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>),
+ <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output'><strong class='text-info'>Successfully compiled differential equation model from auto-generated C code.</strong></div><div class='input'>
+<span class='no'>fit_FOCUS_D</span> <span class='kw'>=</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
+<span class='fu'>round</span>(<span class='fu'>mkinerrmin</span>(<span class='no'>fit_FOCUS_D</span>), <span class='fl'>4</span>)</div><div class='output co'>#&gt; err.min n.optim df
+#&gt; All data 0.0640 4 15
+#&gt; parent 0.0646 2 7
+#&gt; m1 0.0469 2 8
+#&gt; </div><div class='input'><span class='no'>fit_FOCUS_E</span> <span class='kw'>=</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_E</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
+<span class='fu'>round</span>(<span class='fu'>mkinerrmin</span>(<span class='no'>fit_FOCUS_E</span>), <span class='fl'>4</span>)</div><div class='output co'>#&gt; err.min n.optim df
+#&gt; All data 0.1544 4 13
+#&gt; parent 0.1659 2 7
+#&gt; m1 0.1095 2 6
+#&gt; </div></pre>
+ </div>
+ <div class="col-md-3">
+ </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/reference/mkinfit.html b/docs/reference/mkinfit.html
new file mode 100644
index 00000000..d1441f8b
--- /dev/null
+++ b/docs/reference/mkinfit.html
@@ -0,0 +1,531 @@
+<!-- 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>mkinfit. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>This function uses the Flexible Modelling Environment package
+ <code>FME</code> to create a function calculating the model cost, i.e. the
+ deviation between the kinetic model and the observed data. This model cost is
+ then minimised using the Port algorithm <code>nlminb</code>,
+ using the specified initial or fixed parameters and starting values.
+ Per default, parameters in the kinetic models are internally transformed in order
+ to better satisfy the assumption of a normal distribution of their estimators.
+ In each step of the optimsation, the kinetic model is solved using the
+ function <code>mkinpredict</code>. The variance of the residuals for each
+ observed variable can optionally be iteratively reweighted until convergence
+ using the argument <code>reweight.method = &quot;obs&quot;</code>.</p>
+
+
+ <pre><span class='fu'>mkinfit</span>(<span class='no'>mkinmod</span>, <span class='no'>observed</span>,
+ <span class='kw'>parms.ini</span> <span class='kw'>=</span> <span class='st'>"auto"</span>,
+ <span class='kw'>state.ini</span> <span class='kw'>=</span> <span class='st'>"auto"</span>,
+ <span class='kw'>fixed_parms</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>fixed_initials</span> <span class='kw'>=</span> <span class='fu'>names</span>(<span class='no'>mkinmod</span>$<span class='no'>diffs</span>)[-<span class='fl'>1</span>],
+ <span class='kw'>from_max_mean</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
+ <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='st'>"auto"</span>, <span class='st'>"analytical"</span>, <span class='st'>"eigen"</span>, <span class='st'>"deSolve"</span>),
+ <span class='kw'>method.ode</span> <span class='kw'>=</span> <span class='st'>"lsoda"</span>,
+ <span class='kw'>use_compiled</span> <span class='kw'>=</span> <span class='st'>"auto"</span>,
+ <span class='kw'>method.modFit</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='st'>"Port"</span>, <span class='st'>"Marq"</span>, <span class='st'>"SANN"</span>, <span class='st'>"Nelder-Mead"</span>, <span class='st'>"BFGS"</span>, <span class='st'>"CG"</span>, <span class='st'>"L-BFGS-B"</span>),
+ <span class='kw'>maxit.modFit</span> <span class='kw'>=</span> <span class='st'>"auto"</span>,
+ <span class='kw'>control.modFit</span> <span class='kw'>=</span> <span class='fu'>list</span>(),
+ <span class='kw'>transform_rates</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
+ <span class='kw'>transform_fractions</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
+ <span class='kw'>plot</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>err</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>weight</span> <span class='kw'>=</span> <span class='st'>"none"</span>,
+ <span class='kw'>scaleVar</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
+ <span class='kw'>atol</span> <span class='kw'>=</span> <span class='fl'>1e-8</span>, <span class='kw'>rtol</span> <span class='kw'>=</span> <span class='fl'>1e-10</span>, <span class='kw'>n.outtimes</span> <span class='kw'>=</span> <span class='fl'>100</span>,
+ <span class='kw'>reweight.method</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
+ <span class='kw'>reweight.tol</span> <span class='kw'>=</span> <span class='fl'>1e-8</span>, <span class='kw'>reweight.max.iter</span> <span class='kw'>=</span> <span class='fl'>10</span>,
+ <span class='kw'>trace_parms</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='no'>...</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>mkinmod</dt>
+ <dd>
+ A list of class <code>mkinmod</code>, containing the kinetic model to be
+ fitted to the data, or one of the shorthand names (&quot;SFO&quot;, &quot;FOMC&quot;, &quot;DFOP&quot;,
+ &quot;HS&quot;, &quot;SFORB&quot;). If a shorthand name is given, a parent only degradation
+ model is generated for the variable with the highest value in
+ <code>observed</code>.
+ </dd>
+ <dt>observed</dt>
+ <dd>
+ The observed data. It has to be in the long format as described in
+ <code>modFit</code>, i.e. the first column called &quot;name&quot; must contain the
+ name of the observed variable for each data point. The second column must
+ contain the times of observation, named &quot;time&quot;. The third column must be
+ named &quot;value&quot; and contain the observed values. Optionally, a further column
+ can contain weights for each data point. Its name must be passed as a
+ further argument named <code>err</code> which is then passed on to
+ <code>modFit</code>.
+ </dd>
+ <dt>parms.ini</dt>
+ <dd>
+ A named vector of initial values for the parameters, including parameters
+ to be optimised and potentially also fixed parameters as indicated by
+ <code>fixed_parms</code>. If set to &quot;auto&quot;, initial values for rate constants
+ are set to default values. Using parameter names that are not in the model
+ gives an error.
+
+ It is possible to only specify a subset of the parameters that the model
+ needs. You can use the parameter lists &quot;bparms.ode&quot; from a previously
+ fitted model, which contains the differential equation parameters from this
+ model. This works nicely if the models are nested. An example is given
+ below.
+ </dd>
+ <dt>state.ini</dt>
+ <dd>
+ A named vector of initial values for the state variables of the model. In
+ case the observed variables are represented by more than one model
+ variable, the names will differ from the names of the observed variables
+ (see <code>map</code> component of <code>mkinmod</code>). The default is to set
+ the initial value of the first model variable to the mean of the time zero
+ values for the variable with the maximum observed value, and all others to 0.
+ If this variable has no time zero observations, its initial value is set to 100.
+ </dd>
+ <dt>fixed_parms</dt>
+ <dd>
+ The names of parameters that should not be optimised but rather kept at the
+ values specified in <code>parms.ini</code>.
+ </dd>
+ <dt>fixed_initials</dt>
+ <dd>
+ The names of model variables for which the initial state at time 0 should
+ be excluded from the optimisation. Defaults to all state variables except
+ for the first one.
+ </dd>
+ <dt>from_max_mean</dt>
+ <dd>
+ If this is set to TRUE, and the model has only one observed variable, then
+ data before the time of the maximum observed value (after averaging for each
+ sampling time) are discarded, and this time is subtracted from all
+ remaining time values, so the time of the maximum observed mean value is
+ the new time zero.
+ </dd>
+ <dt>solution_type</dt>
+ <dd>
+ If set to &quot;eigen&quot;, the solution of the system of differential equations is
+ based on the spectral decomposition of the coefficient matrix in cases that
+ this is possible. If set to &quot;deSolve&quot;, a numerical ode solver from package
+ <code>deSolve</code> is used. If set to &quot;analytical&quot;, an analytical
+ solution of the model is used. This is only implemented for simple
+ degradation experiments with only one state variable, i.e. with no
+ metabolites. The default is &quot;auto&quot;, which uses &quot;analytical&quot; if possible,
+ otherwise &quot;eigen&quot; if the model can be expressed using eigenvalues and
+ eigenvectors, and finally &quot;deSolve&quot; for the remaining models (time
+ dependence of degradation rates and metabolites). This argument is passed
+ on to the helper function <code>mkinpredict</code>.
+ </dd>
+ <dt>method.ode</dt>
+ <dd>
+ The solution method passed via <code>mkinpredict</code> to
+ <code>ode</code> in case the solution type is &quot;deSolve&quot;. The default
+ &quot;lsoda&quot; is performant, but sometimes fails to converge.
+ </dd>
+ <dt>use_compiled</dt>
+ <dd>
+ If set to <code>FALSE</code>, no compiled version of the <code>mkinmod</code>
+ model is used, in the calls to <code>mkinpredict</code> even if
+ a compiled verion is present.
+ </dd>
+ <dt>method.modFit</dt>
+ <dd>
+ The optimisation method passed to <code>modFit</code>.
+
+ In order to optimally deal with problems where local minima occur, the
+ &quot;Port&quot; algorithm is now used per default as it is less prone to get trapped
+ in local minima and depends less on starting values for parameters than
+ the Levenberg Marquardt variant selected by &quot;Marq&quot;. However, &quot;Port&quot; needs
+ more iterations.
+
+ The former default &quot;Marq&quot; is the Levenberg Marquardt algorithm
+ <code>nls.lm</code> from the package <code>minpack.lm</code> and usually needs
+ the least number of iterations.
+
+ The &quot;Pseudo&quot; algorithm is not included because it needs finite parameter bounds
+ which are currently not supported.
+
+ The &quot;Newton&quot; algorithm is not included because its number of iterations
+ can not be controlled by <code>control.modFit</code> and it does not appear
+ to provide advantages over the other algorithms.
+ </dd>
+ <dt>maxit.modFit</dt>
+ <dd>
+ Maximum number of iterations in the optimisation. If not &quot;auto&quot;, this will
+ be passed to the method called by <code>modFit</code>, overriding
+ what may be specified in the next argument <code>control.modFit</code>.
+ </dd>
+ <dt>control.modFit</dt>
+ <dd>
+ Additional arguments passed to the optimisation method used by
+ <code>modFit</code>.
+ </dd>
+ <dt>transform_rates</dt>
+ <dd>
+ Boolean specifying if kinetic rate constants should be transformed in the
+ model specification used in the fitting for better compliance with the
+ assumption of normal distribution of the estimator. If TRUE, also
+ alpha and beta parameters of the FOMC model are log-transformed, as well
+ as k1 and k2 rate constants for the DFOP and HS models and the break point
+ tb of the HS model.
+ If FALSE, zero is used as a lower bound for the rates in the optimisation.
+ </dd>
+ <dt>transform_fractions</dt>
+ <dd>
+ Boolean specifying if formation fractions constants should be transformed in the
+ model specification used in the fitting for better compliance with the
+ assumption of normal distribution of the estimator. The default (TRUE) is
+ to do transformations. If TRUE, the g parameter of the DFOP and HS
+ models are also transformed, as they can also be seen as compositional
+ data. The transformation used for these transformations is the
+ <code>ilr</code> transformation.
+ </dd>
+ <dt>plot</dt>
+ <dd>
+ Should the observed values and the numerical solutions be plotted at each
+ stage of the optimisation?
+ </dd>
+ <dt>quiet</dt>
+ <dd>
+ Suppress printing out the current model cost after each improvement?
+ </dd>
+ <dt>err </dt>
+ <dd>either <code>NULL</code>, or the name of the column with the
+ <em>error</em> estimates, used to weigh the residuals (see details of
+ <code>modCost</code>); if <code>NULL</code>, then the residuals are not weighed.
+ </dd>
+ <dt>weight</dt>
+ <dd>
+ only if <code>err</code>=<code>NULL</code>: how to weight the residuals, one of &quot;none&quot;,
+ &quot;std&quot;, &quot;mean&quot;, see details of <code>modCost</code>.
+ </dd>
+ <dt>scaleVar</dt>
+ <dd>
+ Will be passed to <code>modCost</code>. Default is not to scale Variables
+ according to the number of observations.
+ </dd>
+ <dt>atol</dt>
+ <dd>
+ Absolute error tolerance, passed to <code>ode</code>. Default is 1e-8,
+ lower than in <code>lsoda</code>.
+ </dd>
+ <dt>rtol</dt>
+ <dd>
+ Absolute error tolerance, passed to <code>ode</code>. Default is 1e-10,
+ much lower than in <code>lsoda</code>.
+ </dd>
+ <dt>n.outtimes</dt>
+ <dd>
+ The length of the dataseries that is produced by the model prediction
+ function <code>mkinpredict</code>. This impacts the accuracy of
+ the numerical solver if that is used (see <code>solution_type</code> argument.
+ The default value is 100.
+ </dd>
+ <dt>reweight.method</dt>
+ <dd>
+ The method used for iteratively reweighting residuals, also known
+ as iteratively reweighted least squares (IRLS). Default is NULL,
+ the other method implemented is called &quot;obs&quot;, meaning that each
+ observed variable is assumed to have its own variance, this is
+ estimated from the fit and used for weighting the residuals
+ in each iteration until convergence of this estimate up to
+ <code>reweight.tol</code> or up to the maximum number of iterations
+ specified by <code>reweight.max.iter</code>.
+ </dd>
+ <dt>reweight.tol</dt>
+ <dd>
+ Tolerance for convergence criterion for the variance components
+ in IRLS fits.
+ </dd>
+ <dt>reweight.max.iter</dt>
+ <dd>
+ Maximum iterations in IRLS fits.
+ </dd>
+ <dt>trace_parms</dt>
+ <dd>
+ Should a trace of the parameter values be listed?
+ </dd>
+ <dt>&amp;#8230;</dt>
+ <dd>
+ Further arguments that will be passed to <code>modFit</code>.
+ </dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>A list with &quot;mkinfit&quot; and &quot;modFit&quot; in the class attribute.
+ A summary can be obtained by <code>summary.mkinfit</code>.</p>
+ </div>
+
+ <div class="See also">
+ <h2>See also</h2>
+
+ <p>Plotting methods <code>plot.mkinfit</code> and
+ <code>mkinparplot</code>.</p>
+ <p>Fitting of several models to several datasets in a single call to
+ <code>mmkin</code>.</p>
+ </div>
+
+ <div class="Note">
+ <h2>Note</h2>
+
+ <p>The implementation of iteratively reweighted least squares is inspired by the
+ work of the KinGUII team at Bayer Crop Science (Walter Schmitt and Zhenglei
+ Gao). A similar implemention can also be found in CAKE 2.0, which is the
+ other GUI derivative of mkin, sponsored by Syngenta.</p>
+ </div>
+
+ <div class="Note">
+ <h2>Note</h2>
+
+ <p>When using the &quot;IORE&quot; submodel for metabolites, fitting with
+ &quot;transform_rates = TRUE&quot; (the default) often leads to failures of the
+ numerical ODE solver. In this situation it may help to switch off the
+ internal rate transformation.</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='co'># Use shorthand notation for parent only degradation</span>
+<span class='no'>fit</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='st'>"FOMC"</span>, <span class='no'>FOCUS_2006_C</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
+<span class='fu'>summary</span>(<span class='no'>fit</span>)</div><div class='output co'>#&gt; mkin version: 0.9.44.9000
+#&gt; R version: 3.3.1
+#&gt; Date of fit: Thu Oct 6 09:17:59 2016
+#&gt; Date of summary: Thu Oct 6 09:17:59 2016
+#&gt;
+#&gt; Equations:
+#&gt; d_parent = - (alpha/beta) * 1/((time/beta) + 1) * parent
+#&gt;
+#&gt; Model predictions using solution type analytical
+#&gt;
+#&gt; Fitted with method Port using 64 model solutions performed in 0.153 s
+#&gt;
+#&gt; Weighting: none
+#&gt;
+#&gt; Starting values for parameters to be optimised:
+#&gt; value type
+#&gt; parent_0 85.1 state
+#&gt; alpha 1.0 deparm
+#&gt; beta 10.0 deparm
+#&gt;
+#&gt; Starting values for the transformed parameters actually optimised:
+#&gt; value lower upper
+#&gt; parent_0 85.100000 -Inf Inf
+#&gt; log_alpha 0.000000 -Inf Inf
+#&gt; log_beta 2.302585 -Inf Inf
+#&gt;
+#&gt; Fixed parameter values:
+#&gt; None
+#&gt;
+#&gt; Optimised, transformed parameters with symmetric confidence intervals:
+#&gt; Estimate Std. Error Lower Upper
+#&gt; parent_0 85.87000 2.2460 80.38000 91.3700
+#&gt; log_alpha 0.05192 0.1605 -0.34080 0.4446
+#&gt; log_beta 0.65100 0.2801 -0.03452 1.3360
+#&gt;
+#&gt; Parameter correlation:
+#&gt; parent_0 log_alpha log_beta
+#&gt; parent_0 1.0000 -0.2033 -0.3624
+#&gt; log_alpha -0.2033 1.0000 0.9547
+#&gt; log_beta -0.3624 0.9547 1.0000
+#&gt;
+#&gt; Residual standard error: 2.275 on 6 degrees of freedom
+#&gt;
+#&gt; Backtransformed parameters:
+#&gt; Confidence intervals for internally transformed parameters are asymmetric.
+#&gt; t-test (unrealistically) based on the assumption of normal distribution
+#&gt; for estimators of untransformed parameters.
+#&gt; Estimate t value Pr(&gt;t) Lower Upper
+#&gt; parent_0 85.870 38.230 1.069e-08 80.3800 91.370
+#&gt; alpha 1.053 6.231 3.953e-04 0.7112 1.560
+#&gt; beta 1.917 3.570 5.895e-03 0.9661 3.806
+#&gt;
+#&gt; Chi2 error levels in percent:
+#&gt; err.min n.optim df
+#&gt; All data 6.657 3 6
+#&gt; parent 6.657 3 6
+#&gt;
+#&gt; Estimated disappearance times:
+#&gt; DT50 DT90 DT50back
+#&gt; parent 1.785 15.15 4.56
+#&gt;
+#&gt; Data:
+#&gt; time variable observed predicted residual
+#&gt; 0 parent 85.1 85.875 -0.7749
+#&gt; 1 parent 57.9 55.191 2.7091
+#&gt; 3 parent 29.9 31.845 -1.9452
+#&gt; 7 parent 14.6 17.012 -2.4124
+#&gt; 14 parent 9.7 9.241 0.4590
+#&gt; 28 parent 6.6 4.754 1.8460
+#&gt; 63 parent 4.0 2.102 1.8977
+#&gt; 91 parent 3.9 1.441 2.4590
+#&gt; 119 parent 0.6 1.092 -0.4919
+#&gt; </div><div class='input'>
+<span class='co'># One parent compound, one metabolite, both single first order.</span>
+<span class='co'># Use mkinsub for convenience in model formulation. Pathway to sink included per default.</span>
+<span class='no'>SFO_SFO</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinmod</span>(
+ <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>, <span class='st'>"m1"</span>),
+ <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>))</div><div class='output'><strong class='text-info'>Successfully compiled differential equation model from auto-generated C code.</strong></div><div class='input'><span class='co'># Fit the model to the FOCUS example dataset D using defaults</span>
+<span class='fu'>print</span>(<span class='fu'>system.time</span>(<span class='no'>fit</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_D</span>,
+ <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"eigen"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)))</div><div class='output co'>#&gt; user system elapsed
+#&gt; 1.252 1.176 0.914
+#&gt; </div><div class='input'><span class='fu'>coef</span>(<span class='no'>fit</span>)</div><div class='output co'>#&gt; parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink
+#&gt; 99.59848 -3.03822 -2.98030 -5.24750
+#&gt; </div><div class='input'><span class='fu'>endpoints</span>(<span class='no'>fit</span>)</div><div class='output co'>#&gt; $ff
+#&gt; parent_sink parent_m1 m1_sink
+#&gt; 0.485524 0.514476 1.000000
+#&gt;
+#&gt; $SFORB
+#&gt; logical(0)
+#&gt;
+#&gt; $distimes
+#&gt; DT50 DT90
+#&gt; parent 7.022929 23.32967
+#&gt; m1 131.760712 437.69961
+#&gt;
+#&gt; </div><div class='input'><span class='co'>## Not run: ------------------------------------</span>
+<span class='co'># # deSolve is slower when no C compiler (gcc) was available during model generation</span>
+<span class='co'># print(system.time(fit.deSolve &lt;- mkinfit(SFO_SFO, FOCUS_2006_D, </span>
+<span class='co'># solution_type = "deSolve")))</span>
+<span class='co'># coef(fit.deSolve)</span>
+<span class='co'># endpoints(fit.deSolve)</span>
+<span class='co'>## ---------------------------------------------</span>
+
+<span class='co'># Use stepwise fitting, using optimised parameters from parent only fit, FOMC</span>
+<span class='co'>## Not run: ------------------------------------</span>
+<span class='co'># FOMC_SFO &lt;- mkinmod(</span>
+<span class='co'># parent = mkinsub("FOMC", "m1"),</span>
+<span class='co'># m1 = mkinsub("SFO"))</span>
+<span class='co'># # Fit the model to the FOCUS example dataset D using defaults</span>
+<span class='co'># fit.FOMC_SFO &lt;- mkinfit(FOMC_SFO, FOCUS_2006_D)</span>
+<span class='co'># # Use starting parameters from parent only FOMC fit</span>
+<span class='co'># fit.FOMC = mkinfit("FOMC", FOCUS_2006_D, plot=TRUE)</span>
+<span class='co'># fit.FOMC_SFO &lt;- mkinfit(FOMC_SFO, FOCUS_2006_D, </span>
+<span class='co'># parms.ini = fit.FOMC$bparms.ode, plot=TRUE)</span>
+<span class='co'># </span>
+<span class='co'># # Use stepwise fitting, using optimised parameters from parent only fit, SFORB</span>
+<span class='co'># SFORB_SFO &lt;- mkinmod(</span>
+<span class='co'># parent = list(type = "SFORB", to = "m1", sink = TRUE),</span>
+<span class='co'># m1 = list(type = "SFO"))</span>
+<span class='co'># # Fit the model to the FOCUS example dataset D using defaults</span>
+<span class='co'># fit.SFORB_SFO &lt;- mkinfit(SFORB_SFO, FOCUS_2006_D)</span>
+<span class='co'># fit.SFORB_SFO.deSolve &lt;- mkinfit(SFORB_SFO, FOCUS_2006_D, solution_type = "deSolve")</span>
+<span class='co'># # Use starting parameters from parent only SFORB fit (not really needed in this case)</span>
+<span class='co'># fit.SFORB = mkinfit("SFORB", FOCUS_2006_D)</span>
+<span class='co'># fit.SFORB_SFO &lt;- mkinfit(SFORB_SFO, FOCUS_2006_D, parms.ini = fit.SFORB$bparms.ode)</span>
+<span class='co'>## ---------------------------------------------</span>
+
+<span class='co'>## Not run: ------------------------------------</span>
+<span class='co'># # Weighted fits, including IRLS</span>
+<span class='co'># SFO_SFO.ff &lt;- mkinmod(parent = mkinsub("SFO", "m1"),</span>
+<span class='co'># m1 = mkinsub("SFO"), use_of_ff = "max")</span>
+<span class='co'># f.noweight &lt;- mkinfit(SFO_SFO.ff, FOCUS_2006_D)</span>
+<span class='co'># summary(f.noweight)</span>
+<span class='co'># f.irls &lt;- mkinfit(SFO_SFO.ff, FOCUS_2006_D, reweight.method = "obs")</span>
+<span class='co'># summary(f.irls)</span>
+<span class='co'># f.w.mean &lt;- mkinfit(SFO_SFO.ff, FOCUS_2006_D, weight = "mean")</span>
+<span class='co'># summary(f.w.mean)</span>
+<span class='co'># f.w.value &lt;- mkinfit(SFO_SFO.ff, subset(FOCUS_2006_D, value != 0), err = "value")</span>
+<span class='co'># summary(f.w.value)</span>
+<span class='co'>## ---------------------------------------------</span>
+
+<span class='co'>## Not run: ------------------------------------</span>
+<span class='co'># # Manual weighting</span>
+<span class='co'># dw &lt;- FOCUS_2006_D</span>
+<span class='co'># errors &lt;- c(parent = 2, m1 = 1)</span>
+<span class='co'># dw$err.man &lt;- errors[FOCUS_2006_D$name]</span>
+<span class='co'># f.w.man &lt;- mkinfit(SFO_SFO.ff, dw, err = "err.man")</span>
+<span class='co'># summary(f.w.man)</span>
+<span class='co'># f.w.man.irls &lt;- mkinfit(SFO_SFO.ff, dw, err = "err.man",</span>
+<span class='co'># reweight.method = "obs")</span>
+<span class='co'># summary(f.w.man.irls)</span>
+<span class='co'>## ---------------------------------------------</span></div></pre>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </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/reference/mkinmod.html b/docs/reference/mkinmod.html
new file mode 100644
index 00000000..9dd8fca0
--- /dev/null
+++ b/docs/reference/mkinmod.html
@@ -0,0 +1,206 @@
+<!-- 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>mkinmod. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>The function usually takes several expressions, each assigning a compound name to
+ a list, specifying the kinetic model type and reaction or transfer to other
+ observed compartments. Instead of specifying several expressions, a list
+ of lists can be given in the speclist argument.</p>
+
+ <p>For the definition of model types and their parameters, the equations given
+ in the FOCUS and NAFTA guidance documents are used.</p>
+
+
+ <pre><span class='fu'>mkinmod</span>(<span class='no'>...</span>, <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"min"</span>, <span class='kw'>speclist</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>...</dt>
+ <dd>
+ For each observed variable, a list has to be specified as an argument, containing
+ at least a component <code>type</code>, specifying the type of kinetics to use
+ for the variable. Currently, single first order kinetics &quot;SFO&quot;,
+ indeterminate order rate equation kinetics &quot;IORE&quot;, or
+ single first order with reversible binding &quot;SFORB&quot; are implemented for all
+ variables, while
+ &quot;FOMC&quot;, &quot;DFOP&quot; and &quot;HS&quot; can additionally be chosen for the first
+ variable which is assumed to be the source compartment.
+ Additionally, each component of the list can include a character vector <code>to</code>,
+ specifying names of variables to which a transfer is to be assumed in the
+ model.
+ If the argument <code>use_of_ff</code> is set to &quot;min&quot; (default) and the model for
+ the compartment is &quot;SFO&quot; or &quot;SFORB&quot;, an additional component of the list
+ can be &quot;sink=FALSE&quot; effectively fixing the flux to sink to zero.
+ </dd>
+ <dt>use_of_ff</dt>
+ <dd>
+ Specification of the use of formation fractions in the model equations and, if
+ applicable, the coefficient matrix. If &quot;min&quot;, a minimum use of formation
+ fractions is made in order to avoid fitting the product of formation fractions
+ and rate constants. If &quot;max&quot;, formation fractions are always used.
+ </dd>
+ <dt>speclist</dt>
+ <dd>
+ The specification of the observed variables and their submodel types and
+ pathways can be given as a single list using this argument. Default is NULL.
+ </dd>
+ <dt>quiet</dt>
+ <dd>
+ Should messages be suppressed?
+ </dd>
+ <dt>verbose</dt>
+ <dd>
+ If <code>TRUE</code>, passed to <code>cfunction</code> if applicable to give
+ detailed information about the C function being built.
+ </dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>A list of class <code>mkinmod</code> for use with <code>mkinfit</code>, containing</p>
+ </div>
+
+ <div class="Note">
+ <h2>Note</h2>
+
+ <p>The IORE submodel is not well tested (yet). When using this model for metabolites,
+ you may want to read the second note in the help page to
+ <code>mkinfit</code>.</p>
+ </div>
+
+ <div class="References">
+ <h2>References</h2>
+
+ <p>FOCUS (2006) &#8220;Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration&#8221; Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ <a href = 'http://focus.jrc.ec.europa.eu/dk'>http://focus.jrc.ec.europa.eu/dk</a></p>
+ <p>NAFTA Technical Working Group on Pesticides (not dated) Guidance for
+ Evaluating and Calculating Degradation Kinetics in Environmental
+ Media</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='co'># Specify the SFO model (this is not needed any more, as we can now mkinfit("SFO", ...)</span>
+<span class='no'>SFO</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinmod</span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>))
+
+<span class='co'># One parent compound, one metabolite, both single first order</span>
+<span class='no'>SFO_SFO</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinmod</span>(
+ <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>, <span class='st'>"m1"</span>),
+ <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>))</div><div class='output'><strong class='text-info'>Successfully compiled differential equation model from auto-generated C code.</strong></div><div class='input'>
+<span class='co'>## Not run: ------------------------------------</span>
+<span class='co'># # The above model used to be specified like this, before the advent of mkinsub()</span>
+<span class='co'># SFO_SFO &lt;- mkinmod(</span>
+<span class='co'># parent = list(type = "SFO", to = "m1"),</span>
+<span class='co'># m1 = list(type = "SFO"))</span>
+<span class='co'># </span>
+<span class='co'># # Show details of creating the C function</span>
+<span class='co'># SFO_SFO &lt;- mkinmod(</span>
+<span class='co'># parent = mkinsub("SFO", "m1"),</span>
+<span class='co'># m1 = mkinsub("SFO"), verbose = TRUE)</span>
+<span class='co'># </span>
+<span class='co'># # If we have several parallel metabolites </span>
+<span class='co'># # (compare tests/testthat/test_synthetic_data_for_UBA_2014.R)</span>
+<span class='co'># m_synth_DFOP_par &lt;- mkinmod(parent = mkinsub("DFOP", c("M1", "M2")),</span>
+<span class='co'># M1 = mkinsub("SFO"),</span>
+<span class='co'># M2 = mkinsub("SFO"),</span>
+<span class='co'># use_of_ff = "max", quiet = TRUE)</span>
+<span class='co'># </span>
+<span class='co'># fit_DFOP_par_c &lt;- mkinfit(m_synth_DFOP_par, </span>
+<span class='co'># synthetic_data_for_UBA_2014[[12]]$data,</span>
+<span class='co'># quiet = TRUE)</span>
+<span class='co'>## ---------------------------------------------</span></div></pre>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </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/reference/mkinparplot.html b/docs/reference/mkinparplot.html
new file mode 100644
index 00000000..f2fae22d
--- /dev/null
+++ b/docs/reference/mkinparplot.html
@@ -0,0 +1,122 @@
+<!-- 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>mkinparplot. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>This function plots the confidence intervals for the parameters
+ fitted using <code>mkinfit</code>.</p>
+
+
+ <pre><span class='fu'>mkinparplot</span>(<span class='no'>object</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>object</dt>
+ <dd>
+ A fit represented in an <code>mkinfit</code> object.
+ </dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>Nothing is returned by this function, as it is called for its side effect, namely to produce a plot.</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='no'>model</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinmod</span>(
+ <span class='kw'>T245</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='st'>"phenol"</span>), <span class='kw'>sink</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>),
+ <span class='kw'>phenol</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='st'>"anisole"</span>)),
+ <span class='kw'>anisole</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output'><strong class='text-info'>Successfully compiled differential equation model from auto-generated C code.</strong></div><div class='input'><span class='no'>fit</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>model</span>, <span class='fu'>subset</span>(<span class='no'>mccall81_245T</span>, <span class='no'>soil</span> <span class='kw'>==</span> <span class='st'>"Commerce"</span>), <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
+<span class='fu'>mkinparplot</span>(<span class='no'>fit</span>)</div><img src='unknown-4.png' alt='' width='540' height='400' /></pre>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </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/reference/mkinplot.html b/docs/reference/mkinplot.html
new file mode 100644
index 00000000..51ca3992
--- /dev/null
+++ b/docs/reference/mkinplot.html
@@ -0,0 +1,118 @@
+<!-- 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>mkinplot. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>Deprecated function. It now only calls the plot method <code>plot.mkinfit</code>.</p>
+
+
+ <pre><span class='fu'>mkinplot</span>(<span class='no'>fit</span>, <span class='no'>...</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>fit</dt>
+ <dd>
+ an object of class <code>mkinfit</code>.
+ </dd>
+ <dt>&amp;#8230;</dt>
+ <dd>
+ further arguments passed to <code>plot.mkinfit</code>.
+</dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>The function is called for its side effect.</p>
+ </div>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </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/reference/mkinpredict.html b/docs/reference/mkinpredict.html
new file mode 100644
index 00000000..730792c1
--- /dev/null
+++ b/docs/reference/mkinpredict.html
@@ -0,0 +1,318 @@
+<!-- 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>mkinpredict. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>This function produces a time series for all the observed variables in a
+ kinetic model as specified by <code>mkinmod</code>, using a specific set of
+ kinetic parameters and initial values for the state variables.</p>
+
+
+ <pre><span class='fu'>mkinpredict</span>(<span class='no'>mkinmod</span>, <span class='no'>odeparms</span>, <span class='no'>odeini</span>, <span class='no'>outtimes</span>, <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"deSolve"</span>,
+ <span class='kw'>use_compiled</span> <span class='kw'>=</span> <span class='st'>"auto"</span>, <span class='kw'>method.ode</span> <span class='kw'>=</span> <span class='st'>"lsoda"</span>, <span class='kw'>atol</span> <span class='kw'>=</span> <span class='fl'>1e-08</span>, <span class='kw'>rtol</span> <span class='kw'>=</span> <span class='fl'>1e-10</span>,
+ <span class='kw'>map_output</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='no'>...</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>mkinmod</dt>
+ <dd>
+ A kinetic model as produced by <code>mkinmod</code>.
+ </dd>
+ <dt>odeparms</dt>
+ <dd>
+ A numeric vector specifying the parameters used in the kinetic model, which
+ is generally defined as a set of ordinary differential equations.
+ </dd>
+ <dt>odeini</dt>
+ <dd>
+ A numeric vectory containing the initial values of the state variables of
+ the model. Note that the state variables can differ from the observed
+ variables, for example in the case of the SFORB model.
+ </dd>
+ <dt>outtimes</dt>
+ <dd>
+ A numeric vector specifying the time points for which model predictions
+ should be generated.
+ </dd>
+ <dt>solution_type</dt>
+ <dd>
+ The method that should be used for producing the predictions. This should
+ generally be &quot;analytical&quot; if there is only one observed variable, and
+ usually &quot;deSolve&quot; in the case of several observed variables. The third
+ possibility &quot;eigen&quot; is faster but not applicable to some models e.g.
+ using FOMC for the parent compound.
+ </dd>
+ <dt>method.ode</dt>
+ <dd>
+ The solution method passed via <code>mkinpredict</code> to
+ <code>ode</code> in case the solution type is &quot;deSolve&quot;. The default
+ &quot;lsoda&quot; is performant, but sometimes fails to converge.
+ </dd>
+ <dt>use_compiled</dt>
+ <dd>
+ If set to <code>FALSE</code>, no compiled version of the <code>mkinmod</code>
+ model is used, even if is present.
+ </dd>
+ <dt>atol</dt>
+ <dd>
+ Absolute error tolerance, passed to <code>ode</code>. Default is 1e-8,
+ lower than in <code>lsoda</code>.
+ </dd>
+ <dt>rtol</dt>
+ <dd>
+ Absolute error tolerance, passed to <code>ode</code>. Default is 1e-10,
+ much lower than in <code>lsoda</code>.
+ </dd>
+ <dt>map_output</dt>
+ <dd>
+ Boolean to specify if the output should list values for the observed
+ variables (default) or for all state variables (if set to FALSE).
+ </dd>
+ <dt>&amp;#8230;</dt>
+ <dd>
+ Further arguments passed to the ode solver in case such a solver is used.
+ </dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>A matrix in the same format as the output of <code>ode</code>.</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'> <span class='no'>SFO</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinmod</span>(<span class='kw'>degradinol</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>))
+ <span class='co'># Compare solution types</span>
+ <span class='fu'>mkinpredict</span>(<span class='no'>SFO</span>, <span class='fu'>c</span>(<span class='kw'>k_degradinol_sink</span> <span class='kw'>=</span> <span class='fl'>0.3</span>), <span class='fu'>c</span>(<span class='kw'>degradinol</span> <span class='kw'>=</span> <span class='fl'>100</span>), <span class='fl'>0</span>:<span class='fl'>20</span>,
+ <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"analytical"</span>)</div><div class='output co'>#&gt; time degradinol
+#&gt; 1 0 100.0000000
+#&gt; 2 1 74.0818221
+#&gt; 3 2 54.8811636
+#&gt; 4 3 40.6569660
+#&gt; 5 4 30.1194212
+#&gt; 6 5 22.3130160
+#&gt; 7 6 16.5298888
+#&gt; 8 7 12.2456428
+#&gt; 9 8 9.0717953
+#&gt; 10 9 6.7205513
+#&gt; 11 10 4.9787068
+#&gt; 12 11 3.6883167
+#&gt; 13 12 2.7323722
+#&gt; 14 13 2.0241911
+#&gt; 15 14 1.4995577
+#&gt; 16 15 1.1108997
+#&gt; 17 16 0.8229747
+#&gt; 18 17 0.6096747
+#&gt; 19 18 0.4516581
+#&gt; 20 19 0.3345965
+#&gt; 21 20 0.2478752
+#&gt; </div><div class='input'> <span class='fu'>mkinpredict</span>(<span class='no'>SFO</span>, <span class='fu'>c</span>(<span class='kw'>k_degradinol_sink</span> <span class='kw'>=</span> <span class='fl'>0.3</span>), <span class='fu'>c</span>(<span class='kw'>degradinol</span> <span class='kw'>=</span> <span class='fl'>100</span>), <span class='fl'>0</span>:<span class='fl'>20</span>,
+ <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"deSolve"</span>)</div><div class='output co'>#&gt; time degradinol
+#&gt; 1 0 100.0000000
+#&gt; 2 1 74.0818221
+#&gt; 3 2 54.8811636
+#&gt; 4 3 40.6569660
+#&gt; 5 4 30.1194212
+#&gt; 6 5 22.3130160
+#&gt; 7 6 16.5298888
+#&gt; 8 7 12.2456428
+#&gt; 9 8 9.0717953
+#&gt; 10 9 6.7205513
+#&gt; 11 10 4.9787068
+#&gt; 12 11 3.6883167
+#&gt; 13 12 2.7323722
+#&gt; 14 13 2.0241911
+#&gt; 15 14 1.4995577
+#&gt; 16 15 1.1108996
+#&gt; 17 16 0.8229747
+#&gt; 18 17 0.6096747
+#&gt; 19 18 0.4516581
+#&gt; 20 19 0.3345965
+#&gt; 21 20 0.2478752
+#&gt; </div><div class='input'> <span class='fu'>mkinpredict</span>(<span class='no'>SFO</span>, <span class='fu'>c</span>(<span class='kw'>k_degradinol_sink</span> <span class='kw'>=</span> <span class='fl'>0.3</span>), <span class='fu'>c</span>(<span class='kw'>degradinol</span> <span class='kw'>=</span> <span class='fl'>100</span>), <span class='fl'>0</span>:<span class='fl'>20</span>,
+ <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"deSolve"</span>, <span class='kw'>use_compiled</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</div><div class='output co'>#&gt; time degradinol
+#&gt; 1 0 100.0000000
+#&gt; 2 1 74.0818221
+#&gt; 3 2 54.8811636
+#&gt; 4 3 40.6569660
+#&gt; 5 4 30.1194212
+#&gt; 6 5 22.3130160
+#&gt; 7 6 16.5298888
+#&gt; 8 7 12.2456428
+#&gt; 9 8 9.0717953
+#&gt; 10 9 6.7205513
+#&gt; 11 10 4.9787068
+#&gt; 12 11 3.6883167
+#&gt; 13 12 2.7323722
+#&gt; 14 13 2.0241911
+#&gt; 15 14 1.4995577
+#&gt; 16 15 1.1108996
+#&gt; 17 16 0.8229747
+#&gt; 18 17 0.6096747
+#&gt; 19 18 0.4516581
+#&gt; 20 19 0.3345965
+#&gt; 21 20 0.2478752
+#&gt; </div><div class='input'> <span class='fu'>mkinpredict</span>(<span class='no'>SFO</span>, <span class='fu'>c</span>(<span class='kw'>k_degradinol_sink</span> <span class='kw'>=</span> <span class='fl'>0.3</span>), <span class='fu'>c</span>(<span class='kw'>degradinol</span> <span class='kw'>=</span> <span class='fl'>100</span>), <span class='fl'>0</span>:<span class='fl'>20</span>,
+ <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"eigen"</span>)</div><div class='output co'>#&gt; time degradinol
+#&gt; 1 0 100.0000000
+#&gt; 2 1 74.0818221
+#&gt; 3 2 54.8811636
+#&gt; 4 3 40.6569660
+#&gt; 5 4 30.1194212
+#&gt; 6 5 22.3130160
+#&gt; 7 6 16.5298888
+#&gt; 8 7 12.2456428
+#&gt; 9 8 9.0717953
+#&gt; 10 9 6.7205513
+#&gt; 11 10 4.9787068
+#&gt; 12 11 3.6883167
+#&gt; 13 12 2.7323722
+#&gt; 14 13 2.0241911
+#&gt; 15 14 1.4995577
+#&gt; 16 15 1.1108997
+#&gt; 17 16 0.8229747
+#&gt; 18 17 0.6096747
+#&gt; 19 18 0.4516581
+#&gt; 20 19 0.3345965
+#&gt; 21 20 0.2478752
+#&gt; </div><div class='input'>
+
+ <span class='co'># Compare integration methods to analytical solution</span>
+ <span class='fu'>mkinpredict</span>(<span class='no'>SFO</span>, <span class='fu'>c</span>(<span class='kw'>k_degradinol_sink</span> <span class='kw'>=</span> <span class='fl'>0.3</span>), <span class='fu'>c</span>(<span class='kw'>degradinol</span> <span class='kw'>=</span> <span class='fl'>100</span>), <span class='fl'>0</span>:<span class='fl'>20</span>,
+ <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"analytical"</span>)[<span class='fl'>21</span>,]</div><div class='output co'>#&gt; time degradinol
+#&gt; 21 20 0.2478752
+#&gt; </div><div class='input'> <span class='fu'>mkinpredict</span>(<span class='no'>SFO</span>, <span class='fu'>c</span>(<span class='kw'>k_degradinol_sink</span> <span class='kw'>=</span> <span class='fl'>0.3</span>), <span class='fu'>c</span>(<span class='kw'>degradinol</span> <span class='kw'>=</span> <span class='fl'>100</span>), <span class='fl'>0</span>:<span class='fl'>20</span>,
+ <span class='kw'>method</span> <span class='kw'>=</span> <span class='st'>"lsoda"</span>)[<span class='fl'>21</span>,]</div><div class='output co'>#&gt; time degradinol
+#&gt; 21 20 0.2478752
+#&gt; </div><div class='input'> <span class='fu'>mkinpredict</span>(<span class='no'>SFO</span>, <span class='fu'>c</span>(<span class='kw'>k_degradinol_sink</span> <span class='kw'>=</span> <span class='fl'>0.3</span>), <span class='fu'>c</span>(<span class='kw'>degradinol</span> <span class='kw'>=</span> <span class='fl'>100</span>), <span class='fl'>0</span>:<span class='fl'>20</span>,
+ <span class='kw'>method</span> <span class='kw'>=</span> <span class='st'>"ode45"</span>)[<span class='fl'>21</span>,]</div><div class='output co'>#&gt; time degradinol
+#&gt; 21 20 0.2478752
+#&gt; </div><div class='input'> <span class='fu'>mkinpredict</span>(<span class='no'>SFO</span>, <span class='fu'>c</span>(<span class='kw'>k_degradinol_sink</span> <span class='kw'>=</span> <span class='fl'>0.3</span>), <span class='fu'>c</span>(<span class='kw'>degradinol</span> <span class='kw'>=</span> <span class='fl'>100</span>), <span class='fl'>0</span>:<span class='fl'>20</span>,
+ <span class='kw'>method</span> <span class='kw'>=</span> <span class='st'>"rk4"</span>)[<span class='fl'>21</span>,]</div><div class='output co'>#&gt; time degradinol
+#&gt; 21 20 0.2480043
+#&gt; </div><div class='input'> <span class='co'># rk4 is not as precise here</span>
+
+ <span class='co'># The number of output times used to make a lot of difference until the</span>
+ <span class='co'># default for atol was adjusted</span>
+ <span class='fu'>mkinpredict</span>(<span class='no'>SFO</span>, <span class='fu'>c</span>(<span class='kw'>k_degradinol_sink</span> <span class='kw'>=</span> <span class='fl'>0.3</span>), <span class='fu'>c</span>(<span class='kw'>degradinol</span> <span class='kw'>=</span> <span class='fl'>100</span>),
+ <span class='fu'>seq</span>(<span class='fl'>0</span>, <span class='fl'>20</span>, <span class='kw'>by</span> <span class='kw'>=</span> <span class='fl'>0.1</span>))[<span class='fl'>201</span>,]</div><div class='output co'>#&gt; time degradinol
+#&gt; 201 20 0.2478752
+#&gt; </div><div class='input'> <span class='fu'>mkinpredict</span>(<span class='no'>SFO</span>, <span class='fu'>c</span>(<span class='kw'>k_degradinol_sink</span> <span class='kw'>=</span> <span class='fl'>0.3</span>), <span class='fu'>c</span>(<span class='kw'>degradinol</span> <span class='kw'>=</span> <span class='fl'>100</span>),
+ <span class='fu'>seq</span>(<span class='fl'>0</span>, <span class='fl'>20</span>, <span class='kw'>by</span> <span class='kw'>=</span> <span class='fl'>0.01</span>))[<span class='fl'>2001</span>,]</div><div class='output co'>#&gt; time degradinol
+#&gt; 2001 20 0.2478752
+#&gt; </div><div class='input'>
+ <span class='co'># Check compiled model versions - they are faster than the eigenvalue based solutions!</span>
+ <span class='no'>SFO_SFO</span> <span class='kw'>=</span> <span class='fu'>mkinmod</span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"m1"</span>),
+ <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>))</div><div class='output'><strong class='text-info'>Successfully compiled differential equation model from auto-generated C code.</strong></div><div class='input'> <span class='fu'>system.time</span>(
+ <span class='fu'>print</span>(<span class='fu'>mkinpredict</span>(<span class='no'>SFO_SFO</span>, <span class='fu'>c</span>(<span class='kw'>k_parent_m1</span> <span class='kw'>=</span> <span class='fl'>0.05</span>, <span class='kw'>k_parent_sink</span> <span class='kw'>=</span> <span class='fl'>0.1</span>, <span class='kw'>k_m1_sink</span> <span class='kw'>=</span> <span class='fl'>0.01</span>),
+ <span class='fu'>c</span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fl'>100</span>, <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fl'>0</span>), <span class='fu'>seq</span>(<span class='fl'>0</span>, <span class='fl'>20</span>, <span class='kw'>by</span> <span class='kw'>=</span> <span class='fl'>0.1</span>),
+ <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"eigen"</span>)[<span class='fl'>201</span>,]))</div><div class='output co'>#&gt; time parent m1
+#&gt; 201 20 4.978707 27.46227
+#&gt; </div><div class='output co'>#&gt; user system elapsed
+#&gt; 0.000 0.028 0.004
+#&gt; </div><div class='input'> <span class='fu'>system.time</span>(
+ <span class='fu'>print</span>(<span class='fu'>mkinpredict</span>(<span class='no'>SFO_SFO</span>, <span class='fu'>c</span>(<span class='kw'>k_parent_m1</span> <span class='kw'>=</span> <span class='fl'>0.05</span>, <span class='kw'>k_parent_sink</span> <span class='kw'>=</span> <span class='fl'>0.1</span>, <span class='kw'>k_m1_sink</span> <span class='kw'>=</span> <span class='fl'>0.01</span>),
+ <span class='fu'>c</span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fl'>100</span>, <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fl'>0</span>), <span class='fu'>seq</span>(<span class='fl'>0</span>, <span class='fl'>20</span>, <span class='kw'>by</span> <span class='kw'>=</span> <span class='fl'>0.1</span>),
+ <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"deSolve"</span>)[<span class='fl'>201</span>,]))</div><div class='output co'>#&gt; time parent m1
+#&gt; 201 20 4.978707 27.46227
+#&gt; </div><div class='output co'>#&gt; user system elapsed
+#&gt; 0.016 0.004 0.002
+#&gt; </div><div class='input'> <span class='fu'>system.time</span>(
+ <span class='fu'>print</span>(<span class='fu'>mkinpredict</span>(<span class='no'>SFO_SFO</span>, <span class='fu'>c</span>(<span class='kw'>k_parent_m1</span> <span class='kw'>=</span> <span class='fl'>0.05</span>, <span class='kw'>k_parent_sink</span> <span class='kw'>=</span> <span class='fl'>0.1</span>, <span class='kw'>k_m1_sink</span> <span class='kw'>=</span> <span class='fl'>0.01</span>),
+ <span class='fu'>c</span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fl'>100</span>, <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fl'>0</span>), <span class='fu'>seq</span>(<span class='fl'>0</span>, <span class='fl'>20</span>, <span class='kw'>by</span> <span class='kw'>=</span> <span class='fl'>0.1</span>),
+ <span class='kw'>solution_type</span> <span class='kw'>=</span> <span class='st'>"deSolve"</span>, <span class='kw'>use_compiled</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)[<span class='fl'>201</span>,]))</div><div class='output co'>#&gt; time parent m1
+#&gt; 201 20 4.978707 27.46227
+#&gt; </div><div class='output co'>#&gt; user system elapsed
+#&gt; 0.036 0.000 0.035
+#&gt; </div></pre>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </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/reference/mkinresplot.html b/docs/reference/mkinresplot.html
new file mode 100644
index 00000000..fb9ab40d
--- /dev/null
+++ b/docs/reference/mkinresplot.html
@@ -0,0 +1,166 @@
+<!-- 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>mkinresplot. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>This function plots the residuals for the specified subset of the
+ observed variables from an mkinfit object. A combined plot of the fitted
+ model and the residuals can be obtained using <code>plot.mkinfit</code>
+ using the argument <code>show_residuals = TRUE</code>.</p>
+
+
+ <pre><span class='fu'>mkinresplot</span>(<span class='no'>object</span>,
+ <span class='kw'>obs_vars</span> <span class='kw'>=</span> <span class='fu'>names</span>(<span class='no'>object</span>$<span class='no'>mkinmod</span>$<span class='no'>map</span>),
+ <span class='kw'>xlim</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='fl'>0</span>, <span class='fl'>1.1</span> * <span class='fu'>max</span>(<span class='no'>object</span>$<span class='no'>data</span>$<span class='no'>time</span>)),
+ <span class='kw'>xlab</span> <span class='kw'>=</span> <span class='st'>"Time"</span>, <span class='kw'>ylab</span> <span class='kw'>=</span> <span class='st'>"Residual"</span>,
+ <span class='kw'>maxabs</span> <span class='kw'>=</span> <span class='st'>"auto"</span>, <span class='kw'>legend</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>lpos</span> <span class='kw'>=</span> <span class='st'>"topright"</span>, <span class='no'>...</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>object</dt>
+ <dd>
+ A fit represented in an <code>mkinfit</code> object.
+</dd>
+ <dt>obs_vars</dt>
+ <dd>
+ A character vector of names of the observed variables for which residuals
+ should be plotted. Defaults to all observed variables in the model
+</dd>
+ <dt>xlim</dt>
+ <dd>
+ plot range in x direction.
+ </dd>
+ <dt>xlab</dt>
+ <dd>
+ Label for the x axis. Defaults to &quot;Time [days]&quot;.
+</dd>
+ <dt>ylab</dt>
+ <dd>
+ Label for the y axis. Defaults to &quot;Residual [% of applied radioactivity]&quot;.
+</dd>
+ <dt>maxabs</dt>
+ <dd>
+ Maximum absolute value of the residuals. This is used for the scaling of
+ the y axis and defaults to &quot;auto&quot;.
+</dd>
+ <dt>legend</dt>
+ <dd>
+ Should a legend be plotted? Defaults to &quot;TRUE&quot;.
+</dd>
+ <dt>lpos</dt>
+ <dd>
+ Where should the legend be placed? Default is &quot;topright&quot;. Will be passed on to
+ <code>legend</code>. </dd>
+ <dt>&amp;#8230;</dt>
+ <dd>
+ further arguments passed to <code>plot</code>.
+</dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>Nothing is returned by this function, as it is called for its side effect, namely to produce a plot.</p>
+ </div>
+
+ <div class="See also">
+ <h2>See also</h2>
+
+ <p><code>mkinplot</code>, for a way to plot the data and the fitted lines of the
+ mkinfit object.</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='no'>model</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinmod</span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>, <span class='st'>"m1"</span>), <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>))</div><div class='output'><strong class='text-info'>Successfully compiled differential equation model from auto-generated C code.</strong></div><div class='input'><span class='no'>fit</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>model</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
+<span class='fu'>mkinresplot</span>(<span class='no'>fit</span>, <span class='st'>"m1"</span>)</div><img src='unknown-4.png' alt='' width='540' height='400' /></pre>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </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/reference/mkinsub.html b/docs/reference/mkinsub.html
new file mode 100644
index 00000000..6b079c40
--- /dev/null
+++ b/docs/reference/mkinsub.html
@@ -0,0 +1,147 @@
+<!-- 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>mkinsub. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>This is a convenience function to set up the lists used as arguments for
+ <code>mkinmod</code>.</p>
+
+
+ <pre><span class='fu'>mkinsub</span>(<span class='no'>submodel</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>sink</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>full_name</span> <span class='kw'>=</span> <span class='fl'>NA</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>submodel</dt>
+ <dd>
+ Character vector of length one to specify the submodel type. See
+ <code>mkinmod</code> for the list of allowed submodel names.
+ </dd>
+ <dt>to</dt>
+ <dd>
+ Vector of the names of the state variable to which a transformation
+ shall be included in the model.
+ </dd>
+ <dt>sink</dt>
+ <dd>
+ Should a pathway to sink be included in the model in addition to the
+ pathways to other state variables?
+ </dd>
+ <dt>full_name</dt>
+ <dd>
+ An optional name to be used e.g. for plotting fits performed with the model.
+ You can use non-ASCII characters here, but then your R code will not be
+ portable, <em>i.e.</em> may produce unintended plot results on other
+ operating systems or system configurations.
+ </dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>A list for use with <code>mkinmod</code>.</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='co'># One parent compound, one metabolite, both single first order.</span>
+<span class='no'>SFO_SFO</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinmod</span>(
+ <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"m1"</span>),
+ <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>))</div><div class='output'><strong class='text-info'>Successfully compiled differential equation model from auto-generated C code.</strong></div><div class='input'>
+<span class='co'># The same model using mkinsub</span>
+<span class='no'>SFO_SFO.2</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinmod</span>(
+ <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>, <span class='st'>"m1"</span>),
+ <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>))</div><div class='output'><strong class='text-info'>Successfully compiled differential equation model from auto-generated C code.</strong></div><div class='input'>
+<span class='co'># Now supplying full names</span>
+<span class='no'>SFO_SFO.2</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinmod</span>(
+ <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>, <span class='st'>"m1"</span>, <span class='kw'>full_name</span> <span class='kw'>=</span> <span class='st'>"Test compound"</span>),
+ <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>, <span class='kw'>full_name</span> <span class='kw'>=</span> <span class='st'>"Metabolite M1"</span>))</div><div class='output'><strong class='text-info'>Successfully compiled differential equation model from auto-generated C code.</strong></div></pre>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </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/reference/mmkin.html b/docs/reference/mmkin.html
new file mode 100644
index 00000000..5b624893
--- /dev/null
+++ b/docs/reference/mmkin.html
@@ -0,0 +1,178 @@
+<!-- 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>mmkin. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>This function calls <code>mkinfit</code> on all combinations of models and datasets
+ specified in its first two arguments.</p>
+
+
+ <pre><span class='fu'>mmkin</span>(<span class='no'>models</span>, <span class='no'>datasets</span>,
+ <span class='kw'>cores</span> <span class='kw'>=</span> <span class='fu'>round</span>(<span class='fu'>detectCores</span>()/<span class='fl'>2</span>), <span class='kw'>cluster</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>...</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>models</dt>
+ <dd>
+ Either a character vector of shorthand names (&quot;SFO&quot;, &quot;FOMC&quot;, &quot;DFOP&quot;,
+ &quot;HS&quot;, &quot;SFORB&quot;), or an optionally named list of <code>mkinmod</code>
+ objects.
+ </dd>
+ <dt>datasets</dt>
+ <dd>
+ An optionally named list of datasets suitable as observed data for
+ <code>mkinfit</code>.
+ </dd>
+ <dt>cores</dt>
+ <dd>
+ The number of cores to be used for multicore processing. This is only
+ used when the <code>cluster</code> argument is <code>NULL</code>.
+ </dd>
+ <dt>cluster</dt>
+ <dd>
+ A cluster as returned by <code>makeCluster</code> to be used for parallel
+ execution.
+ </dd>
+ <dt>&amp;#8230;</dt>
+ <dd>
+ Further arguments that will be passed to <code>mkinfit</code>.
+ </dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>A matrix of <code>mkinfit</code> objects that can be indexed using the model
+ and dataset names as row and column indices.</p>
+ </div>
+
+ <div class="See also">
+ <h2>See also</h2>
+
+ <p><code>[.mmkin</code> for subsetting, <code>plot.mmkin</code> for plotting.</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='co'>## Not run: ------------------------------------</span>
+<span class='co'># m_synth_SFO_lin &lt;- mkinmod(parent = mkinsub("SFO", "M1"),</span>
+<span class='co'># M1 = mkinsub("SFO", "M2"),</span>
+<span class='co'># M2 = mkinsub("SFO"), use_of_ff = "max")</span>
+<span class='co'># </span>
+<span class='co'># m_synth_FOMC_lin &lt;- mkinmod(parent = mkinsub("FOMC", "M1"),</span>
+<span class='co'># M1 = mkinsub("SFO", "M2"),</span>
+<span class='co'># M2 = mkinsub("SFO"), use_of_ff = "max")</span>
+<span class='co'># </span>
+<span class='co'># models &lt;- list(SFO_lin = m_synth_SFO_lin, FOMC_lin = m_synth_FOMC_lin)</span>
+<span class='co'># datasets &lt;- lapply(synthetic_data_for_UBA_2014[1:3], function(x) x$data)</span>
+<span class='co'># names(datasets) &lt;- paste("Dataset", 1:3)</span>
+<span class='co'># </span>
+<span class='co'># time_default &lt;- system.time(fits.0 &lt;- mmkin(models, datasets))</span>
+<span class='co'># time_1 &lt;- system.time(fits.1 &lt;- mmkin(models, datasets, cores = 1))</span>
+<span class='co'># </span>
+<span class='co'># time_default</span>
+<span class='co'># time_1</span>
+<span class='co'># </span>
+<span class='co'># endpoints(fits[["SFO_lin", 2]])</span>
+<span class='co'># </span>
+<span class='co'># # Plot.mkinfit handles rows or columns of mmkin result objects</span>
+<span class='co'># plot(fits.0[1, ])</span>
+<span class='co'># plot(fits.0[1, ], obs_var = c("M1", "M2"))</span>
+<span class='co'># plot(fits.0[, 1])</span>
+<span class='co'># # Use double brackets to extract a single mkinfit object, which will be plotted</span>
+<span class='co'># # by plot.mkinfit</span>
+<span class='co'># plot(fits.0[[1, 1]], sep_obs = TRUE, show_residuals = TRUE, show_errmin = TRUE)</span>
+<span class='co'># # Plotting with mmkin (single brackets, extracting an mmkin object) does not</span>
+<span class='co'># # allow to plot the observed variables separately</span>
+<span class='co'># plot(fits.0[1, 1])</span>
+<span class='co'>## ---------------------------------------------</span></div></pre>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </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/reference/plot.mkinfit.html b/docs/reference/plot.mkinfit.html
new file mode 100644
index 00000000..94aebf63
--- /dev/null
+++ b/docs/reference/plot.mkinfit.html
@@ -0,0 +1,231 @@
+<!-- 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>plot.mkinfit. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>Solves the differential equations with the optimised and fixed parameters
+ from a previous successful call to <code>mkinfit</code> and plots
+ the observed data together with the solution of the fitted model.</p>
+
+
+ <pre># S3 method for mkinfit
+plot(x, fit = x,
+ obs_vars = names(fit$mkinmod$map),
+ xlab = "Time", ylab = "Observed",
+ xlim = range(fit$data$time),
+ ylim = "default",
+ col_obs = 1:length(obs_vars), pch_obs = col_obs,
+ lty_obs = rep(1, length(obs_vars)),
+ add = FALSE, legend = !add,
+ show_residuals = FALSE, maxabs = "auto",
+ sep_obs = FALSE, rel.height.middle = 0.9,
+ lpos = "topright", inset = c(0.05, 0.05),
+ show_errmin = FALSE, errmin_digits = 3, &#8230;)
+plot_sep(fit, sep_obs = TRUE, show_residuals = TRUE, show_errmin = TRUE, &#8230;)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>x</dt>
+ <dd>
+ Alias for fit introduced for compatibility with the generic S3 method.
+ </dd>
+ <dt>fit</dt>
+ <dd>
+ An object of class <code>mkinfit</code>.
+ </dd>
+ <dt>obs_vars</dt>
+ <dd>
+ A character vector of names of the observed variables for which the
+ data and the model should be plotted. Defauls to all observed variables
+ in the model.
+ </dd>
+ <dt>xlab</dt>
+ <dd>
+ Label for the x axis.
+ </dd>
+ <dt>ylab</dt>
+ <dd>
+ Label for the y axis.
+ </dd>
+ <dt>xlim</dt>
+ <dd>
+ Plot range in x direction.
+ </dd>
+ <dt>ylim</dt>
+ <dd>
+ Plot range in y direction.
+ </dd>
+ <dt>col_obs</dt>
+ <dd>
+ Colors used for plotting the observed data and the corresponding model prediction lines.
+ </dd>
+ <dt>pch_obs</dt>
+ <dd>
+ Symbols to be used for plotting the data.
+ </dd>
+ <dt>lty_obs</dt>
+ <dd>
+ Line types to be used for the model predictions.
+ </dd>
+ <dt>add</dt>
+ <dd>
+ Should the plot be added to an existing plot?
+ </dd>
+ <dt>legend</dt>
+ <dd>
+ Should a legend be added to the plot?
+ </dd>
+ <dt>show_residuals</dt>
+ <dd>
+ Should residuals be shown? If only one plot of the fits is shown, the
+ residual plot is in the lower third of the plot? Otherwise, i.e. if
+ &quot;sep_obs&quot; is given, the residual plots will be located to the right of
+ the plots of the fitted curves.
+ </dd>
+ <dt>maxabs</dt>
+ <dd>
+ Maximum absolute value of the residuals. This is used for the scaling of
+ the y axis and defaults to &quot;auto&quot;.
+ </dd>
+ <dt>sep_obs</dt>
+ <dd>
+ Should the observed variables be shown in separate subplots? If yes, residual plots
+ requested by &quot;show_residuals&quot; will be shown next to, not below the plot of the fits.
+ </dd>
+ <dt>rel.height.middle</dt>
+ <dd>
+ The relative height of the middle plot, if more than two rows of plots are shown.
+ </dd>
+ <dt>lpos</dt>
+ <dd>
+ Position(s) of the legend(s). Passed to <code>legend</code> as the first argument.
+ If not length one, this should be of the same length as the obs_var argument.
+ </dd>
+ <dt>inset</dt>
+ <dd>
+ Passed to <code>legend</code> if applicable.
+ </dd>
+ <dt>show_errmin</dt>
+ <dd>
+ Should the FOCUS chi2 error value be shown in the upper margin of the plot?
+ </dd>
+ <dt>errmin_digits</dt>
+ <dd>
+ The number of significant digits for rounding the FOCUS chi2 error percentage.
+ </dd>
+ <dt>&amp;#8230;</dt>
+ <dd>
+ Further arguments passed to <code>plot</code>.
+ </dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>The function is called for its side effect.</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='co'># One parent compound, one metabolite, both single first order, path from</span>
+<span class='co'># parent to sink included, use Levenberg-Marquardt for speed</span>
+<span class='no'>SFO_SFO</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinmod</span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>, <span class='st'>"m1"</span>, <span class='kw'>full</span> <span class='kw'>=</span> <span class='st'>"Parent"</span>),
+ <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'>mkinsub</span>(<span class='st'>"SFO"</span>, <span class='kw'>full</span> <span class='kw'>=</span> <span class='st'>"Metabolite M1"</span> ))</div><div class='output'><strong class='text-info'>Successfully compiled differential equation model from auto-generated C code.</strong></div><div class='input'><span class='no'>fit</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>method.modFit</span> <span class='kw'>=</span> <span class='st'>"Marq"</span>)
+<span class='fu'>plot</span>(<span class='no'>fit</span>)</div><img src='unknown-4.png' alt='' width='540' height='400' /><div class='input'><span class='fu'>plot</span>(<span class='no'>fit</span>, <span class='kw'>show_residuals</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><img src='unknown-6.png' alt='' width='540' height='400' /><div class='input'>
+<span class='co'># Show the observed variables separately</span>
+<span class='fu'>plot</span>(<span class='no'>fit</span>, <span class='kw'>sep_obs</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>lpos</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='st'>"topright"</span>, <span class='st'>"bottomright"</span>))</div><img src='unknown-8.png' alt='' width='540' height='400' /><div class='input'>
+<span class='co'># Show the observed variables separately, with residuals</span>
+<span class='fu'>plot</span>(<span class='no'>fit</span>, <span class='kw'>sep_obs</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>show_residuals</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>lpos</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='st'>"topright"</span>, <span class='st'>"bottomright"</span>),
+ <span class='kw'>show_errmin</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><img src='unknown-10.png' alt='' width='540' height='400' /><div class='input'>
+<span class='co'># The same can be obtained with less typing, using the convenience function plot_sep</span>
+<span class='fu'>plot_sep</span>(<span class='no'>fit</span>, <span class='kw'>lpos</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='st'>"topright"</span>, <span class='st'>"bottomright"</span>))</div></pre>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </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/reference/plot.mmkin.html b/docs/reference/plot.mmkin.html
new file mode 100644
index 00000000..358da679
--- /dev/null
+++ b/docs/reference/plot.mmkin.html
@@ -0,0 +1,156 @@
+<!-- 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>plot.mmkin. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>When x is a row selected from an mmkin object (<code>[.mmkin</code>), the same model
+ fitted for at least one dataset is shown. When it is a column, the fit of at least one model
+ to the same dataset is shown.</p>
+
+
+ <pre><span class='co'># S3 method for mmkin</span>
+<span class='fu'>plot</span>(<span class='no'>x</span>, <span class='kw'>main</span> <span class='kw'>=</span> <span class='st'>"auto"</span>, <span class='kw'>legends</span> <span class='kw'>=</span> <span class='fl'>1</span>, <span class='kw'>errmin_var</span> <span class='kw'>=</span> <span class='st'>"All data"</span>, <span class='kw'>errmin_digits</span> <span class='kw'>=</span> <span class='fl'>3</span>,
+ <span class='kw'>cex</span> <span class='kw'>=</span> <span class='fl'>0.7</span>, <span class='kw'>rel.height.middle</span> <span class='kw'>=</span> <span class='fl'>0.9</span>, <span class='no'>...</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>x</dt>
+ <dd>
+ An object of class <code>mmkin</code>, with either one row or one column.
+</dd>
+ <dt>main</dt>
+ <dd>
+ The main title placed on the outer margin of the plot.
+</dd>
+ <dt>legends</dt>
+ <dd>
+ An index for the fits for which legends should be shown.
+</dd>
+ <dt>errmin_var</dt>
+ <dd>
+ The variable for which the FOCUS chi2 error value should be shown.
+</dd>
+ <dt>errmin_digits</dt>
+ <dd>
+ The number of significant digits for rounding the FOCUS chi2 error percentage.
+</dd>
+ <dt>cex</dt>
+ <dd>
+ Passed to the plot functions and <code>mtext</code>.
+</dd>
+ <dt>rel.height.middle</dt>
+ <dd>
+ The relative height of the middle plot, if more than two rows of plots are shown.
+</dd>
+ <dt>&amp;#8230;</dt>
+ <dd>
+ Further arguments passed to <code>plot.mkinfit</code> and <code>mkinresplot</code>.
+</dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>The function is called for its side effect.</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'> <span class='co'># Only use one core not to offend CRAN checks, use Levenberg-Marquardt for speed</span>
+ <span class='no'>fits</span> <span class='kw'>&lt;-</span> <span class='fu'>mmkin</span>(<span class='fu'>c</span>(<span class='st'>"FOMC"</span>, <span class='st'>"HS"</span>), <span class='fu'>list</span>(<span class='st'>"FOCUS B"</span> <span class='kw'>=</span> <span class='no'>FOCUS_2006_B</span>, <span class='st'>"FOCUS C"</span> <span class='kw'>=</span> <span class='no'>FOCUS_2006_C</span>),
+ <span class='kw'>cores</span> <span class='kw'>=</span> <span class='fl'>1</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>method.modFit</span> <span class='kw'>=</span> <span class='st'>"Marq"</span>)
+ <span class='fu'>plot</span>(<span class='no'>fits</span>[, <span class='st'>"FOCUS C"</span>])</div><img src='unknown-2.png' alt='' width='540' height='400' /><div class='input'> <span class='fu'>plot</span>(<span class='no'>fits</span>[<span class='st'>"FOMC"</span>, ])</div><img src='unknown-4.png' alt='' width='540' height='400' /><div class='input'>
+ <span class='co'># We can also plot a single fit, if we like the way mmkin works, but then the plot </span>
+ <span class='co'># height should be smaller than the plot width (this is not possible for the html pages</span>
+ <span class='co'># generated by staticdocs, as far as I know).</span>
+ <span class='fu'>plot</span>(<span class='no'>fits</span>[<span class='st'>"FOMC"</span>, <span class='st'>"FOCUS C"</span>]) <span class='co'># same as plot(fits[1, 2])</span></div><img src='unknown-6.png' alt='' width='540' height='400' /></pre>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </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/reference/print.mkinds.html b/docs/reference/print.mkinds.html
new file mode 100644
index 00000000..dea5f75c
--- /dev/null
+++ b/docs/reference/print.mkinds.html
@@ -0,0 +1,109 @@
+<!-- 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>print.mkinds. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>Print mkinds objects.</p>
+
+
+ <pre><span class='co'># S3 method for mkinds</span>
+<span class='fu'>print</span>(<span class='no'>x</span>, <span class='no'>...</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>x</dt>
+ <dd>
+ An <code>mkinds</code> object.
+ </dd>
+ <dt>&amp;#8230;</dt>
+ <dd>
+ Not used.
+ </dd>
+ </dl>
+ </div>
+ <div class="col-md-3">
+ </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/reference/print.mkinmod.html b/docs/reference/print.mkinmod.html
new file mode 100644
index 00000000..38663f8f
--- /dev/null
+++ b/docs/reference/print.mkinmod.html
@@ -0,0 +1,109 @@
+<!-- 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>print.mkinmod. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>Print mkinmod objects in a way that the user finds his way to get to its components.</p>
+
+
+ <pre><span class='co'># S3 method for mkinmod</span>
+<span class='fu'>print</span>(<span class='no'>x</span>, <span class='no'>...</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>x</dt>
+ <dd>
+ An <code>mkinmod</code> object.
+ </dd>
+ <dt>&amp;#8230;</dt>
+ <dd>
+ Not used.
+ </dd>
+ </dl>
+ </div>
+ <div class="col-md-3">
+ </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/reference/schaefer07_complex_case.html b/docs/reference/schaefer07_complex_case.html
new file mode 100644
index 00000000..12776c74
--- /dev/null
+++ b/docs/reference/schaefer07_complex_case.html
@@ -0,0 +1,131 @@
+<!-- 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>schaefer07_complex_case. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>This dataset was used for a comparison of KinGUI and ModelMaker to check the
+ software quality of KinGUI in the original publication (Schäfer et al., 2007).
+ The results from the fitting are also included.</p>
+
+
+ <pre><span class='fu'>data</span>(<span class='no'>schaefer07_complex_case</span>)</pre>
+
+ <div class="Format">
+ <h2>Format</h2>
+
+ <p>The data set is a data frame with 8 observations on the following 6 variables.
+ <dl class='dl-horizontal'>
+ <dt><code>time</code></dt><dd>a numeric vector</dd>
+ <dt><code>parent</code></dt><dd>a numeric vector</dd>
+ <dt><code>A1</code></dt><dd>a numeric vector</dd>
+ <dt><code>B1</code></dt><dd>a numeric vector</dd>
+ <dt><code>C1</code></dt><dd>a numeric vector</dd>
+ <dt><code>A2</code></dt><dd>a numeric vector</dd>
+ </dl></p>
+ <p>The results are a data frame with 14 results for different parameter values</p>
+ </div>
+
+ <div class="References">
+ <h2>References</h2>
+
+ <p>Schäfer D, Mikolasch B, Rainbird P and Harvey B (2007). KinGUI: a new kinetic
+ software tool for evaluations according to FOCUS degradation kinetics. In: Del
+ Re AAM, Capri E, Fragoulis G and Trevisan M (Eds.). Proceedings of the XIII
+ Symposium Pesticide Chemistry, Piacenza, 2007, p. 916-923.</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='no'>data</span> <span class='kw'>&lt;-</span> <span class='fu'>mkin_wide_to_long</span>(<span class='no'>schaefer07_complex_case</span>, <span class='kw'>time</span> <span class='kw'>=</span> <span class='st'>"time"</span>)
+<span class='no'>model</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinmod</span>(
+ <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='st'>"A1"</span>, <span class='st'>"B1"</span>, <span class='st'>"C1"</span>), <span class='kw'>sink</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>),
+ <span class='kw'>A1</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"A2"</span>),
+ <span class='kw'>B1</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>),
+ <span class='kw'>C1</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>),
+ <span class='kw'>A2</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>), <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output'><strong class='text-info'>Successfully compiled differential equation model from auto-generated C code.</strong></div><div class='input'><span class='co'>## Not run: mkinfit(model, data, plot=TRUE)</span></div></pre>
+ </div>
+ <div class="col-md-3">
+ </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/reference/summary.mkinfit.html b/docs/reference/summary.mkinfit.html
new file mode 100644
index 00000000..e0cdfe23
--- /dev/null
+++ b/docs/reference/summary.mkinfit.html
@@ -0,0 +1,229 @@
+<!-- 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>summary.mkinfit. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>Lists model equations, the summary as returned by <code>summary.modFit</code>,
+ the chi2 error levels calculated according to FOCUS guidance (2006) as far
+ as defined therein, and optionally the data, consisting of observed, predicted
+ and residual values.</p>
+
+
+ <pre><span class='co'># S3 method for mkinfit</span>
+<span class='fu'>summary</span>(<span class='no'>object</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>distimes</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>alpha</span> <span class='kw'>=</span> <span class='fl'>0.05</span>, <span class='no'>...</span>)
+<span class='co'># S3 method for summary.mkinfit</span>
+<span class='fu'>print</span>(<span class='no'>x</span>, <span class='kw'>digits</span> <span class='kw'>=</span> <span class='fu'>max</span>(<span class='fl'>3</span>, <span class='fu'>getOption</span>(<span class='st'>"digits"</span>) - <span class='fl'>3</span>), <span class='no'>...</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>object</dt>
+ <dd>
+ an object of class <code>mkinfit</code>.
+</dd>
+ <dt>x</dt>
+ <dd>
+ an object of class <code>summary.mkinfit</code>.
+</dd>
+ <dt>data</dt>
+ <dd>
+ logical, indicating whether the data should be included in the summary.
+</dd>
+ <dt>distimes</dt>
+ <dd>
+ logical, indicating whether DT50 and DT90 values should be included.
+</dd>
+ <dt>alpha</dt>
+ <dd>
+ error level for confidence interval estimation from t distribution
+</dd>
+ <dt>digits</dt>
+ <dd>
+ Number of digits to use for printing
+</dd>
+ <dt>&amp;#8230;</dt>
+ <dd>
+ optional arguments passed to methods like <code>print</code>.
+</dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>The summary function returns a list derived from
+ <code>summary.modFit</code>, with components, among others</p>
+ <p>The print method is called for its side effect, i.e. printing the summary.</p>
+ </div>
+
+ <div class="References">
+ <h2>References</h2>
+
+ <p>FOCUS (2006) &#8220;Guidance Document on Estimating Persistence and
+ Degradation Kinetics from Environmental Fate Studies on Pesticides in EU
+ Registration&#8221; Report of the FOCUS Work Group on Degradation Kinetics,
+ EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+ <a href = 'http://focus.jrc.ec.europa.eu/dk'>http://focus.jrc.ec.europa.eu/dk</a></p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'> <span class='fu'>summary</span>(<span class='fu'>mkinfit</span>(<span class='fu'>mkinmod</span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>)), <span class='no'>FOCUS_2006_A</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>))</div><div class='output co'>#&gt; mkin version: 0.9.44.9000
+#&gt; R version: 3.3.1
+#&gt; Date of fit: Thu Oct 6 09:18:07 2016
+#&gt; Date of summary: Thu Oct 6 09:18:07 2016
+#&gt;
+#&gt; Equations:
+#&gt; d_parent = - k_parent_sink * parent
+#&gt;
+#&gt; Model predictions using solution type analytical
+#&gt;
+#&gt; Fitted with method Port using 35 model solutions performed in 0.079 s
+#&gt;
+#&gt; Weighting: none
+#&gt;
+#&gt; Starting values for parameters to be optimised:
+#&gt; value type
+#&gt; parent_0 101.24 state
+#&gt; k_parent_sink 0.10 deparm
+#&gt;
+#&gt; Starting values for the transformed parameters actually optimised:
+#&gt; value lower upper
+#&gt; parent_0 101.240000 -Inf Inf
+#&gt; log_k_parent_sink -2.302585 -Inf Inf
+#&gt;
+#&gt; Fixed parameter values:
+#&gt; None
+#&gt;
+#&gt; Optimised, transformed parameters with symmetric confidence intervals:
+#&gt; Estimate Std. Error Lower Upper
+#&gt; parent_0 109.200 4.3910 98.410 119.900
+#&gt; log_k_parent_sink -3.291 0.1152 -3.573 -3.009
+#&gt;
+#&gt; Parameter correlation:
+#&gt; parent_0 log_k_parent_sink
+#&gt; parent_0 1.000 0.575
+#&gt; log_k_parent_sink 0.575 1.000
+#&gt;
+#&gt; Residual standard error: 6.08 on 6 degrees of freedom
+#&gt;
+#&gt; Backtransformed parameters:
+#&gt; Confidence intervals for internally transformed parameters are asymmetric.
+#&gt; t-test (unrealistically) based on the assumption of normal distribution
+#&gt; for estimators of untransformed parameters.
+#&gt; Estimate t value Pr(&gt;t) Lower Upper
+#&gt; parent_0 109.20000 24.860 1.394e-07 98.41000 119.90000
+#&gt; k_parent_sink 0.03722 8.679 6.457e-05 0.02807 0.04934
+#&gt;
+#&gt; Chi2 error levels in percent:
+#&gt; err.min n.optim df
+#&gt; All data 8.385 2 6
+#&gt; parent 8.385 2 6
+#&gt;
+#&gt; Resulting formation fractions:
+#&gt; ff
+#&gt; parent_sink 1
+#&gt;
+#&gt; Estimated disappearance times:
+#&gt; DT50 DT90
+#&gt; parent 18.62 61.87
+#&gt;
+#&gt; Data:
+#&gt; time variable observed predicted residual
+#&gt; 0 parent 101.24 109.153 -7.9132
+#&gt; 3 parent 99.27 97.622 1.6484
+#&gt; 7 parent 90.11 84.119 5.9913
+#&gt; 14 parent 72.19 64.826 7.3641
+#&gt; 30 parent 29.71 35.738 -6.0283
+#&gt; 62 parent 5.98 10.862 -4.8818
+#&gt; 90 parent 1.54 3.831 -2.2911
+#&gt; 118 parent 0.39 1.351 -0.9613
+#&gt; </div></pre>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </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/reference/synthetic_data_for_UBA.html b/docs/reference/synthetic_data_for_UBA.html
new file mode 100644
index 00000000..04550199
--- /dev/null
+++ b/docs/reference/synthetic_data_for_UBA.html
@@ -0,0 +1,157 @@
+<!-- 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>synthetic_data_for_UBA_2014. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>The 12 datasets were generated using four different models and three different
+ variance components. The four models are either the SFO or the DFOP model with either
+ two sequential or two parallel metabolites.</p>
+
+ <p>Variance component &#39;a&#39; is based on a normal distribution with standard deviation of 3,
+ Variance component &#39;b&#39; is also based on a normal distribution, but with a standard deviation of 7.
+ Variance component &#39;c&#39; is based on the error model from Rocke and Lorenzato (1995), with the
+ minimum standard deviation (for small y values) of 0.5, and a proportionality constant of 0.07
+ for the increase of the standard deviation with y.</p>
+
+ <p>Initial concentrations for metabolites and all values where adding the variance component resulted
+ in a value below the assumed limit of detection of 0.1 were set to <code>NA</code>.</p>
+
+ <p>As an example, the first dataset has the title <code>SFO_lin_a</code> and is based on the SFO model
+ with two sequential metabolites (linear pathway), with added variance component &#39;a&#39;.</p>
+
+ <p>Compare also the code in the example section to see the degradation models.</p>
+
+
+ <pre><span class='no'>synthetic_data_for_UBA_2014</span></pre>
+
+ <div class="Format">
+ <h2>Format</h2>
+
+ <p>A list containing datasets in the form internally used by the &#39;gmkin&#39; package.
+ The list has twelfe components. Each of the components is one dataset that has,
+ among others, the following components
+ <dl class='dl-horizontal'>
+ <dt><code>title</code></dt><dd>The name of the dataset, e.g. <code>SFO_lin_a</code></dd>
+ <dt><code>data</code></dt><dd>A data frame with the data in the form expected by <code>mkinfit</code></dd>
+ </dl></p>
+ </div>
+
+ <div class="Source">
+ <h2>Source</h2>
+
+ <p>Ranke (2014) Prüfung und Validierung von Modellierungssoftware als Alternative
+ zu ModelMaker 4.0, Umweltbundesamt Projektnummer 27452</p>
+ <p>Rocke, David M. und Lorenzato, Stefan (1995) A two-component model for
+ measurement error in analytical chemistry. Technometrics 37(2), 176-184.</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='co'>## Not run: ------------------------------------</span>
+<span class='co'># m_synth_SFO_lin &lt;- mkinmod(parent = list(type = "SFO", to = "M1"),</span>
+<span class='co'># M1 = list(type = "SFO", to = "M2"),</span>
+<span class='co'># M2 = list(type = "SFO"), use_of_ff = "max")</span>
+<span class='co'># </span>
+<span class='co'># </span>
+<span class='co'># m_synth_SFO_par &lt;- mkinmod(parent = list(type = "SFO", to = c("M1", "M2"),</span>
+<span class='co'># sink = FALSE),</span>
+<span class='co'># M1 = list(type = "SFO"),</span>
+<span class='co'># M2 = list(type = "SFO"), use_of_ff = "max")</span>
+<span class='co'># </span>
+<span class='co'># m_synth_DFOP_lin &lt;- mkinmod(parent = list(type = "DFOP", to = "M1"),</span>
+<span class='co'># M1 = list(type = "SFO", to = "M2"),</span>
+<span class='co'># M2 = list(type = "SFO"), use_of_ff = "max")</span>
+<span class='co'># </span>
+<span class='co'># m_synth_DFOP_par &lt;- mkinmod(parent = list(type = "DFOP", to = c("M1", "M2"),</span>
+<span class='co'># sink = FALSE),</span>
+<span class='co'># M1 = list(type = "SFO"),</span>
+<span class='co'># M2 = list(type = "SFO"), use_of_ff = "max")</span>
+<span class='co'># </span>
+<span class='co'># mkinfit(m_synth_SFO_lin, synthetic_data_for_UBA_2014[[1]]$data)</span>
+<span class='co'>## ---------------------------------------------</span></div></pre>
+ </div>
+ <div class="col-md-3">
+ </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/reference/transform_odeparms.html b/docs/reference/transform_odeparms.html
new file mode 100644
index 00000000..3b8be856
--- /dev/null
+++ b/docs/reference/transform_odeparms.html
@@ -0,0 +1,276 @@
+<!-- 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>transform_odeparms. 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>
+</h1>
+</div>
+
+<div class="row">
+ <div class="col-md-9">
+
+ <p>The transformations are intended to map parameters that should only take
+ on restricted values to the full scale of real numbers. For kinetic rate
+ constants and other paramters that can only take on positive values, a
+ simple log transformation is used. For compositional parameters, such as
+ the formations fractions that should always sum up to 1 and can not be
+ negative, the <code>ilr</code> transformation is used.</p>
+
+ <p>The transformation of sets of formation fractions is fragile, as it supposes
+ the same ordering of the components in forward and backward transformation.
+ This is no problem for the internal use in <code>mkinfit</code>.</p>
+
+
+ <pre><span class='fu'>transform_odeparms</span>(<span class='no'>parms</span>, <span class='no'>mkinmod</span>,
+ <span class='kw'>transform_rates</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>transform_fractions</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
+<span class='fu'>backtransform_odeparms</span>(<span class='no'>transparms</span>, <span class='no'>mkinmod</span>,
+ <span class='kw'>transform_rates</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>transform_fractions</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</pre>
+
+ <h2>Arguments</h2>
+ <dl class="dl-horizontal">
+ <dt>parms</dt>
+ <dd>
+ Parameters of kinetic models as used in the differential equations.
+ </dd>
+ <dt>transparms</dt>
+ <dd>
+ Transformed parameters of kinetic models as used in the fitting procedure.
+ </dd>
+ <dt>mkinmod</dt>
+ <dd>
+ The kinetic model of class <code>mkinmod</code>, containing the names of
+ the model variables that are needed for grouping the formation fractions
+ before <code>ilr</code> transformation, the parameter names and
+ the information if the pathway to sink is included in the model.
+ </dd>
+ <dt>transform_rates</dt>
+ <dd>
+ Boolean specifying if kinetic rate constants should be transformed in the
+ model specification used in the fitting for better compliance with the
+ assumption of normal distribution of the estimator. If TRUE, also
+ alpha and beta parameters of the FOMC model are log-transformed, as well
+ as k1 and k2 rate constants for the DFOP and HS models and the break point tb
+ of the HS model.
+ </dd>
+ <dt>transform_fractions</dt>
+ <dd>
+ Boolean specifying if formation fractions constants should be transformed in the
+ model specification used in the fitting for better compliance with the
+ assumption of normal distribution of the estimator. The default (TRUE) is
+ to do transformations. The g parameter of the DFOP and HS models are also
+ transformed, as they can also be seen as compositional data. The
+ transformation used for these transformations is the <code>ilr</code>
+ transformation.
+ </dd>
+ </dl>
+
+ <div class="Value">
+ <h2>Value</h2>
+
+ <p>A vector of transformed or backtransformed parameters with the same names
+ as the original parameters.</p>
+ </div>
+
+ <h2 id="examples">Examples</h2>
+ <pre class="examples"><div class='input'><span class='no'>SFO_SFO</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinmod</span>(
+ <span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>, <span class='kw'>to</span> <span class='kw'>=</span> <span class='st'>"m1"</span>, <span class='kw'>sink</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>),
+ <span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"SFO"</span>))</div><div class='output'><strong class='text-info'>Successfully compiled differential equation model from auto-generated C code.</strong></div><div class='input'><span class='co'># Fit the model to the FOCUS example dataset D using defaults</span>
+<span class='no'>fit</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
+<span class='fu'>summary</span>(<span class='no'>fit</span>, <span class='kw'>data</span><span class='kw'>=</span><span class='fl'>FALSE</span>) <span class='co'># See transformed and backtransformed parameters</span></div><div class='output co'>#&gt; mkin version: 0.9.44.9000
+#&gt; R version: 3.3.1
+#&gt; Date of fit: Thu Oct 6 09:18:08 2016
+#&gt; Date of summary: Thu Oct 6 09:18:08 2016
+#&gt;
+#&gt; Equations:
+#&gt; d_parent = - k_parent_sink * parent - k_parent_m1 * parent
+#&gt; d_m1 = + k_parent_m1 * parent - k_m1_sink * m1
+#&gt;
+#&gt; Model predictions using solution type deSolve
+#&gt;
+#&gt; Fitted with method Port using 153 model solutions performed in 0.636 s
+#&gt;
+#&gt; Weighting: none
+#&gt;
+#&gt; Starting values for parameters to be optimised:
+#&gt; value type
+#&gt; parent_0 100.7500 state
+#&gt; k_parent_sink 0.1000 deparm
+#&gt; k_parent_m1 0.1001 deparm
+#&gt; k_m1_sink 0.1002 deparm
+#&gt;
+#&gt; Starting values for the transformed parameters actually optimised:
+#&gt; value lower upper
+#&gt; parent_0 100.750000 -Inf Inf
+#&gt; log_k_parent_sink -2.302585 -Inf Inf
+#&gt; log_k_parent_m1 -2.301586 -Inf Inf
+#&gt; log_k_m1_sink -2.300587 -Inf Inf
+#&gt;
+#&gt; Fixed parameter values:
+#&gt; value type
+#&gt; m1_0 0 state
+#&gt;
+#&gt; Optimised, transformed parameters with symmetric confidence intervals:
+#&gt; Estimate Std. Error Lower Upper
+#&gt; parent_0 99.600 1.61400 96.330 102.900
+#&gt; log_k_parent_sink -3.038 0.07826 -3.197 -2.879
+#&gt; log_k_parent_m1 -2.980 0.04124 -3.064 -2.897
+#&gt; log_k_m1_sink -5.248 0.13610 -5.523 -4.972
+#&gt;
+#&gt; Parameter correlation:
+#&gt; parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink
+#&gt; parent_0 1.00000 0.6075 -0.06625 -0.1701
+#&gt; log_k_parent_sink 0.60752 1.0000 -0.08740 -0.6253
+#&gt; log_k_parent_m1 -0.06625 -0.0874 1.00000 0.4716
+#&gt; log_k_m1_sink -0.17006 -0.6253 0.47163 1.0000
+#&gt;
+#&gt; Residual standard error: 3.211 on 36 degrees of freedom
+#&gt;
+#&gt; Backtransformed parameters:
+#&gt; Confidence intervals for internally transformed parameters are asymmetric.
+#&gt; t-test (unrealistically) based on the assumption of normal distribution
+#&gt; for estimators of untransformed parameters.
+#&gt; Estimate t value Pr(&gt;t) Lower Upper
+#&gt; parent_0 99.600000 61.720 2.024e-38 96.330000 1.029e+02
+#&gt; k_parent_sink 0.047920 12.780 3.050e-15 0.040890 5.616e-02
+#&gt; k_parent_m1 0.050780 24.250 3.407e-24 0.046700 5.521e-02
+#&gt; k_m1_sink 0.005261 7.349 5.758e-09 0.003992 6.933e-03
+#&gt;
+#&gt; Chi2 error levels in percent:
+#&gt; err.min n.optim df
+#&gt; All data 6.398 4 15
+#&gt; parent 6.827 3 6
+#&gt; m1 4.490 1 9
+#&gt;
+#&gt; Resulting formation fractions:
+#&gt; ff
+#&gt; parent_sink 0.4855
+#&gt; parent_m1 0.5145
+#&gt; m1_sink 1.0000
+#&gt;
+#&gt; Estimated disappearance times:
+#&gt; DT50 DT90
+#&gt; parent 7.023 23.33
+#&gt; m1 131.761 437.70
+#&gt; </div><div class='input'>
+<span class='co'>## Not run: ------------------------------------</span>
+<span class='co'># fit.2 &lt;- mkinfit(SFO_SFO, FOCUS_2006_D, transform_rates = FALSE)</span>
+<span class='co'># summary(fit.2, data=FALSE) </span>
+<span class='co'>## ---------------------------------------------</span>
+
+<span class='no'>initials</span> <span class='kw'>&lt;-</span> <span class='no'>fit</span>$<span class='no'>start</span>$<span class='no'>value</span>
+<span class='fu'>names</span>(<span class='no'>initials</span>) <span class='kw'>&lt;-</span> <span class='fu'>rownames</span>(<span class='no'>fit</span>$<span class='no'>start</span>)
+<span class='no'>transformed</span> <span class='kw'>&lt;-</span> <span class='no'>fit</span>$<span class='no'>start_transformed</span>$<span class='no'>value</span>
+<span class='fu'>names</span>(<span class='no'>transformed</span>) <span class='kw'>&lt;-</span> <span class='fu'>rownames</span>(<span class='no'>fit</span>$<span class='no'>start_transformed</span>)
+<span class='fu'>transform_odeparms</span>(<span class='no'>initials</span>, <span class='no'>SFO_SFO</span>)</div><div class='output co'>#&gt; parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink
+#&gt; 100.750000 -2.302585 -2.301586 -2.300587
+#&gt; </div><div class='input'><span class='fu'>backtransform_odeparms</span>(<span class='no'>transformed</span>, <span class='no'>SFO_SFO</span>)</div><div class='output co'>#&gt; parent_0 k_parent_sink k_parent_m1 k_m1_sink
+#&gt; 100.7500 0.1000 0.1001 0.1002
+#&gt; </div><div class='input'>
+<span class='co'>## Not run: ------------------------------------</span>
+<span class='co'># # The case of formation fractions</span>
+<span class='co'># SFO_SFO.ff &lt;- mkinmod(</span>
+<span class='co'># parent = list(type = "SFO", to = "m1", sink = TRUE),</span>
+<span class='co'># m1 = list(type = "SFO"),</span>
+<span class='co'># use_of_ff = "max")</span>
+<span class='co'># </span>
+<span class='co'># fit.ff &lt;- mkinfit(SFO_SFO.ff, FOCUS_2006_D)</span>
+<span class='co'># summary(fit.ff, data = FALSE)</span>
+<span class='co'># initials &lt;- c("f_parent_to_m1" = 0.5)</span>
+<span class='co'># transformed &lt;- transform_odeparms(initials, SFO_SFO.ff)</span>
+<span class='co'># backtransform_odeparms(transformed, SFO_SFO.ff)</span>
+<span class='co'># </span>
+<span class='co'># # And without sink</span>
+<span class='co'># SFO_SFO.ff.2 &lt;- mkinmod(</span>
+<span class='co'># parent = list(type = "SFO", to = "m1", sink = FALSE),</span>
+<span class='co'># m1 = list(type = "SFO"),</span>
+<span class='co'># use_of_ff = "max")</span>
+<span class='co'># </span>
+<span class='co'># </span>
+<span class='co'># fit.ff.2 &lt;- mkinfit(SFO_SFO.ff.2, FOCUS_2006_D)</span>
+<span class='co'># summary(fit.ff.2, data = FALSE)</span>
+<span class='co'>## ---------------------------------------------</span></div></pre>
+ </div>
+ <div class="col-md-3">
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </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/reference/unknown-10.png b/docs/reference/unknown-10.png
new file mode 100644
index 00000000..09bb687c
--- /dev/null
+++ b/docs/reference/unknown-10.png
Binary files differ
diff --git a/docs/reference/unknown-2.png b/docs/reference/unknown-2.png
new file mode 100644
index 00000000..a26e413f
--- /dev/null
+++ b/docs/reference/unknown-2.png
Binary files differ
diff --git a/docs/reference/unknown-4.png b/docs/reference/unknown-4.png
new file mode 100644
index 00000000..f23ed172
--- /dev/null
+++ b/docs/reference/unknown-4.png
Binary files differ
diff --git a/docs/reference/unknown-6.png b/docs/reference/unknown-6.png
new file mode 100644
index 00000000..dc24d92f
--- /dev/null
+++ b/docs/reference/unknown-6.png
Binary files differ
diff --git a/docs/reference/unknown-8.png b/docs/reference/unknown-8.png
new file mode 100644
index 00000000..e4ab674a
--- /dev/null
+++ b/docs/reference/unknown-8.png
Binary files differ

Contact - Imprint