aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2018-11-26 11:44:27 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2018-11-26 11:44:27 +0100
commitfbfffc0e47171cac03797340fde697a75a5afd61 (patch)
treeb893e08e0f28673c2407c4bd1354b4bc23099b18
parent282f88f9e28e683f524d5e05d65d8b18ab856a8d (diff)
Add AIC method for mmkin column objects
Static documentation rebuilt by pkgdown
-rw-r--r--NAMESPACE1
-rw-r--r--NEWS.md4
-rw-r--r--R/AIC.mmkin.R30
-rw-r--r--docs/articles/FOCUS_L.html40
-rw-r--r--docs/articles/web_only/compiled_models.html10
-rw-r--r--docs/news/index.html3
-rw-r--r--docs/reference/AIC.mmkin.html211
-rw-r--r--docs/reference/Extract.mmkin.html12
-rw-r--r--docs/reference/logLik.mkinfit.html19
-rw-r--r--docs/reference/mccall81_245T.html12
-rw-r--r--docs/reference/mkinfit.html46
-rw-r--r--docs/reference/mkinmod.html2
-rw-r--r--docs/reference/mkinpredict.html4
-rw-r--r--docs/reference/mmkin.html4
-rw-r--r--docs/reference/summary.mkinfit.html4
-rw-r--r--docs/reference/transform_odeparms.html24
-rw-r--r--man/AIC.mmkin.Rd44
-rw-r--r--man/logLik.mkinfit.Rd12
18 files changed, 391 insertions, 91 deletions
diff --git a/NAMESPACE b/NAMESPACE
index 350c7f45..cc6b24e9 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -8,6 +8,7 @@ S3method(print, summary.mkinfit)
S3method(logLik, mkinfit)
S3method(plot, mmkin)
S3method("[", mmkin)
+S3method(AIC, mmkin)
S3method(mkinpredict, mkinmod)
S3method(mkinpredict, mkinfit)
diff --git a/NEWS.md b/NEWS.md
index 10211f96..f799a749 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,6 +1,8 @@
# mkin 0.9.47.6 (2018-11-26)
-- Add the function 'logLik.mkinfit.R' which makes it possible to calculate an AIC for mkinfit objects
+- Add the function 'logLik.mkinfit' which makes it possible to calculate an AIC for mkinfit objects
+
+- Add the function 'AIC.mmkin' to makeqit easy to compare columns of mmkin objects
- 'add_err': Respect the argument giving the number of replicates in the synthetic dataset
diff --git a/R/AIC.mmkin.R b/R/AIC.mmkin.R
new file mode 100644
index 00000000..1d306ff9
--- /dev/null
+++ b/R/AIC.mmkin.R
@@ -0,0 +1,30 @@
+# Copyright (C) 2018 Johannes Ranke
+# Contact: jranke@uni-bremen.de
+
+# This file is part of the R package mkin
+
+# mkin is free software: you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option) any later
+# version.
+
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+
+# You should have received a copy of the GNU General Public License along with
+# this program. If not, see <http://www.gnu.org/licenses/>
+AIC.mmkin <- function(object, ..., k = 2) {
+ # We can only handle a single column
+ if (ncol(object) != 1) stop("Please provide a single column object")
+ n.fits <- length(object)
+ model_names <- rownames(object)
+
+ code <- paste0("AIC(",
+ paste0("object[[", 1:n.fits, "]]", collapse = ", "),
+ ", k = k)")
+ res <- eval(parse(text = code))
+ if (n.fits > 1) rownames(res) <- model_names
+ return(res)
+}
diff --git a/docs/articles/FOCUS_L.html b/docs/articles/FOCUS_L.html
index 4d337e72..448a03bb 100644
--- a/docs/articles/FOCUS_L.html
+++ b/docs/articles/FOCUS_L.html
@@ -110,15 +110,15 @@
<a class="sourceLine" id="cb2-2" data-line-number="2"><span class="kw">summary</span>(m.L1.SFO)</a></code></pre></div>
<pre><code>## mkin version used for fitting: 0.9.47.6
## R version used for fitting: 3.5.1
-## Date of fit: Mon Nov 26 09:47:23 2018
-## Date of summary: Mon Nov 26 09:47:23 2018
+## Date of fit: Mon Nov 26 11:41:50 2018
+## Date of summary: Mon Nov 26 11:41:50 2018
##
## Equations:
## d_parent/dt = - k_parent_sink * parent
##
## Model predictions using solution type analytical
##
-## Fitted with method Port using 37 model solutions performed in 0.093 s
+## Fitted with method Port using 37 model solutions performed in 0.094 s
##
## Weighting: none
##
@@ -201,8 +201,8 @@
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1"><span class="kw">summary</span>(m.L1.FOMC, <span class="dt">data =</span> <span class="ot">FALSE</span>)</a></code></pre></div>
<pre><code>## mkin version used for fitting: 0.9.47.6
## R version used for fitting: 3.5.1
-## Date of fit: Mon Nov 26 09:47:25 2018
-## Date of summary: Mon Nov 26 09:47:25 2018
+## Date of fit: Mon Nov 26 11:41:52 2018
+## Date of summary: Mon Nov 26 11:41:52 2018
##
## Equations:
## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
@@ -296,15 +296,15 @@
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" data-line-number="1"><span class="kw">summary</span>(m.L2.FOMC, <span class="dt">data =</span> <span class="ot">FALSE</span>)</a></code></pre></div>
<pre><code>## mkin version used for fitting: 0.9.47.6
## R version used for fitting: 3.5.1
-## Date of fit: Mon Nov 26 09:47:26 2018
-## Date of summary: Mon Nov 26 09:47:26 2018
+## Date of fit: Mon Nov 26 11:41:53 2018
+## Date of summary: Mon Nov 26 11:41:53 2018
##
## Equations:
## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
##
## Model predictions using solution type analytical
##
-## Fitted with method Port using 81 model solutions performed in 0.192 s
+## Fitted with method Port using 81 model solutions performed in 0.193 s
##
## Weighting: none
##
@@ -367,8 +367,8 @@
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb15-1" data-line-number="1"><span class="kw">summary</span>(m.L2.DFOP, <span class="dt">data =</span> <span class="ot">FALSE</span>)</a></code></pre></div>
<pre><code>## mkin version used for fitting: 0.9.47.6
## R version used for fitting: 3.5.1
-## Date of fit: Mon Nov 26 09:47:27 2018
-## Date of summary: Mon Nov 26 09:47:27 2018
+## Date of fit: Mon Nov 26 11:41:54 2018
+## Date of summary: Mon Nov 26 11:41:54 2018
##
## Equations:
## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -377,7 +377,7 @@
##
## Model predictions using solution type analytical
##
-## Fitted with method Port using 336 model solutions performed in 0.831 s
+## Fitted with method Port using 336 model solutions performed in 0.826 s
##
## Weighting: none
##
@@ -459,8 +459,8 @@
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" data-line-number="1"><span class="kw">summary</span>(mm.L3[[<span class="st">"DFOP"</span>, <span class="dv">1</span>]])</a></code></pre></div>
<pre><code>## mkin version used for fitting: 0.9.47.6
## R version used for fitting: 3.5.1
-## Date of fit: Mon Nov 26 09:47:28 2018
-## Date of summary: Mon Nov 26 09:47:28 2018
+## Date of fit: Mon Nov 26 11:41:55 2018
+## Date of summary: Mon Nov 26 11:41:55 2018
##
## Equations:
## d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) *
@@ -469,7 +469,7 @@
##
## Model predictions using solution type analytical
##
-## Fitted with method Port using 137 model solutions performed in 0.336 s
+## Fitted with method Port using 137 model solutions performed in 0.337 s
##
## Weighting: none
##
@@ -560,15 +560,15 @@
<div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb26-1" data-line-number="1"><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>)</a></code></pre></div>
<pre><code>## mkin version used for fitting: 0.9.47.6
## R version used for fitting: 3.5.1
-## Date of fit: Mon Nov 26 09:47:28 2018
-## Date of summary: Mon Nov 26 09:47:29 2018
+## Date of fit: Mon Nov 26 11:41:55 2018
+## Date of summary: Mon Nov 26 11:41:56 2018
##
## Equations:
## d_parent/dt = - k_parent_sink * parent
##
## Model predictions using solution type analytical
##
-## Fitted with method Port using 46 model solutions performed in 0.107 s
+## Fitted with method Port using 46 model solutions performed in 0.108 s
##
## Weighting: none
##
@@ -620,15 +620,15 @@
<div class="sourceCode" id="cb28"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb28-1" data-line-number="1"><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>)</a></code></pre></div>
<pre><code>## mkin version used for fitting: 0.9.47.6
## R version used for fitting: 3.5.1
-## Date of fit: Mon Nov 26 09:47:28 2018
-## Date of summary: Mon Nov 26 09:47:29 2018
+## Date of fit: Mon Nov 26 11:41:56 2018
+## Date of summary: Mon Nov 26 11:41:56 2018
##
## Equations:
## d_parent/dt = - (alpha/beta) * 1/((time/beta) + 1) * parent
##
## Model predictions using solution type analytical
##
-## Fitted with method Port using 66 model solutions performed in 0.168 s
+## Fitted with method Port using 66 model solutions performed in 0.16 s
##
## Weighting: none
##
diff --git a/docs/articles/web_only/compiled_models.html b/docs/articles/web_only/compiled_models.html
index 083cdb79..8da95e4d 100644
--- a/docs/articles/web_only/compiled_models.html
+++ b/docs/articles/web_only/compiled_models.html
@@ -125,9 +125,9 @@
<a class="sourceLine" id="cb5-16" data-line-number="16">}</a></code></pre></div>
<pre><code>## Lade nötiges Paket: rbenchmark</code></pre>
<pre><code>## test replications elapsed relative user.self sys.self
-## 3 deSolve, compiled 3 2.264 1.000 2.263 0
-## 1 deSolve, not compiled 3 17.642 7.792 17.634 0
-## 2 Eigenvalue based 3 2.801 1.237 2.799 0
+## 3 deSolve, compiled 3 2.302 1.000 2.301 0
+## 1 deSolve, not compiled 3 17.754 7.712 17.743 0
+## 2 Eigenvalue based 3 2.840 1.234 2.838 0
## user.child sys.child
## 3 0 0
## 1 0 0
@@ -156,8 +156,8 @@
<a class="sourceLine" id="cb8-16" data-line-number="16">}</a></code></pre></div>
<pre><code>## Successfully compiled differential equation model from auto-generated C code.</code></pre>
<pre><code>## test replications elapsed relative user.self sys.self
-## 2 deSolve, compiled 3 4.012 1.000 4.010 0
-## 1 deSolve, not compiled 3 37.606 9.373 37.589 0
+## 2 deSolve, compiled 3 4.116 1.000 4.114 0
+## 1 deSolve, not compiled 3 37.902 9.208 37.884 0
## user.child sys.child
## 2 0 0
## 1 0 0</code></pre>
diff --git a/docs/news/index.html b/docs/news/index.html
index 9f658dad..1b2455a8 100644
--- a/docs/news/index.html
+++ b/docs/news/index.html
@@ -122,7 +122,8 @@
<a href="#mkin-0-9-47-6-2018-11-26" class="anchor"></a>mkin 0.9.47.6 (2018-11-26)<small> Unreleased </small>
</h1>
<ul>
-<li><p>Add the function ‘logLik.mkinfit.R’ which makes it possible to calculate an AIC for mkinfit objects</p></li>
+<li><p>Add the function ‘logLik.mkinfit’ which makes it possible to calculate an AIC for mkinfit objects</p></li>
+<li><p>Add the function ‘AIC.mmkin’ to makeqit easy to compare columns of mmkin objects</p></li>
<li><p>‘add_err’: Respect the argument giving the number of replicates in the synthetic dataset</p></li>
<li><p>‘max_twa_parent’: Support maximum time weighted average concentration calculations for the hockey stick (HS) model</p></li>
<li><p>‘mkinpredict’: Make the function generic and create a method for mkinfit objects</p></li>
diff --git a/docs/reference/AIC.mmkin.html b/docs/reference/AIC.mmkin.html
new file mode 100644
index 00000000..a2ce9885
--- /dev/null
+++ b/docs/reference/AIC.mmkin.html
@@ -0,0 +1,211 @@
+<!-- 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>Calculated the AIC for a column of an mmkin object — AIC.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/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" 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">
+
+<!-- clipboard.js -->
+<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js" integrity="sha384-cV+rhyOuRHc9Ub/91rihWcGmMmCXDeksTtCihMupQHSsi8GIIRDG0ThDc3HGQFJ3" crossorigin="anonymous"></script>
+
+<!-- sticky kit -->
+<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
+
+<!-- pkgdown -->
+<link href="../pkgdown.css" rel="stylesheet">
+<script src="../pkgdown.js"></script>
+
+
+
+<meta property="og:title" content="Calculated the AIC for a column of an mmkin object — AIC.mmkin" />
+
+<meta property="og:description" content="Provides a convenient way to compare different kineti models fitted to the
+ same dataset." />
+<meta name="twitter:card" content="summary" />
+
+
+
+<!-- mathjax -->
+<script src='https://mathjax.rstudio.com/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 template-reference-topic">
+ <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>
+ <span class="navbar-brand">
+ <a class="navbar-link" href="../index.html">mkin</a>
+ <span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="Released package">0.9.47.6</span>
+ </span>
+ </div>
+
+ <div id="navbar" class="navbar-collapse collapse">
+ <ul class="nav navbar-nav">
+ <li>
+ <a href="../reference/index.html">Functions and data</a>
+</li>
+<li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
+ Articles
+
+ <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu" role="menu">
+ <li>
+ <a href="../articles/mkin.html">Introduction to mkin</a>
+ </li>
+ <li>
+ <a href="../articles/FOCUS_D.html">Example evaluation of FOCUS Example Dataset D</a>
+ </li>
+ <li>
+ <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a>
+ </li>
+ <li>
+ <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a>
+ </li>
+ <li>
+ <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a>
+ </li>
+ <li>
+ <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a>
+ </li>
+ </ul>
+</li>
+<li>
+ <a href="../news/index.html">News</a>
+</li>
+ </ul>
+
+ <ul class="nav navbar-nav navbar-right">
+
+ </ul>
+
+ </div><!--/.nav-collapse -->
+ </div><!--/.container -->
+</div><!--/.navbar -->
+
+
+ </header>
+
+<div class="row">
+ <div class="col-md-9 contents">
+ <div class="page-header">
+ <h1>Calculated the AIC for a column of an mmkin object</h1>
+
+ <div class="hidden name"><code>AIC.mmkin.Rd</code></div>
+ </div>
+
+ <div class="ref-description">
+
+ <p>Provides a convenient way to compare different kineti models fitted to the
+ same dataset.</p>
+
+ </div>
+
+ <pre class="usage"><span class='co'># S3 method for mmkin</span>
+<span class='fu'>AIC</span>(<span class='no'>object</span>, <span class='no'>...</span>, <span class='kw'>k</span> <span class='kw'>=</span> <span class='fl'>2</span>)</pre>
+
+ <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
+ <table class="ref-arguments">
+ <colgroup><col class="name" /><col class="desc" /></colgroup>
+ <tr>
+ <th>object</th>
+ <td><p>An object of class <code><a href='mmkin.html'>mmkin</a></code>, containing only one column.</p></td>
+ </tr>
+ <tr>
+ <th>&#8230;</th>
+ <td><p>For compatibility with the generic method</p></td>
+ </tr>
+ <tr>
+ <th>k</th>
+ <td><p>As in the generic method</p></td>
+ </tr>
+ </table>
+
+ <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
+
+ <p>As in the generic method (a numeric value for single fits, or a dataframe if
+ there are several fits in the column).</p>
+
+
+ <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
+ <pre class="examples"><div class='input'> <span class='no'>f</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span>(<span class='fu'>c</span>(<span class='st'>"SFO"</span>, <span class='st'>"FOMC"</span>, <span class='st'>"DFOP"</span>),
+ <span class='fu'>list</span>(<span class='st'>"FOCUS A"</span> <span class='kw'>=</span> <span class='no'>FOCUS_2006_A</span>,
+ <span class='st'>"FOCUS C"</span> <span class='kw'>=</span> <span class='no'>FOCUS_2006_C</span>))
+ <span class='fu'>AIC</span>(<span class='no'>f</span>[<span class='fl'>1</span>, <span class='st'>"FOCUS A"</span>]) <span class='co'># We get a single number for a single fit</span></div><div class='output co'>#&gt; [1] 55.32452</div><div class='input'>
+ <span class='co'># For FOCUS A, the models fit almost equally well, so the higher the number</span>
+ <span class='co'># of parameters, the higher (worse) the AIC</span>
+ <span class='fu'>AIC</span>(<span class='no'>f</span>[, <span class='st'>"FOCUS A"</span>])</div><div class='output co'>#&gt; df AIC
+#&gt; SFO 3 55.32452
+#&gt; FOMC 4 57.32477
+#&gt; DFOP 5 59.32452</div><div class='input'> <span class='fu'>AIC</span>(<span class='no'>f</span>[, <span class='st'>"FOCUS A"</span>], <span class='kw'>k</span> <span class='kw'>=</span> <span class='fl'>0</span>) <span class='co'># If we do not penalize additional parameters, we get nearly the same</span></div><div class='output co'>#&gt; df AIC
+#&gt; SFO 3 49.32452
+#&gt; FOMC 4 49.32477
+#&gt; DFOP 5 49.32452</div><div class='input'>
+ <span class='co'># For FOCUS C, the more complex models fit better</span>
+ <span class='fu'>AIC</span>(<span class='no'>f</span>[, <span class='st'>"FOCUS C"</span>])</div><div class='output co'>#&gt; df AIC
+#&gt; SFO 3 59.84675
+#&gt; FOMC 4 44.70584
+#&gt; DFOP 5 29.08369</div></pre>
+ </div>
+ <div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
+ <h2>Contents</h2>
+ <ul class="nav nav-pills nav-stacked">
+ <li><a href="#arguments">Arguments</a></li>
+
+ <li><a href="#value">Value</a></li>
+
+ <li><a href="#examples">Examples</a></li>
+ </ul>
+
+ <h2>Author</h2>
+
+ Johannes Ranke
+
+ </div>
+</div>
+
+ <footer>
+ <div class="copyright">
+ <p>Developed by Johannes Ranke.</p>
+</div>
+
+<div class="pkgdown">
+ <p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p>
+</div>
+
+ </footer>
+ </div>
+
+
+
+ </body>
+</html>
+
diff --git a/docs/reference/Extract.mmkin.html b/docs/reference/Extract.mmkin.html
index 51da42fc..b304c2fb 100644
--- a/docs/reference/Extract.mmkin.html
+++ b/docs/reference/Extract.mmkin.html
@@ -278,7 +278,7 @@
#&gt;
#&gt; $time
#&gt; User System verstrichen
-#&gt; 0.183 0.000 0.183
+#&gt; 0.188 0.000 0.188
#&gt;
#&gt; $mkinmod
#&gt; &lt;mkinmod&gt; model generated with
@@ -467,8 +467,8 @@
#&gt; }
#&gt; return(mC)
#&gt; }
-#&gt; &lt;bytecode: 0x55555be28e50&gt;
-#&gt; &lt;environment: 0x55555bc4d2b0&gt;
+#&gt; &lt;bytecode: 0x55555bd98970&gt;
+#&gt; &lt;environment: 0x55555d417aa8&gt;
#&gt;
#&gt; $cost_notrans
#&gt; function (P)
@@ -490,8 +490,8 @@
#&gt; scaleVar = scaleVar)
#&gt; return(mC)
#&gt; }
-#&gt; &lt;bytecode: 0x55555cd2fbb8&gt;
-#&gt; &lt;environment: 0x55555bc4d2b0&gt;
+#&gt; &lt;bytecode: 0x55555cd14308&gt;
+#&gt; &lt;environment: 0x55555d417aa8&gt;
#&gt;
#&gt; $hessian_notrans
#&gt; parent_0 k_parent_sink
@@ -558,7 +558,7 @@
#&gt; 99.17407
#&gt;
#&gt; $date
-#&gt; [1] "Mon Nov 26 09:45:35 2018"
+#&gt; [1] "Mon Nov 26 11:40:00 2018"
#&gt;
#&gt; $version
#&gt; [1] "0.9.47.6"
diff --git a/docs/reference/logLik.mkinfit.html b/docs/reference/logLik.mkinfit.html
index b1901703..33d9eb36 100644
--- a/docs/reference/logLik.mkinfit.html
+++ b/docs/reference/logLik.mkinfit.html
@@ -34,15 +34,15 @@
<meta property="og:description" content="This function simply calculates the product of the likelihood densities
calculated using dnorm, i.e. assuming normal distribution.
-The total number of estimated parameters returned with the value
- of the likelihood is calculated as the sum of fitted degradation
+The total number of estimated parameters returned with the value
+ of the likelihood is calculated as the sum of fitted degradation
model parameters and the fitted error model parameters.
For the case of unweighted least squares fitting, we calculate one
constant standard deviation from the residuals using sd
and add one to the number of fitted degradation model parameters.
For the case of manual weighting, we use the weight given for each
observation as standard deviation in calculating its likelihood
- and the total number of estimated parameters is equal to the
+ and the total number of estimated parameters is equal to the
number of fitted degradation model parameters.
In the case of iterative reweighting, the variances obtained by this
procedure are used in the likelihood calculations, and the number of
@@ -142,15 +142,15 @@ In the case of iterative reweighting, the variances obtained by this
<p>This function simply calculates the product of the likelihood densities
calculated using <code>dnorm</code>, i.e. assuming normal distribution.</p>
-<p>The total number of estimated parameters returned with the value
- of the likelihood is calculated as the sum of fitted degradation
+<p>The total number of estimated parameters returned with the value
+ of the likelihood is calculated as the sum of fitted degradation
model parameters and the fitted error model parameters.</p>
<p>For the case of unweighted least squares fitting, we calculate one
constant standard deviation from the residuals using <code>sd</code>
and add one to the number of fitted degradation model parameters.</p>
<p>For the case of manual weighting, we use the weight given for each
observation as standard deviation in calculating its likelihood
- and the total number of estimated parameters is equal to the
+ and the total number of estimated parameters is equal to the
number of fitted degradation model parameters.</p>
<p>In the case of iterative reweighting, the variances obtained by this
procedure are used in the likelihood calculations, and the number of
@@ -183,6 +183,11 @@ In the case of iterative reweighting, the variances obtained by this
estimated parameters (degradation model parameters plus variance
model parameters) as attribute.</p>
+ <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
+
+ <div class='dont-index'><p>Compare the AIC of columns of <code><a href='mmkin.html'>mmkin</a></code> objects using
+ <code><a href='AIC.mmkin.html'>AIC.mmkin</a></code>.</p></div>
+
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'> <span class='no'>sfo_sfo</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span>(
@@ -207,6 +212,8 @@ In the case of iterative reweighting, the variances obtained by this
<li><a href="#arguments">Arguments</a></li>
<li><a href="#value">Value</a></li>
+
+ <li><a href="#see-also">See also</a></li>
<li><a href="#examples">Examples</a></li>
</ul>
diff --git a/docs/reference/mccall81_245T.html b/docs/reference/mccall81_245T.html
index 981c633a..96082932 100644
--- a/docs/reference/mccall81_245T.html
+++ b/docs/reference/mccall81_245T.html
@@ -158,8 +158,8 @@
<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 co'>#&gt; <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'> </div><div class='input'> <span class='no'>fit.1</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></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'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
<span class='fu'>summary</span>(<span class='no'>fit.1</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</div><div class='output co'>#&gt; mkin version used for fitting: 0.9.47.6
#&gt; R version used for fitting: 3.5.1
-#&gt; Date of fit: Mon Nov 26 09:45:54 2018
-#&gt; Date of summary: Mon Nov 26 09:45:54 2018
+#&gt; Date of fit: Mon Nov 26 11:40:20 2018
+#&gt; Date of summary: Mon Nov 26 11:40:20 2018
#&gt;
#&gt; Equations:
#&gt; d_T245/dt = - k_T245_sink * T245 - k_T245_phenol * T245
@@ -169,7 +169,7 @@
#&gt;
#&gt; Model predictions using solution type deSolve
#&gt;
-#&gt; Fitted with method Port using 574 model solutions performed in 3.641 s
+#&gt; Fitted with method Port using 574 model solutions performed in 3.702 s
#&gt;
#&gt; Weighting: none
#&gt;
@@ -247,8 +247,8 @@
<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 used for fitting: 0.9.47.6
#&gt; R version used for fitting: 3.5.1
-#&gt; Date of fit: Mon Nov 26 09:45:56 2018
-#&gt; Date of summary: Mon Nov 26 09:45:56 2018
+#&gt; Date of fit: Mon Nov 26 11:40:22 2018
+#&gt; Date of summary: Mon Nov 26 11:40:22 2018
#&gt;
#&gt; Equations:
#&gt; d_T245/dt = - k_T245_sink * T245 - k_T245_phenol * T245
@@ -258,7 +258,7 @@
#&gt;
#&gt; Model predictions using solution type deSolve
#&gt;
-#&gt; Fitted with method Port using 246 model solutions performed in 1.627 s
+#&gt; Fitted with method Port using 246 model solutions performed in 1.646 s
#&gt;
#&gt; Weighting: none
#&gt;
diff --git a/docs/reference/mkinfit.html b/docs/reference/mkinfit.html
index 883dda22..77c69f4e 100644
--- a/docs/reference/mkinfit.html
+++ b/docs/reference/mkinfit.html
@@ -436,15 +436,15 @@
<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 used for fitting: 0.9.47.6
#&gt; R version used for fitting: 3.5.1
-#&gt; Date of fit: Mon Nov 26 09:45:59 2018
-#&gt; Date of summary: Mon Nov 26 09:45:59 2018
+#&gt; Date of fit: Mon Nov 26 11:40:24 2018
+#&gt; Date of summary: Mon Nov 26 11:40:24 2018
#&gt;
#&gt; Equations:
#&gt; d_parent/dt = - (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.155 s
+#&gt; Fitted with method Port using 64 model solutions performed in 0.156 s
#&gt;
#&gt; Weighting: none
#&gt;
@@ -513,7 +513,7 @@
<span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>))</div><div class='output co'>#&gt; <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></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 verstrichen
-#&gt; 0.974 0.000 0.975 </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; 0.989 0.000 0.990 </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 </div><div class='input'><span class='fu'><a href='endpoints.html'>endpoints</a></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
@@ -588,7 +588,7 @@
#&gt; Model cost at call 146 : 371.2134
#&gt; Optimisation by method Port successfully terminated.
#&gt; User System verstrichen
-#&gt; 0.79 0.00 0.79 </div><div class='input'><span class='fu'>coef</span>(<span class='no'>fit.deSolve</span>)</div><div class='output co'>#&gt; parent_0 log_k_parent_sink log_k_parent_m1 log_k_m1_sink
+#&gt; 0.799 0.000 0.800 </div><div class='input'><span class='fu'>coef</span>(<span class='no'>fit.deSolve</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 </div><div class='input'><span class='fu'><a href='endpoints.html'>endpoints</a></span>(<span class='no'>fit.deSolve</span>)</div><div class='output co'>#&gt; $ff
#&gt; parent_sink parent_m1 m1_sink
#&gt; 0.485524 0.514476 1.000000
@@ -626,8 +626,8 @@
<span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>), <span class='kw'>use_of_ff</span> <span class='kw'>=</span> <span class='st'>"max"</span>)</div><div class='output co'>#&gt; <span class='message'>Successfully compiled differential equation model from auto-generated C code.</span></div><div class='input'><span class='no'>f.noweight</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO.ff</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'>f.noweight</span>)</div><div class='output co'>#&gt; mkin version used for fitting: 0.9.47.6
#&gt; R version used for fitting: 3.5.1
-#&gt; Date of fit: Mon Nov 26 09:46:10 2018
-#&gt; Date of summary: Mon Nov 26 09:46:10 2018
+#&gt; Date of fit: Mon Nov 26 11:40:36 2018
+#&gt; Date of summary: Mon Nov 26 11:40:36 2018
#&gt;
#&gt; Equations:
#&gt; d_parent/dt = - k_parent * parent
@@ -635,7 +635,7 @@
#&gt;
#&gt; Model predictions using solution type deSolve
#&gt;
-#&gt; Fitted with method Port using 186 model solutions performed in 0.889 s
+#&gt; Fitted with method Port using 186 model solutions performed in 0.839 s
#&gt;
#&gt; Weighting: none
#&gt;
@@ -743,8 +743,8 @@
#&gt; 120 m1 33.31 28.78984 4.520e+00</div><div class='input'><span class='no'>f.irls</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO.ff</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>reweight.method</span> <span class='kw'>=</span> <span class='st'>"obs"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
<span class='fu'>summary</span>(<span class='no'>f.irls</span>)</div><div class='output co'>#&gt; mkin version used for fitting: 0.9.47.6
#&gt; R version used for fitting: 3.5.1
-#&gt; Date of fit: Mon Nov 26 09:46:13 2018
-#&gt; Date of summary: Mon Nov 26 09:46:13 2018
+#&gt; Date of fit: Mon Nov 26 11:40:39 2018
+#&gt; Date of summary: Mon Nov 26 11:40:39 2018
#&gt;
#&gt; Equations:
#&gt; d_parent/dt = - k_parent * parent
@@ -752,7 +752,7 @@
#&gt;
#&gt; Model predictions using solution type deSolve
#&gt;
-#&gt; Fitted with method Port using 551 model solutions performed in 2.441 s
+#&gt; Fitted with method Port using 551 model solutions performed in 2.48 s
#&gt;
#&gt; Weighting: none
#&gt;
@@ -865,8 +865,8 @@
#&gt; 120 m1 33.31 28.80898 4.501e+00 2.722</div><div class='input'><span class='no'>f.w.mean</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO.ff</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>weight</span> <span class='kw'>=</span> <span class='st'>"mean"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
<span class='fu'>summary</span>(<span class='no'>f.w.mean</span>)</div><div class='output co'>#&gt; mkin version used for fitting: 0.9.47.6
#&gt; R version used for fitting: 3.5.1
-#&gt; Date of fit: Mon Nov 26 09:46:14 2018
-#&gt; Date of summary: Mon Nov 26 09:46:14 2018
+#&gt; Date of fit: Mon Nov 26 11:40:40 2018
+#&gt; Date of summary: Mon Nov 26 11:40:40 2018
#&gt;
#&gt; Equations:
#&gt; d_parent/dt = - k_parent * parent
@@ -874,7 +874,7 @@
#&gt;
#&gt; Model predictions using solution type deSolve
#&gt;
-#&gt; Fitted with method Port using 155 model solutions performed in 0.679 s
+#&gt; Fitted with method Port using 155 model solutions performed in 0.694 s
#&gt;
#&gt; Weighting: mean
#&gt;
@@ -983,8 +983,8 @@
<span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
<span class='fu'>summary</span>(<span class='no'>f.w.value</span>)</div><div class='output co'>#&gt; mkin version used for fitting: 0.9.47.6
#&gt; R version used for fitting: 3.5.1
-#&gt; Date of fit: Mon Nov 26 09:46:15 2018
-#&gt; Date of summary: Mon Nov 26 09:46:15 2018
+#&gt; Date of fit: Mon Nov 26 11:40:41 2018
+#&gt; Date of summary: Mon Nov 26 11:40:41 2018
#&gt;
#&gt; Equations:
#&gt; d_parent/dt = - k_parent * parent
@@ -992,7 +992,7 @@
#&gt;
#&gt; Model predictions using solution type deSolve
#&gt;
-#&gt; Fitted with method Port using 174 model solutions performed in 0.771 s
+#&gt; Fitted with method Port using 174 model solutions performed in 0.778 s
#&gt;
#&gt; Weighting: manual
#&gt;
@@ -1103,8 +1103,8 @@
<span class='no'>f.w.man</span> <span class='kw'>&lt;-</span> <span class='fu'>mkinfit</span>(<span class='no'>SFO_SFO.ff</span>, <span class='no'>dw</span>, <span class='kw'>err</span> <span class='kw'>=</span> <span class='st'>"err.man"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
<span class='fu'>summary</span>(<span class='no'>f.w.man</span>)</div><div class='output co'>#&gt; mkin version used for fitting: 0.9.47.6
#&gt; R version used for fitting: 3.5.1
-#&gt; Date of fit: Mon Nov 26 09:46:16 2018
-#&gt; Date of summary: Mon Nov 26 09:46:16 2018
+#&gt; Date of fit: Mon Nov 26 11:40:42 2018
+#&gt; Date of summary: Mon Nov 26 11:40:42 2018
#&gt;
#&gt; Equations:
#&gt; d_parent/dt = - k_parent * parent
@@ -1112,7 +1112,7 @@
#&gt;
#&gt; Model predictions using solution type deSolve
#&gt;
-#&gt; Fitted with method Port using 270 model solutions performed in 1.2 s
+#&gt; Fitted with method Port using 270 model solutions performed in 1.225 s
#&gt;
#&gt; Weighting: manual
#&gt;
@@ -1221,8 +1221,8 @@
<span class='kw'>reweight.method</span> <span class='kw'>=</span> <span class='st'>"obs"</span>)
<span class='fu'>summary</span>(<span class='no'>f.w.man.irls</span>)</div><div class='output co'>#&gt; mkin version used for fitting: 0.9.47.6
#&gt; R version used for fitting: 3.5.1
-#&gt; Date of fit: Mon Nov 26 09:46:19 2018
-#&gt; Date of summary: Mon Nov 26 09:46:19 2018
+#&gt; Date of fit: Mon Nov 26 11:40:45 2018
+#&gt; Date of summary: Mon Nov 26 11:40:45 2018
#&gt;
#&gt; Equations:
#&gt; d_parent/dt = - k_parent * parent
@@ -1230,7 +1230,7 @@
#&gt;
#&gt; Model predictions using solution type deSolve
#&gt;
-#&gt; Fitted with method Port using 692 model solutions performed in 3.079 s
+#&gt; Fitted with method Port using 692 model solutions performed in 3.119 s
#&gt;
#&gt; Weighting: manual
#&gt;
diff --git a/docs/reference/mkinmod.html b/docs/reference/mkinmod.html
index d947aff5..0d644bc4 100644
--- a/docs/reference/mkinmod.html
+++ b/docs/reference/mkinmod.html
@@ -229,7 +229,7 @@ For the definition of model types and their parameters, the equations given
<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'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>, <span class='st'>"m1"</span>),
<span class='kw'>m1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>), <span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><div class='output co'>#&gt; Compilation argument:
-#&gt; /usr/lib/R/bin/R CMD SHLIB file74b35b9de5b.c 2&gt; file74b35b9de5b.c.err.txt
+#&gt; /usr/lib/R/bin/R CMD SHLIB file4252799a8f5a.c 2&gt; file4252799a8f5a.c.err.txt
#&gt; Program source:
#&gt; 1: #include &lt;R.h&gt;
#&gt; 2:
diff --git a/docs/reference/mkinpredict.html b/docs/reference/mkinpredict.html
index 88858539..bfe71be5 100644
--- a/docs/reference/mkinpredict.html
+++ b/docs/reference/mkinpredict.html
@@ -323,7 +323,7 @@
<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</div><div class='output co'>#&gt; User System verstrichen
-#&gt; 0.005 0.000 0.005 </div><div class='input'> <span class='fu'>system.time</span>(
+#&gt; 0.003 0.000 0.004 </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
@@ -333,7 +333,7 @@
<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</div><div class='output co'>#&gt; User System verstrichen
-#&gt; 0.039 0.000 0.039 </div><div class='input'>
+#&gt; 0.039 0.000 0.040 </div><div class='input'>
</div><div class='input'> <span class='co'># Predict from a fitted model</span>
<span class='no'>f</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_C</span>)</div><div class='output co'>#&gt; Model cost at call 1 : 552.5739
#&gt; Model cost at call 3 : 552.5739
diff --git a/docs/reference/mmkin.html b/docs/reference/mmkin.html
index 49117199..92f12c2a 100644
--- a/docs/reference/mmkin.html
+++ b/docs/reference/mmkin.html
@@ -189,8 +189,8 @@
<span class='no'>time_1</span> <span class='kw'>&lt;-</span> <span class='fu'>system.time</span>(<span class='no'>fits.4</span> <span class='kw'>&lt;-</span> <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='fl'>1</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>))
<span class='no'>time_default</span></div><div class='output co'>#&gt; User System verstrichen
-#&gt; 0.037 0.036 7.001 </div><div class='input'><span class='no'>time_1</span></div><div class='output co'>#&gt; User System verstrichen
-#&gt; 21.838 0.000 21.852 </div><div class='input'>
+#&gt; 0.050 0.037 6.958 </div><div class='input'><span class='no'>time_1</span></div><div class='output co'>#&gt; User System verstrichen
+#&gt; 22.101 0.000 22.114 </div><div class='input'>
<span class='fu'><a href='endpoints.html'>endpoints</a></span>(<span class='no'>fits.0</span><span class='kw'>[[</span><span class='st'>"SFO_lin"</span>, <span class='fl'>2</span>]])</div><div class='output co'>#&gt; $ff
#&gt; parent_M1 parent_sink M1_M2 M1_sink
#&gt; 0.7340480 0.2659520 0.7505686 0.2494314
diff --git a/docs/reference/summary.mkinfit.html b/docs/reference/summary.mkinfit.html
index e63ab87e..554a28e3 100644
--- a/docs/reference/summary.mkinfit.html
+++ b/docs/reference/summary.mkinfit.html
@@ -206,8 +206,8 @@
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'> <span class='fu'>summary</span>(<span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='fu'><a href='mkinmod.html'>mkinmod</a></span>(<span class='kw'>parent</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></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 used for fitting: 0.9.47.6
#&gt; R version used for fitting: 3.5.1
-#&gt; Date of fit: Mon Nov 26 09:47:09 2018
-#&gt; Date of summary: Mon Nov 26 09:47:09 2018
+#&gt; Date of fit: Mon Nov 26 11:41:36 2018
+#&gt; Date of summary: Mon Nov 26 11:41:36 2018
#&gt;
#&gt; Equations:
#&gt; d_parent/dt = - k_parent_sink * parent
diff --git a/docs/reference/transform_odeparms.html b/docs/reference/transform_odeparms.html
index c0ff16fd..e6a42993 100644
--- a/docs/reference/transform_odeparms.html
+++ b/docs/reference/transform_odeparms.html
@@ -200,8 +200,8 @@ The transformation of sets of formation fractions is fragile, as it supposes
<span class='no'>fit</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></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 used for fitting: 0.9.47.6
#&gt; R version used for fitting: 3.5.1
-#&gt; Date of fit: Mon Nov 26 09:47:17 2018
-#&gt; Date of summary: Mon Nov 26 09:47:17 2018
+#&gt; Date of fit: Mon Nov 26 11:41:44 2018
+#&gt; Date of summary: Mon Nov 26 11:41:44 2018
#&gt;
#&gt; Equations:
#&gt; d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent
@@ -209,7 +209,7 @@ The transformation of sets of formation fractions is fragile, as it supposes
#&gt;
#&gt; Model predictions using solution type deSolve
#&gt;
-#&gt; Fitted with method Port using 153 model solutions performed in 0.673 s
+#&gt; Fitted with method Port using 153 model solutions performed in 0.686 s
#&gt;
#&gt; Weighting: none
#&gt;
@@ -276,8 +276,8 @@ The transformation of sets of formation fractions is fragile, as it supposes
</div><div class='input'><span class='no'>fit.2</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO</span>, <span class='no'>FOCUS_2006_D</span>, <span class='kw'>transform_rates</span> <span class='kw'>=</span> <span class='fl'>FALSE</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 used for fitting: 0.9.47.6
#&gt; R version used for fitting: 3.5.1
-#&gt; Date of fit: Mon Nov 26 09:47:18 2018
-#&gt; Date of summary: Mon Nov 26 09:47:18 2018
+#&gt; Date of fit: Mon Nov 26 11:41:45 2018
+#&gt; Date of summary: Mon Nov 26 11:41:45 2018
#&gt;
#&gt; Equations:
#&gt; d_parent/dt = - k_parent_sink * parent - k_parent_m1 * parent
@@ -285,7 +285,7 @@ The transformation of sets of formation fractions is fragile, as it supposes
#&gt;
#&gt; Model predictions using solution type deSolve
#&gt;
-#&gt; Fitted with method Port using 350 model solutions performed in 1.529 s
+#&gt; Fitted with method Port using 350 model solutions performed in 1.558 s
#&gt;
#&gt; Weighting: none
#&gt;
@@ -364,8 +364,8 @@ The transformation of sets of formation fractions is fragile, as it supposes
<span class='no'>fit.ff</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO.ff</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.ff</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</div><div class='output co'>#&gt; mkin version used for fitting: 0.9.47.6
#&gt; R version used for fitting: 3.5.1
-#&gt; Date of fit: Mon Nov 26 09:47:20 2018
-#&gt; Date of summary: Mon Nov 26 09:47:20 2018
+#&gt; Date of fit: Mon Nov 26 11:41:46 2018
+#&gt; Date of summary: Mon Nov 26 11:41:46 2018
#&gt;
#&gt; Equations:
#&gt; d_parent/dt = - k_parent * parent
@@ -373,7 +373,7 @@ The transformation of sets of formation fractions is fragile, as it supposes
#&gt;
#&gt; Model predictions using solution type deSolve
#&gt;
-#&gt; Fitted with method Port using 186 model solutions performed in 0.847 s
+#&gt; Fitted with method Port using 186 model solutions performed in 0.828 s
#&gt;
#&gt; Weighting: none
#&gt;
@@ -448,8 +448,8 @@ The transformation of sets of formation fractions is fragile, as it supposes
<span class='no'>fit.ff.2</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span>(<span class='no'>SFO_SFO.ff.2</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.ff.2</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</div><div class='output co'>#&gt; mkin version used for fitting: 0.9.47.6
#&gt; R version used for fitting: 3.5.1
-#&gt; Date of fit: Mon Nov 26 09:47:20 2018
-#&gt; Date of summary: Mon Nov 26 09:47:20 2018
+#&gt; Date of fit: Mon Nov 26 11:41:47 2018
+#&gt; Date of summary: Mon Nov 26 11:41:47 2018
#&gt;
#&gt; Equations:
#&gt; d_parent/dt = - k_parent * parent
@@ -457,7 +457,7 @@ The transformation of sets of formation fractions is fragile, as it supposes
#&gt;
#&gt; Model predictions using solution type deSolve
#&gt;
-#&gt; Fitted with method Port using 104 model solutions performed in 0.457 s
+#&gt; Fitted with method Port using 104 model solutions performed in 0.464 s
#&gt;
#&gt; Weighting: none
#&gt;
diff --git a/man/AIC.mmkin.Rd b/man/AIC.mmkin.Rd
new file mode 100644
index 00000000..e7f5c228
--- /dev/null
+++ b/man/AIC.mmkin.Rd
@@ -0,0 +1,44 @@
+\name{AIC.mmkin}
+\alias{AIC.mmkin}
+\title{
+ Calculated the AIC for a column of an mmkin object
+}
+\description{
+ Provides a convenient way to compare different kineti models fitted to the
+ same dataset.
+}
+\usage{
+ \method{AIC}{mmkin}(object, ..., k = 2)
+}
+\arguments{
+ \item{object}{
+ An object of class \code{\link{mmkin}}, containing only one column.
+ }
+ \item{\dots}{
+ For compatibility with the generic method
+ }
+ \item{k}{
+ As in the generic method
+ }
+}
+\value{
+ As in the generic method (a numeric value for single fits, or a dataframe if
+ there are several fits in the column).
+}
+\examples{
+ f <- mmkin(c("SFO", "FOMC", "DFOP"),
+ list("FOCUS A" = FOCUS_2006_A,
+ "FOCUS C" = FOCUS_2006_C))
+ AIC(f[1, "FOCUS A"]) # We get a single number for a single fit
+
+ # For FOCUS A, the models fit almost equally well, so the higher the number
+ # of parameters, the higher (worse) the AIC
+ AIC(f[, "FOCUS A"])
+ AIC(f[, "FOCUS A"], k = 0) # If we do not penalize additional parameters, we get nearly the same
+
+ # For FOCUS C, the more complex models fit better
+ AIC(f[, "FOCUS C"])
+}
+\author{
+ Johannes Ranke
+}
diff --git a/man/logLik.mkinfit.Rd b/man/logLik.mkinfit.Rd
index 8080f3db..fe517955 100644
--- a/man/logLik.mkinfit.Rd
+++ b/man/logLik.mkinfit.Rd
@@ -7,8 +7,8 @@
This function simply calculates the product of the likelihood densities
calculated using \code{\link{dnorm}}, i.e. assuming normal distribution.
- The total number of estimated parameters returned with the value
- of the likelihood is calculated as the sum of fitted degradation
+ The total number of estimated parameters returned with the value
+ of the likelihood is calculated as the sum of fitted degradation
model parameters and the fitted error model parameters.
For the case of unweighted least squares fitting, we calculate one
@@ -17,7 +17,7 @@
For the case of manual weighting, we use the weight given for each
observation as standard deviation in calculating its likelihood
- and the total number of estimated parameters is equal to the
+ and the total number of estimated parameters is equal to the
number of fitted degradation model parameters.
In the case of iterative reweighting, the variances obtained by this
@@ -28,7 +28,7 @@
reweighting method is "tc".
}
\usage{
-\method{logLik}{mkinfit}(object, ...)
+ \method{logLik}{mkinfit}(object, ...)
}
\arguments{
\item{object}{
@@ -43,6 +43,10 @@
estimated parameters (degradation model parameters plus variance
model parameters) as attribute.
}
+\seealso{
+ Compare the AIC of columns of \code{\link{mmkin}} objects using
+ \code{\link{AIC.mmkin}}.
+}
\examples{
sfo_sfo <- mkinmod(
parent = mkinsub("SFO", to = "m1"),

Contact - Imprint