aboutsummaryrefslogtreecommitdiff
path: root/docs/dev/reference
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-10-22 12:41:59 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2020-10-22 12:41:59 +0200
commit6d8dcdf2947b52fa8d58249c8fac1fff5d3439ae (patch)
treeed8e6f53eefe85956182b97134a0924e1c2f022d /docs/dev/reference
parent4a6beafe6ca119500232ecda4b5672dd4a1877c2 (diff)
Update pkgdown docs
Diffstat (limited to 'docs/dev/reference')
-rw-r--r--docs/dev/reference/Rplot001.pngbin19062 -> 14324 bytes
-rw-r--r--docs/dev/reference/Rplot002.pngbin24396 -> 26000 bytes
-rw-r--r--docs/dev/reference/Rplot003.pngbin6583 -> 26194 bytes
-rw-r--r--docs/dev/reference/Rplot004.pngbin28700 -> 26783 bytes
-rw-r--r--docs/dev/reference/Rplot005.pngbin28700 -> 26806 bytes
-rw-r--r--docs/dev/reference/Rplot006.pngbin0 -> 26623 bytes
-rw-r--r--docs/dev/reference/Rplot007.pngbin0 -> 26730 bytes
-rw-r--r--docs/dev/reference/add_err-1.pngbin111278 -> 111359 bytes
-rw-r--r--docs/dev/reference/add_err-2.pngbin63031 -> 64003 bytes
-rw-r--r--docs/dev/reference/add_err-3.pngbin60608 -> 60019 bytes
-rw-r--r--docs/dev/reference/add_err.html67
-rw-r--r--docs/dev/reference/nlme.mmkin-1.pngbin81816 -> 79142 bytes
-rw-r--r--docs/dev/reference/nlme.mmkin-2.pngbin82384 -> 79539 bytes
-rw-r--r--docs/dev/reference/nlme.mmkin-3.pngbin82591 -> 79703 bytes
-rw-r--r--docs/dev/reference/nlme.mmkin-4.pngbin86006 -> 82209 bytes
-rw-r--r--docs/dev/reference/nlme.mmkin-5.pngbin85418 -> 81513 bytes
-rw-r--r--docs/dev/reference/nlme.mmkin-6.pngbin84796 -> 80989 bytes
-rw-r--r--docs/dev/reference/nlme.mmkin-7.pngbin84926 -> 81584 bytes
-rw-r--r--docs/dev/reference/nlme.mmkin.html201
-rw-r--r--docs/dev/reference/sigma_twocomp-1.pngbin0 -> 44554 bytes
-rw-r--r--docs/dev/reference/sigma_twocomp.html44
21 files changed, 200 insertions, 112 deletions
diff --git a/docs/dev/reference/Rplot001.png b/docs/dev/reference/Rplot001.png
index 36b20f09..f001da49 100644
--- a/docs/dev/reference/Rplot001.png
+++ b/docs/dev/reference/Rplot001.png
Binary files differ
diff --git a/docs/dev/reference/Rplot002.png b/docs/dev/reference/Rplot002.png
index b568eb1c..1b15782a 100644
--- a/docs/dev/reference/Rplot002.png
+++ b/docs/dev/reference/Rplot002.png
Binary files differ
diff --git a/docs/dev/reference/Rplot003.png b/docs/dev/reference/Rplot003.png
index 53415e5d..89ba6c49 100644
--- a/docs/dev/reference/Rplot003.png
+++ b/docs/dev/reference/Rplot003.png
Binary files differ
diff --git a/docs/dev/reference/Rplot004.png b/docs/dev/reference/Rplot004.png
index ea685493..7d30a181 100644
--- a/docs/dev/reference/Rplot004.png
+++ b/docs/dev/reference/Rplot004.png
Binary files differ
diff --git a/docs/dev/reference/Rplot005.png b/docs/dev/reference/Rplot005.png
index ea685493..aceec1b5 100644
--- a/docs/dev/reference/Rplot005.png
+++ b/docs/dev/reference/Rplot005.png
Binary files differ
diff --git a/docs/dev/reference/Rplot006.png b/docs/dev/reference/Rplot006.png
new file mode 100644
index 00000000..b3c9f16f
--- /dev/null
+++ b/docs/dev/reference/Rplot006.png
Binary files differ
diff --git a/docs/dev/reference/Rplot007.png b/docs/dev/reference/Rplot007.png
new file mode 100644
index 00000000..225931c4
--- /dev/null
+++ b/docs/dev/reference/Rplot007.png
Binary files differ
diff --git a/docs/dev/reference/add_err-1.png b/docs/dev/reference/add_err-1.png
index 88806d7b..f5686754 100644
--- a/docs/dev/reference/add_err-1.png
+++ b/docs/dev/reference/add_err-1.png
Binary files differ
diff --git a/docs/dev/reference/add_err-2.png b/docs/dev/reference/add_err-2.png
index 6a806c2d..ac220c9e 100644
--- a/docs/dev/reference/add_err-2.png
+++ b/docs/dev/reference/add_err-2.png
Binary files differ
diff --git a/docs/dev/reference/add_err-3.png b/docs/dev/reference/add_err-3.png
index 1919a566..40465b71 100644
--- a/docs/dev/reference/add_err-3.png
+++ b/docs/dev/reference/add_err-3.png
Binary files differ
diff --git a/docs/dev/reference/add_err.html b/docs/dev/reference/add_err.html
index 852ae0d9..e362ab7a 100644
--- a/docs/dev/reference/add_err.html
+++ b/docs/dev/reference/add_err.html
@@ -74,7 +74,7 @@ may depend on the predicted value and is specified as a standard deviation." />
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">mkin</a>
- <span class="version label label-info" data-toggle="tooltip" data-placement="bottom" title="In-development version">0.9.50.3</span>
+ <span class="version label label-info" data-toggle="tooltip" data-placement="bottom" title="In-development version">0.9.50.4</span>
</span>
</div>
@@ -122,7 +122,7 @@ may depend on the predicted value and is specified as a standard deviation." />
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
- <a href="http://github.com/jranke/mkin/">
+ <a href="https://github.com/jranke/mkin/">
<span class="fab fa fab fa-github fa-lg"></span>
</a>
@@ -141,7 +141,7 @@ may depend on the predicted value and is specified as a standard deviation." />
<div class="col-md-9 contents">
<div class="page-header">
<h1>Add normally distributed errors to simulated kinetic degradation data</h1>
- <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/add_err.R'><code>R/add_err.R</code></a></small>
+ <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/add_err.R'><code>R/add_err.R</code></a></small>
<div class="hidden name"><code>add_err.Rd</code></div>
</div>
@@ -151,16 +151,16 @@ degradation model using <code><a href='mkinpredict.html'>mkinpredict</a></code>.
may depend on the predicted value and is specified as a standard deviation.</p>
</div>
- <pre class="usage"><span class='fu'>add_err</span>(
- <span class='no'>prediction</span>,
- <span class='no'>sdfunc</span>,
- <span class='kw'>secondary</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"M1"</span>, <span class='st'>"M2"</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>
+ <pre class="usage"><span class='fu'>add_err</span><span class='op'>(</span>
+ <span class='va'>prediction</span>,
+ <span class='va'>sdfunc</span>,
+ secondary <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"M1"</span>, <span class='st'>"M2"</span><span class='op'>)</span>,
+ n <span class='op'>=</span> <span class='fl'>10</span>,
+ LOD <span class='op'>=</span> <span class='fl'>0.1</span>,
+ reps <span class='op'>=</span> <span class='fl'>2</span>,
+ digits <span class='op'>=</span> <span class='fl'>1</span>,
+ seed <span class='op'>=</span> <span class='cn'>NA</span>
+<span class='op'>)</span></pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments">
@@ -215,46 +215,53 @@ components of the list are datasets compatible with <code><a href='mkinfit.html'
the question. XV Symposium on Pesticide Chemistry 2-4 September 2015,
Piacenza, Italy
https://jrwb.de/posters/piacenza_2015.pdf</p>
+ <h2 class="hasAnchor" id="author"><a class="anchor" href="#author"></a>Author</h2>
+
+ <p>Johannes Ranke</p>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>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'><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='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'>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='va'>m_SFO_SFO</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"M1"</span><span class='op'>)</span>,
+ M1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span><span class='op'>)</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'># Generate a prediction for a specific set of parameters</span>
-<span class='no'>sampling_times</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></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='va'>sampling_times</span> <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>3</span>, <span class='fl'>7</span>, <span class='fl'>14</span>, <span class='fl'>28</span>, <span class='fl'>60</span>, <span class='fl'>90</span>, <span class='fl'>120</span><span class='op'>)</span>
<span class='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'><a href='mkinpredict.html'>mkinpredict</a></span>(<span class='no'>m_SFO_SFO</span>,
- <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></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'><a href='https://rdrr.io/r/base/Log.html'>log</a></span>(<span class='fl'>2</span>)/<span class='fl'>1000</span>),
- <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></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='va'>d_SFO_SFO</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mkinpredict.html'>mkinpredict</a></span><span class='op'>(</span><span class='va'>m_SFO_SFO</span>,
+ <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>k_parent <span class='op'>=</span> <span class='fl'>0.1</span>, f_parent_to_M1 <span class='op'>=</span> <span class='fl'>0.5</span>,
+ k_M1 <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/Log.html'>log</a></span><span class='op'>(</span><span class='fl'>2</span><span class='op'>)</span><span class='op'>/</span><span class='fl'>1000</span><span class='op'>)</span>,
+ <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fl'>100</span>, M1 <span class='op'>=</span> <span class='fl'>0</span><span class='op'>)</span>,
+ <span class='va'>sampling_times</span><span class='op'>)</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='va'>d_SFO_SFO_err</span> <span class='op'>&lt;-</span> <span class='fu'>add_err</span><span class='op'>(</span><span class='va'>d_SFO_SFO</span>, <span class='kw'>function</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span> <span class='fl'>10</span>, n <span class='op'>=</span> <span class='fl'>3</span>, seed <span class='op'>=</span> <span class='fl'>123456789</span> <span class='op'>)</span>
<span class='co'># Name the datasets for nicer plotting</span>
-<span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span>(<span class='no'>d_SFO_SFO_err</span>) <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span>(<span class='st'>"Dataset"</span>, <span class='fl'>1</span>:<span class='fl'>3</span>)
+<span class='fu'><a href='https://rdrr.io/r/base/names.html'>names</a></span><span class='op'>(</span><span class='va'>d_SFO_SFO_err</span><span class='op'>)</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='op'>(</span><span class='st'>"Dataset"</span>, <span class='fl'>1</span><span class='op'>:</span><span class='fl'>3</span><span class='op'>)</span>
<span class='co'># Name the model in the list of models (with only one member in this case) for</span>
<span class='co'># nicer plotting later on. Be quiet and use only one core not to offend CRAN</span>
<span class='co'># checks</span>
<span class='co'># \dontrun{</span>
-<span class='no'>f_SFO_SFO</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></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='va'>f_SFO_SFO</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='st'>"SFO-SFO"</span> <span class='op'>=</span> <span class='va'>m_SFO_SFO</span><span class='op'>)</span>,
+ <span class='va'>d_SFO_SFO_err</span>, cores <span class='op'>=</span> <span class='fl'>1</span>,
+ quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
-<span class='fu'><a href='https://rdrr.io/r/base/plot.html'>plot</a></span>(<span class='no'>f_SFO_SFO</span>)</div><div class='img'><img src='add_err-1.png' alt='' width='700' height='433' /></div><div class='input'>
+<span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_SFO_SFO</span><span class='op'>)</span>
+</div><div class='img'><img src='add_err-1.png' alt='' width='700' height='433' /></div><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'><a href='https://rdrr.io/r/base/plot.html'>plot</a></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><div class='img'><img src='add_err-2.png' alt='' width='700' height='433' /></div><div class='input'>
+<span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_SFO_SFO</span><span class='op'>[[</span><span class='fl'>3</span><span class='op'>]</span><span class='op'>]</span>, show_residuals <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
+</div><div class='img'><img src='add_err-2.png' alt='' width='700' height='433' /></div><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'><a href='https://rdrr.io/r/base/plot.html'>plot</a></span>(<span class='no'>f_SFO_SFO</span>[<span class='fl'>1</span>, <span class='fl'>3</span>])</div><div class='img'><img src='add_err-3.png' alt='' width='700' height='433' /></div><div class='input'># }
+<span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_SFO_SFO</span><span class='op'>[</span><span class='fl'>1</span>, <span class='fl'>3</span><span class='op'>]</span><span class='op'>)</span>
+</div><div class='img'><img src='add_err-3.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># }</span>
</div></pre>
</div>
@@ -272,7 +279,7 @@ https://jrwb.de/posters/piacenza_2015.pdf</p>
</div>
<div class="pkgdown">
- <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p>
+ <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>
</footer>
diff --git a/docs/dev/reference/nlme.mmkin-1.png b/docs/dev/reference/nlme.mmkin-1.png
index 67f279da..564f7e2b 100644
--- a/docs/dev/reference/nlme.mmkin-1.png
+++ b/docs/dev/reference/nlme.mmkin-1.png
Binary files differ
diff --git a/docs/dev/reference/nlme.mmkin-2.png b/docs/dev/reference/nlme.mmkin-2.png
index 16a5d7bd..a9ce4636 100644
--- a/docs/dev/reference/nlme.mmkin-2.png
+++ b/docs/dev/reference/nlme.mmkin-2.png
Binary files differ
diff --git a/docs/dev/reference/nlme.mmkin-3.png b/docs/dev/reference/nlme.mmkin-3.png
index 73426834..0b7ce0f6 100644
--- a/docs/dev/reference/nlme.mmkin-3.png
+++ b/docs/dev/reference/nlme.mmkin-3.png
Binary files differ
diff --git a/docs/dev/reference/nlme.mmkin-4.png b/docs/dev/reference/nlme.mmkin-4.png
index 9b46b425..d7c68dd5 100644
--- a/docs/dev/reference/nlme.mmkin-4.png
+++ b/docs/dev/reference/nlme.mmkin-4.png
Binary files differ
diff --git a/docs/dev/reference/nlme.mmkin-5.png b/docs/dev/reference/nlme.mmkin-5.png
index 3398dd4a..2c299b08 100644
--- a/docs/dev/reference/nlme.mmkin-5.png
+++ b/docs/dev/reference/nlme.mmkin-5.png
Binary files differ
diff --git a/docs/dev/reference/nlme.mmkin-6.png b/docs/dev/reference/nlme.mmkin-6.png
index 7b663991..2bcb9cec 100644
--- a/docs/dev/reference/nlme.mmkin-6.png
+++ b/docs/dev/reference/nlme.mmkin-6.png
Binary files differ
diff --git a/docs/dev/reference/nlme.mmkin-7.png b/docs/dev/reference/nlme.mmkin-7.png
index d2c38a63..30e2d351 100644
--- a/docs/dev/reference/nlme.mmkin-7.png
+++ b/docs/dev/reference/nlme.mmkin-7.png
Binary files differ
diff --git a/docs/dev/reference/nlme.mmkin.html b/docs/dev/reference/nlme.mmkin.html
index 16df54af..d186d785 100644
--- a/docs/dev/reference/nlme.mmkin.html
+++ b/docs/dev/reference/nlme.mmkin.html
@@ -74,7 +74,7 @@ have been obtained by fitting the same model to a list of datasets." />
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">mkin</a>
- <span class="version label label-info" data-toggle="tooltip" data-placement="bottom" title="In-development version">0.9.50.3</span>
+ <span class="version label label-info" data-toggle="tooltip" data-placement="bottom" title="In-development version">0.9.50.4</span>
</span>
</div>
@@ -122,7 +122,7 @@ have been obtained by fitting the same model to a list of datasets." />
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
- <a href="http://github.com/jranke/mkin/">
+ <a href="https://github.com/jranke/mkin/">
<span class="fab fa fab fa-github fa-lg"></span>
</a>
@@ -141,7 +141,7 @@ have been obtained by fitting the same model to a list of datasets." />
<div class="col-md-9 contents">
<div class="page-header">
<h1>Create an nlme model for an mmkin row object</h1>
- <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/nlme.mmkin.R'><code>R/nlme.mmkin.R</code></a></small>
+ <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/nlme.mmkin.R'><code>R/nlme.mmkin.R</code></a></small>
<div class="hidden name"><code>nlme.mmkin.Rd</code></div>
</div>
@@ -152,28 +152,28 @@ have been obtained by fitting the same model to a list of datasets.</p>
</div>
<pre class="usage"><span class='co'># S3 method for mmkin</span>
-<span class='fu'>nlme</span>(
- <span class='no'>model</span>,
- <span class='kw'>data</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/sys.parent.html'>sys.frame</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/sys.parent.html'>sys.parent</a></span>()),
- <span class='no'>fixed</span>,
- <span class='kw'>random</span> <span class='kw'>=</span> <span class='no'>fixed</span>,
- <span class='no'>groups</span>,
- <span class='no'>start</span>,
- <span class='kw'>correlation</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
- <span class='kw'>weights</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
- <span class='no'>subset</span>,
- <span class='kw'>method</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"ML"</span>, <span class='st'>"REML"</span>),
- <span class='kw'>na.action</span> <span class='kw'>=</span> <span class='no'>na.fail</span>,
- <span class='no'>naPattern</span>,
- <span class='kw'>control</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(),
- <span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>
-)
+<span class='fu'>nlme</span><span class='op'>(</span>
+ <span class='va'>model</span>,
+ data <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/sys.parent.html'>sys.frame</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/sys.parent.html'>sys.parent</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span>,
+ <span class='va'>fixed</span>,
+ random <span class='op'>=</span> <span class='va'>fixed</span>,
+ <span class='va'>groups</span>,
+ <span class='va'>start</span>,
+ correlation <span class='op'>=</span> <span class='cn'>NULL</span>,
+ weights <span class='op'>=</span> <span class='cn'>NULL</span>,
+ <span class='va'>subset</span>,
+ method <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"ML"</span>, <span class='st'>"REML"</span><span class='op'>)</span>,
+ na.action <span class='op'>=</span> <span class='va'>na.fail</span>,
+ <span class='va'>naPattern</span>,
+ control <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='op'>)</span>,
+ verbose <span class='op'>=</span> <span class='cn'>FALSE</span>
+<span class='op'>)</span>
<span class='co'># S3 method for nlme.mmkin</span>
-<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span>(<span class='no'>x</span>, <span class='no'>...</span>)
+<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>x</span>, <span class='va'>...</span><span class='op'>)</span>
<span class='co'># S3 method for nlme.mmkin</span>
-<span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span>(<span class='no'>object</span>, <span class='no'>...</span>)</pre>
+<span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span><span class='op'>(</span><span class='va'>object</span>, <span class='va'>...</span><span class='op'>)</span></pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments">
@@ -257,38 +257,43 @@ parameters taken from the mmkin object are used</p></td>
with additional elements</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
- <div class='dont-index'><p><code><a href='nlme.html'>nlme_function</a></code></p></div>
+ <div class='dont-index'><p><code><a href='nlme_function.html'>nlme_function</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'>ds</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span>(<span class='no'>experimental_data_for_UBA_2019</span>[<span class='fl'>6</span>:<span class='fl'>10</span>],
- <span class='kw'>function</span>(<span class='no'>x</span>) <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span>(<span class='no'>x</span>$<span class='no'>data</span>[<span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"name"</span>, <span class='st'>"time"</span>, <span class='st'>"value"</span>)], <span class='no'>name</span> <span class='kw'>==</span> <span class='st'>"parent"</span>))
-<span class='no'>f</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span>(<span class='st'>"SFO"</span>, <span class='no'>ds</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>cores</span> <span class='kw'>=</span> <span class='fl'>1</span>)</div><div class='output co'>#&gt; <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0195</span></div><div class='output co'>#&gt; <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.011</span></div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/library.html'>library</a></span>(<span class='no'>nlme</span>)
-<span class='fu'><a href='endpoints.html'>endpoints</a></span>(<span class='no'>f</span><span class='kw'>[[</span><span class='fl'>1</span>]])</div><div class='output co'>#&gt; $distimes
-#&gt; DT50 DT90
-#&gt; parent 11.96183 39.73634
-#&gt; </div><div class='input'><span class='no'>f_nlme</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span>(<span class='no'>f</span>)
-<span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span>(<span class='no'>f_nlme</span>)</div><div class='output co'>#&gt; Nonlinear mixed-effects model fit by maximum likelihood
-#&gt; Model: value ~ (mkin::get_deg_func())(name, time, parent_0, log_k_parent)
+ <pre class="examples"><div class='input'><span class='va'>ds</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='va'>experimental_data_for_UBA_2019</span><span class='op'>[</span><span class='fl'>6</span><span class='op'>:</span><span class='fl'>10</span><span class='op'>]</span>,
+ <span class='kw'>function</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span> <span class='fu'><a href='https://rdrr.io/r/base/subset.html'>subset</a></span><span class='op'>(</span><span class='va'>x</span><span class='op'>$</span><span class='va'>data</span><span class='op'>[</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"name"</span>, <span class='st'>"time"</span>, <span class='st'>"value"</span><span class='op'>)</span><span class='op'>]</span>, <span class='va'>name</span> <span class='op'>==</span> <span class='st'>"parent"</span><span class='op'>)</span><span class='op'>)</span>
+<span class='va'>f</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"DFOP"</span><span class='op'>)</span>, <span class='va'>ds</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, cores <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span>
+</div><div class='output co'>#&gt; <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.0195</span></div><div class='output co'>#&gt; <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.00985</span></div><div class='output co'>#&gt; <span class='warning'>Warning: Shapiro-Wilk test for standardized residuals: p = 0.011</span></div><div class='input'><span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://svn.r-project.org/R-packages/trunk/nlme/'>nlme</a></span><span class='op'>)</span>
+<span class='va'>f_nlme_sfo</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f</span><span class='op'>[</span><span class='st'>"SFO"</span>, <span class='op'>]</span><span class='op'>)</span>
+<span class='va'>f_nlme_dfop</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f</span><span class='op'>[</span><span class='st'>"DFOP"</span>, <span class='op'>]</span><span class='op'>)</span>
+<span class='fu'><a href='https://rdrr.io/r/stats/AIC.html'>AIC</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo</span>, <span class='va'>f_nlme_dfop</span><span class='op'>)</span>
+</div><div class='output co'>#&gt; df AIC
+#&gt; f_nlme_sfo 5 625.0539
+#&gt; f_nlme_dfop 9 495.1270</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop</span><span class='op'>)</span>
+</div><div class='output co'>#&gt; Nonlinear mixed-effects model fit by maximum likelihood
+#&gt; Model: value ~ (mkin::get_deg_func())(name, time, parent_0, log_k1, log_k2, g_ilr)
#&gt; Data: "Not shown"
-#&gt; Log-likelihood: -307.5269
-#&gt; Fixed: list(parent_0 ~ 1, log_k_parent ~ 1)
-#&gt; parent_0 log_k_parent
-#&gt; 85.541149 -3.229596
+#&gt; Log-likelihood: -238.5635
+#&gt; Fixed: list(parent_0 ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_ilr ~ 1)
+#&gt; parent_0 log_k1 log_k2 g_ilr
+#&gt; 94.17015133 -1.80015306 -4.14738870 0.02290935
#&gt;
#&gt; Random effects:
-#&gt; Formula: list(parent_0 ~ 1, log_k_parent ~ 1)
+#&gt; Formula: list(parent_0 ~ 1, log_k1 ~ 1, log_k2 ~ 1, g_ilr ~ 1)
#&gt; Level: ds
#&gt; Structure: Diagonal
-#&gt; parent_0 log_k_parent Residual
-#&gt; StdDev: 1.30857 1.288591 6.304906
+#&gt; parent_0 log_k1 log_k2 g_ilr Residual
+#&gt; StdDev: 2.488249 0.8447273 1.32965 0.3289311 2.321364
#&gt;
#&gt; Number of Observations: 90
-#&gt; Number of Groups: 5 </div><div class='input'><span class='fu'><a href='endpoints.html'>endpoints</a></span>(<span class='no'>f_nlme</span>)</div><div class='output co'>#&gt; $distimes
-#&gt; DT50 DT90
-#&gt; parent 17.51545 58.18505
+#&gt; Number of Groups: 5 </div><div class='input'><span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop</span><span class='op'>)</span>
+</div><div class='output co'>#&gt; $distimes
+#&gt; DT50 DT90 DT50back DT50_k1 DT50_k2
+#&gt; parent 10.79857 100.7937 30.34193 4.193938 43.85443
#&gt; </div><div class='input'><span class='co'># \dontrun{</span>
- <span class='no'>f_nlme_2</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span>(<span class='no'>f</span>, <span class='kw'>start</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='kw'>parent_0</span> <span class='kw'>=</span> <span class='fl'>100</span>, <span class='kw'>log_k_parent_sink</span> <span class='kw'>=</span> <span class='fl'>0.1</span>))
- <span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span>(<span class='no'>f_nlme_2</span>, <span class='kw'>random</span> <span class='kw'>=</span> <span class='no'>parent_0</span> ~ <span class='fl'>1</span>)</div><div class='output co'>#&gt; Nonlinear mixed-effects model fit by maximum likelihood
+ <span class='va'>f_nlme_2</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f</span><span class='op'>[</span><span class='st'>"SFO"</span>, <span class='op'>]</span>, start <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span>parent_0 <span class='op'>=</span> <span class='fl'>100</span>, log_k_parent <span class='op'>=</span> <span class='fl'>0.1</span><span class='op'>)</span><span class='op'>)</span>
+ <span class='fu'><a href='https://rdrr.io/r/stats/update.html'>update</a></span><span class='op'>(</span><span class='va'>f_nlme_2</span>, random <span class='op'>=</span> <span class='va'>parent_0</span> <span class='op'>~</span> <span class='fl'>1</span><span class='op'>)</span>
+</div><div class='output co'>#&gt; Nonlinear mixed-effects model fit by maximum likelihood
#&gt; Model: value ~ (mkin::get_deg_func())(name, time, parent_0, log_k_parent)
#&gt; Data: "Not shown"
#&gt; Log-likelihood: -404.3729
@@ -302,34 +307,37 @@ with additional elements</p>
#&gt; StdDev: 0.002416792 21.63027
#&gt;
#&gt; Number of Observations: 90
-#&gt; Number of Groups: 5 </div><div class='input'> <span class='co'># Test on some real data</span>
- <span class='no'>ds_2</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span>(<span class='no'>experimental_data_for_UBA_2019</span>[<span class='fl'>6</span>:<span class='fl'>10</span>],
- <span class='kw'>function</span>(<span class='no'>x</span>) <span class='no'>x</span>$<span class='no'>data</span>[<span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span>(<span class='st'>"name"</span>, <span class='st'>"time"</span>, <span class='st'>"value"</span>)])
- <span class='no'>m_sfo_sfo</span> <span class='kw'>&lt;-</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='st'>"A1"</span>),
- <span class='kw'>A1</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'>"min"</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
- <span class='no'>m_sfo_sfo_ff</span> <span class='kw'>&lt;-</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='st'>"A1"</span>),
- <span class='kw'>A1</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>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
- <span class='no'>m_fomc_sfo</span> <span class='kw'>&lt;-</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'>"FOMC"</span>, <span class='st'>"A1"</span>),
- <span class='kw'>A1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>), <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
- <span class='no'>m_dfop_sfo</span> <span class='kw'>&lt;-</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'>"DFOP"</span>, <span class='st'>"A1"</span>),
- <span class='kw'>A1</span> <span class='kw'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span>(<span class='st'>"SFO"</span>), <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
-
- <span class='no'>f_2</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span>(<span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='st'>"SFO-SFO"</span> <span class='kw'>=</span> <span class='no'>m_sfo_sfo</span>,
- <span class='st'>"SFO-SFO-ff"</span> <span class='kw'>=</span> <span class='no'>m_sfo_sfo_ff</span>,
- <span class='st'>"FOMC-SFO"</span> <span class='kw'>=</span> <span class='no'>m_fomc_sfo</span>,
- <span class='st'>"DFOP-SFO"</span> <span class='kw'>=</span> <span class='no'>m_dfop_sfo</span>),
- <span class='no'>ds_2</span>, <span class='kw'>quiet</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)
- <span class='fu'><a href='https://rdrr.io/r/base/plot.html'>plot</a></span>(<span class='no'>f_2</span>[<span class='st'>"SFO-SFO"</span>, <span class='fl'>3</span>:<span class='fl'>4</span>]) <span class='co'># Separate fits for datasets 3 and 4</span></div><div class='img'><img src='nlme.mmkin-1.png' alt='' width='700' height='433' /></div><div class='input'>
- <span class='no'>f_nlme_sfo_sfo</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span>(<span class='no'>f_2</span>[<span class='st'>"SFO-SFO"</span>, ])
+#&gt; Number of Groups: 5 </div><div class='input'> <span class='va'>ds_2</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/lapply.html'>lapply</a></span><span class='op'>(</span><span class='va'>experimental_data_for_UBA_2019</span><span class='op'>[</span><span class='fl'>6</span><span class='op'>:</span><span class='fl'>10</span><span class='op'>]</span>,
+ <span class='kw'>function</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span> <span class='va'>x</span><span class='op'>$</span><span class='va'>data</span><span class='op'>[</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"name"</span>, <span class='st'>"time"</span>, <span class='st'>"value"</span><span class='op'>)</span><span class='op'>]</span><span class='op'>)</span>
+ <span class='va'>m_sfo_sfo</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"A1"</span><span class='op'>)</span>,
+ A1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"min"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
+ <span class='va'>m_sfo_sfo_ff</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"A1"</span><span class='op'>)</span>,
+ A1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, use_of_ff <span class='op'>=</span> <span class='st'>"max"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
+ <span class='va'>m_fomc_sfo</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"FOMC"</span>, <span class='st'>"A1"</span><span class='op'>)</span>,
+ A1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
+ <span class='va'>m_dfop_sfo</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mkinmod.html'>mkinmod</a></span><span class='op'>(</span>parent <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"DFOP"</span>, <span class='st'>"A1"</span><span class='op'>)</span>,
+ A1 <span class='op'>=</span> <span class='fu'><a href='mkinsub.html'>mkinsub</a></span><span class='op'>(</span><span class='st'>"SFO"</span><span class='op'>)</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
+
+ <span class='va'>f_2</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='st'>"SFO-SFO"</span> <span class='op'>=</span> <span class='va'>m_sfo_sfo</span>,
+ <span class='st'>"SFO-SFO-ff"</span> <span class='op'>=</span> <span class='va'>m_sfo_sfo_ff</span>,
+ <span class='st'>"FOMC-SFO"</span> <span class='op'>=</span> <span class='va'>m_fomc_sfo</span>,
+ <span class='st'>"DFOP-SFO"</span> <span class='op'>=</span> <span class='va'>m_dfop_sfo</span><span class='op'>)</span>,
+ <span class='va'>ds_2</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
+ <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"SFO-SFO"</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>]</span><span class='op'>)</span> <span class='co'># Separate fits for datasets 3 and 4</span>
+</div><div class='img'><img src='nlme.mmkin-1.png' alt='' width='700' height='433' /></div><div class='input'>
+ <span class='va'>f_nlme_sfo_sfo</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"SFO-SFO"</span>, <span class='op'>]</span><span class='op'>)</span>
<span class='co'># plot(f_nlme_sfo_sfo) # not feasible with pkgdown figures</span>
- <span class='fu'><a href='https://rdrr.io/r/base/plot.html'>plot</a></span>(<span class='no'>f_nlme_sfo_sfo</span>, <span class='fl'>3</span>:<span class='fl'>4</span>) <span class='co'># Global mixed model: Fits for datasets 3 and 4</span></div><div class='img'><img src='nlme.mmkin-2.png' alt='' width='700' height='433' /></div><div class='input'>
+ <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo_sfo</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>)</span> <span class='co'># Global mixed model: Fits for datasets 3 and 4</span>
+</div><div class='img'><img src='nlme.mmkin-2.png' alt='' width='700' height='433' /></div><div class='input'>
<span class='co'># With formation fractions</span>
- <span class='no'>f_nlme_sfo_sfo_ff</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span>(<span class='no'>f_2</span>[<span class='st'>"SFO-SFO-ff"</span>, ])
- <span class='fu'><a href='https://rdrr.io/r/base/plot.html'>plot</a></span>(<span class='no'>f_nlme_sfo_sfo_ff</span>, <span class='fl'>3</span>:<span class='fl'>4</span>) <span class='co'># chi2 different due to different df attribution</span></div><div class='img'><img src='nlme.mmkin-3.png' alt='' width='700' height='433' /></div><div class='input'>
+ <span class='va'>f_nlme_sfo_sfo_ff</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"SFO-SFO-ff"</span>, <span class='op'>]</span><span class='op'>)</span>
+ <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo_sfo_ff</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>)</span> <span class='co'># chi2 different due to different df attribution</span>
+</div><div class='img'><img src='nlme.mmkin-3.png' alt='' width='700' height='433' /></div><div class='input'>
<span class='co'># For more parameters, we need to increase pnlsMaxIter and the tolerance</span>
<span class='co'># to get convergence</span>
- <span class='no'>f_nlme_fomc_sfo</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span>(<span class='no'>f_2</span>[<span class='st'>"FOMC-SFO"</span>, ],
- <span class='kw'>control</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>pnlsMaxIter</span> <span class='kw'>=</span> <span class='fl'>100</span>, <span class='kw'>tolerance</span> <span class='kw'>=</span> <span class='fl'>1e-4</span>), <span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><div class='output co'>#&gt;
+ <span class='va'>f_nlme_fomc_sfo</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"FOMC-SFO"</span>, <span class='op'>]</span>,
+ control <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>pnlsMaxIter <span class='op'>=</span> <span class='fl'>100</span>, tolerance <span class='op'>=</span> <span class='fl'>1e-4</span><span class='op'>)</span>, verbose <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
+</div><div class='output co'>#&gt;
#&gt; **Iteration 1
#&gt; LME step: Loglik: -394.1603, nlminb iterations: 3
#&gt; reStruct parameters:
@@ -380,8 +388,9 @@ with additional elements</p>
#&gt; iterations: 100
#&gt; Convergence crit. (must all become &lt;= tolerance = 0.0001):
#&gt; fixed reStruct
-#&gt; 1.027451e-06 2.275704e-05 </div><div class='input'> <span class='no'>f_nlme_dfop_sfo</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span>(<span class='no'>f_2</span>[<span class='st'>"DFOP-SFO"</span>, ],
- <span class='kw'>control</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span>(<span class='kw'>pnlsMaxIter</span> <span class='kw'>=</span> <span class='fl'>120</span>, <span class='kw'>tolerance</span> <span class='kw'>=</span> <span class='fl'>5e-4</span>), <span class='kw'>verbose</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</div><div class='output co'>#&gt;
+#&gt; 1.027451e-06 2.275704e-05 </div><div class='input'> <span class='va'>f_nlme_dfop_sfo</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"DFOP-SFO"</span>, <span class='op'>]</span>,
+ control <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>pnlsMaxIter <span class='op'>=</span> <span class='fl'>120</span>, tolerance <span class='op'>=</span> <span class='fl'>5e-4</span><span class='op'>)</span>, verbose <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
+</div><div class='output co'>#&gt;
#&gt; **Iteration 1
#&gt; LME step: Loglik: -404.9582, nlminb iterations: 1
#&gt; reStruct parameters:
@@ -406,15 +415,22 @@ with additional elements</p>
#&gt; iterations: 120
#&gt; Convergence crit. (must all become &lt;= tolerance = 0.0005):
#&gt; fixed reStruct
-#&gt; 4.789774e-07 2.200661e-05 </div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/plot.html'>plot</a></span>(<span class='no'>f_2</span>[<span class='st'>"FOMC-SFO"</span>, <span class='fl'>3</span>:<span class='fl'>4</span>])</div><div class='img'><img src='nlme.mmkin-4.png' alt='' width='700' height='433' /></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/plot.html'>plot</a></span>(<span class='no'>f_nlme_fomc_sfo</span>, <span class='fl'>3</span>:<span class='fl'>4</span>)</div><div class='img'><img src='nlme.mmkin-5.png' alt='' width='700' height='433' /></div><div class='input'>
- <span class='fu'><a href='https://rdrr.io/r/base/plot.html'>plot</a></span>(<span class='no'>f_2</span>[<span class='st'>"DFOP-SFO"</span>, <span class='fl'>3</span>:<span class='fl'>4</span>])</div><div class='img'><img src='nlme.mmkin-6.png' alt='' width='700' height='433' /></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/base/plot.html'>plot</a></span>(<span class='no'>f_nlme_dfop_sfo</span>, <span class='fl'>3</span>:<span class='fl'>4</span>)</div><div class='img'><img src='nlme.mmkin-7.png' alt='' width='700' height='433' /></div><div class='input'>
- <span class='fu'><a href='https://rdrr.io/r/stats/anova.html'>anova</a></span>(<span class='no'>f_nlme_dfop_sfo</span>, <span class='no'>f_nlme_fomc_sfo</span>, <span class='no'>f_nlme_sfo_sfo</span>)</div><div class='output co'>#&gt; Model df AIC BIC logLik Test L.Ratio p-value
+#&gt; 4.789774e-07 2.200661e-05 </div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"FOMC-SFO"</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>]</span><span class='op'>)</span>
+</div><div class='img'><img src='nlme.mmkin-4.png' alt='' width='700' height='433' /></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_fomc_sfo</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>)</span>
+</div><div class='img'><img src='nlme.mmkin-5.png' alt='' width='700' height='433' /></div><div class='input'>
+ <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_2</span><span class='op'>[</span><span class='st'>"DFOP-SFO"</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>]</span><span class='op'>)</span>
+</div><div class='img'><img src='nlme.mmkin-6.png' alt='' width='700' height='433' /></div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/graphics/plot.default.html'>plot</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>4</span><span class='op'>)</span>
+</div><div class='img'><img src='nlme.mmkin-7.png' alt='' width='700' height='433' /></div><div class='input'>
+ <span class='fu'><a href='https://rdrr.io/r/stats/anova.html'>anova</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span>, <span class='va'>f_nlme_fomc_sfo</span>, <span class='va'>f_nlme_sfo_sfo</span><span class='op'>)</span>
+</div><div class='output co'>#&gt; Model df AIC BIC logLik Test L.Ratio p-value
#&gt; f_nlme_dfop_sfo 1 13 843.8547 884.6201 -408.9273
#&gt; f_nlme_fomc_sfo 2 11 818.5149 853.0087 -398.2575 1 vs 2 21.33975 &lt;.0001
-#&gt; f_nlme_sfo_sfo 3 9 1085.1821 1113.4043 -533.5910 2 vs 3 270.66716 &lt;.0001</div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/stats/anova.html'>anova</a></span>(<span class='no'>f_nlme_dfop_sfo</span>, <span class='no'>f_nlme_sfo_sfo</span>) <span class='co'># if we ignore FOMC</span></div><div class='output co'>#&gt; Model df AIC BIC logLik Test L.Ratio p-value
+#&gt; f_nlme_sfo_sfo 3 9 1085.1821 1113.4043 -533.5910 2 vs 3 270.66716 &lt;.0001</div><div class='input'> <span class='fu'><a href='https://rdrr.io/r/stats/anova.html'>anova</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span>, <span class='va'>f_nlme_sfo_sfo</span><span class='op'>)</span> <span class='co'># if we ignore FOMC</span>
+</div><div class='output co'>#&gt; Model df AIC BIC logLik Test L.Ratio p-value
#&gt; f_nlme_dfop_sfo 1 13 843.8547 884.6201 -408.9273
#&gt; f_nlme_sfo_sfo 2 9 1085.1821 1113.4043 -533.5910 1 vs 2 249.3274 &lt;.0001</div><div class='input'>
- <span class='fu'><a href='endpoints.html'>endpoints</a></span>(<span class='no'>f_nlme_sfo_sfo</span>)</div><div class='output co'>#&gt; $ff
+ <span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo_sfo</span><span class='op'>)</span>
+</div><div class='output co'>#&gt; $ff
#&gt; parent_sink parent_A1 A1_sink
#&gt; 0.5912432 0.4087568 1.0000000
#&gt;
@@ -422,7 +438,8 @@ with additional elements</p>
#&gt; DT50 DT90
#&gt; parent 19.13518 63.5657
#&gt; A1 66.02155 219.3189
-#&gt; </div><div class='input'> <span class='fu'><a href='endpoints.html'>endpoints</a></span>(<span class='no'>f_nlme_dfop_sfo</span>)</div><div class='output co'>#&gt; $ff
+#&gt; </div><div class='input'> <span class='fu'><a href='endpoints.html'>endpoints</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_sfo</span><span class='op'>)</span>
+</div><div class='output co'>#&gt; $ff
#&gt; parent_A1 parent_sink
#&gt; 0.2768574 0.7231426
#&gt;
@@ -430,7 +447,37 @@ with additional elements</p>
#&gt; DT50 DT90 DT50back DT50_k1 DT50_k2
#&gt; parent 11.07091 104.6320 31.49738 4.462384 46.20825
#&gt; A1 162.30536 539.1667 NA NA NA
-#&gt; </div><div class='input'># }
+#&gt; </div><div class='input'>
+ <span class='kw'>if</span> <span class='op'>(</span><span class='fu'>findFunction</span><span class='op'>(</span><span class='st'>"varConstProp"</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span> <span class='co'># tc error model for nlme available</span>
+ <span class='co'># Attempts to fit metabolite kinetics with the tc error model</span>
+ <span class='co'>#f_2_tc &lt;- mmkin(list("SFO-SFO" = m_sfo_sfo,</span>
+ <span class='co'># "SFO-SFO-ff" = m_sfo_sfo_ff,</span>
+ <span class='co'># "FOMC-SFO" = m_fomc_sfo,</span>
+ <span class='co'># "DFOP-SFO" = m_dfop_sfo),</span>
+ <span class='co'># ds_2, quiet = TRUE,</span>
+ <span class='co'># error_model = "tc")</span>
+ <span class='co'>#f_nlme_sfo_sfo_tc &lt;- nlme(f_2_tc["SFO-SFO", ], control = list(maxIter = 100))</span>
+ <span class='co'>#f_nlme_dfop_sfo_tc &lt;- nlme(f_2_tc["DFOP-SFO", ])</span>
+ <span class='co'>#f_nlme_dfop_sfo_tc &lt;- update(f_nlme_dfop_sfo, weights = varConstProp(),</span>
+ <span class='co'># control = list(sigma = 1, msMaxIter = 100, pnlsMaxIter = 15))</span>
+ <span class='co'># Fitting metabolite kinetics with nlme.mmkin and the two-component</span>
+ <span class='co'># error model currently does not work, at least not with these data.</span>
+
+ <span class='va'>f_tc</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='st'>"DFOP"</span><span class='op'>)</span>, <span class='va'>ds</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span><span class='op'>)</span>
+ <span class='va'>f_nlme_sfo_tc</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_tc</span><span class='op'>[</span><span class='st'>"SFO"</span>, <span class='op'>]</span><span class='op'>)</span>
+ <span class='va'>f_nlme_dfop_tc</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_tc</span><span class='op'>[</span><span class='st'>"DFOP"</span>, <span class='op'>]</span><span class='op'>)</span>
+ <span class='fu'><a href='https://rdrr.io/r/stats/AIC.html'>AIC</a></span><span class='op'>(</span><span class='va'>f_nlme_sfo</span>, <span class='va'>f_nlme_sfo_tc</span>, <span class='va'>f_nlme_dfop</span>, <span class='va'>f_nlme_dfop_tc</span><span class='op'>)</span>
+ <span class='fu'><a href='https://rdrr.io/r/base/print.html'>print</a></span><span class='op'>(</span><span class='va'>f_nlme_dfop_tc</span><span class='op'>)</span>
+ <span class='op'>}</span>
+</div><div class='output co'>#&gt; <span class='error'>Error in if (findFunction("varConstProp")) { f_tc &lt;- mmkin(c("SFO", "DFOP"), ds, quiet = TRUE, error_model = "tc") f_nlme_sfo_tc &lt;- nlme(f_tc["SFO", ]) f_nlme_dfop_tc &lt;- nlme(f_tc["DFOP", ]) AIC(f_nlme_sfo, f_nlme_sfo_tc, f_nlme_dfop, f_nlme_dfop_tc) print(f_nlme_dfop_tc)}: argument is not interpretable as logical</span></div><div class='input'> <span class='va'>f_2_obs</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mmkin.html'>mmkin</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span><span class='st'>"SFO-SFO"</span> <span class='op'>=</span> <span class='va'>m_sfo_sfo</span>,
+ <span class='st'>"DFOP-SFO"</span> <span class='op'>=</span> <span class='va'>m_dfop_sfo</span><span class='op'>)</span>,
+ <span class='va'>ds_2</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span>, error_model <span class='op'>=</span> <span class='st'>"obs"</span><span class='op'>)</span>
+ <span class='va'>f_nlme_sfo_sfo_obs</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/nlme.html'>nlme</a></span><span class='op'>(</span><span class='va'>f_2_obs</span><span class='op'>[</span><span class='st'>"SFO-SFO"</span>, <span class='op'>]</span><span class='op'>)</span>
+ <span class='co'># The same with DFOP-SFO does not converge, apparently the variances of</span>
+ <span class='co'># parent and A1 are too similar in this case, so that the model is</span>
+ <span class='co'># overparameterised</span>
+ <span class='co'>#f_nlme_dfop_sfo_obs &lt;- nlme(f_2_obs["DFOP-SFO", ], control = list(maxIter = 100))</span>
+<span class='co'># }</span>
</div></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
@@ -447,7 +494,7 @@ with additional elements</p>
</div>
<div class="pkgdown">
- <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p>
+ <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>
</footer>
diff --git a/docs/dev/reference/sigma_twocomp-1.png b/docs/dev/reference/sigma_twocomp-1.png
new file mode 100644
index 00000000..21db3145
--- /dev/null
+++ b/docs/dev/reference/sigma_twocomp-1.png
Binary files differ
diff --git a/docs/dev/reference/sigma_twocomp.html b/docs/dev/reference/sigma_twocomp.html
index fd5c603e..ecea8499 100644
--- a/docs/dev/reference/sigma_twocomp.html
+++ b/docs/dev/reference/sigma_twocomp.html
@@ -73,7 +73,7 @@ dependence of the measured value \(y\):" />
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">mkin</a>
- <span class="version label label-info" data-toggle="tooltip" data-placement="bottom" title="In-development version">0.9.50.3</span>
+ <span class="version label label-info" data-toggle="tooltip" data-placement="bottom" title="In-development version">0.9.50.4</span>
</span>
</div>
@@ -121,7 +121,7 @@ dependence of the measured value \(y\):" />
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
- <a href="http://github.com/jranke/mkin/">
+ <a href="https://github.com/jranke/mkin/">
<span class="fab fa fab fa-github fa-lg"></span>
</a>
@@ -140,7 +140,7 @@ dependence of the measured value \(y\):" />
<div class="col-md-9 contents">
<div class="page-header">
<h1>Two-component error model</h1>
- <small class="dont-index">Source: <a href='http://github.com/jranke/mkin/blob/master/R/sigma_twocomp.R'><code>R/sigma_twocomp.R</code></a></small>
+ <small class="dont-index">Source: <a href='https://github.com/jranke/mkin/blob/master/R/sigma_twocomp.R'><code>R/sigma_twocomp.R</code></a></small>
<div class="hidden name"><code>sigma_twocomp.Rd</code></div>
</div>
@@ -149,7 +149,7 @@ dependence of the measured value \(y\):" />
dependence of the measured value \(y\):</p>
</div>
- <pre class="usage"><span class='fu'>sigma_twocomp</span>(<span class='no'>y</span>, <span class='no'>sigma_low</span>, <span class='no'>rsd_high</span>)</pre>
+ <pre class="usage"><span class='fu'>sigma_twocomp</span><span class='op'>(</span><span class='va'>y</span>, <span class='va'>sigma_low</span>, <span class='va'>rsd_high</span><span class='op'>)</span></pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments">
@@ -189,6 +189,40 @@ Additive, Multiplicative, and Mixed Analytical Errors. Clinical Chemistry
<p>Rocke, David M. and Lorenzato, Stefan (1995) A two-component model for
measurement error in analytical chemistry. Technometrics 37(2), 176-184.</p>
+ <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
+ <pre class="examples"><div class='input'><span class='va'>times</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>3</span>, <span class='fl'>7</span>, <span class='fl'>14</span>, <span class='fl'>28</span>, <span class='fl'>60</span>, <span class='fl'>90</span>, <span class='fl'>120</span><span class='op'>)</span>
+<span class='va'>d_pred</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a></span><span class='op'>(</span>time <span class='op'>=</span> <span class='va'>times</span>, parent <span class='op'>=</span> <span class='fl'>100</span> <span class='op'>*</span> <span class='fu'><a href='https://rdrr.io/r/base/Log.html'>exp</a></span><span class='op'>(</span><span class='op'>-</span> <span class='fl'>0.03</span> <span class='op'>*</span> <span class='va'>times</span><span class='op'>)</span><span class='op'>)</span>
+<span class='fu'><a href='https://rdrr.io/r/base/Random.html'>set.seed</a></span><span class='op'>(</span><span class='fl'>123456</span><span class='op'>)</span>
+<span class='va'>d_syn</span> <span class='op'>&lt;-</span> <span class='fu'><a href='add_err.html'>add_err</a></span><span class='op'>(</span><span class='va'>d_pred</span>, <span class='kw'>function</span><span class='op'>(</span><span class='va'>y</span><span class='op'>)</span> <span class='fu'>sigma_twocomp</span><span class='op'>(</span><span class='va'>y</span>, <span class='fl'>1</span>, <span class='fl'>0.07</span><span class='op'>)</span>,
+ reps <span class='op'>=</span> <span class='fl'>2</span>, n <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span><span class='op'>[[</span><span class='fl'>1</span><span class='op'>]</span><span class='op'>]</span>
+<span class='va'>f_nls</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/stats/nls.html'>nls</a></span><span class='op'>(</span><span class='va'>value</span> <span class='op'>~</span> <span class='fu'><a href='https://rdrr.io/r/stats/SSasymp.html'>SSasymp</a></span><span class='op'>(</span><span class='va'>time</span>, <span class='fl'>0</span>, <span class='va'>parent_0</span>, <span class='va'>lrc</span><span class='op'>)</span>, data <span class='op'>=</span> <span class='va'>d_syn</span>,
+ start <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>parent_0 <span class='op'>=</span> <span class='fl'>100</span>, lrc <span class='op'>=</span> <span class='op'>-</span><span class='fl'>3</span><span class='op'>)</span><span class='op'>)</span>
+<span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://svn.r-project.org/R-packages/trunk/nlme/'>nlme</a></span><span class='op'>)</span>
+<span class='va'>f_gnls</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/gnls.html'>gnls</a></span><span class='op'>(</span><span class='va'>value</span> <span class='op'>~</span> <span class='fu'><a href='https://rdrr.io/r/stats/SSasymp.html'>SSasymp</a></span><span class='op'>(</span><span class='va'>time</span>, <span class='fl'>0</span>, <span class='va'>parent_0</span>, <span class='va'>lrc</span><span class='op'>)</span>,
+ data <span class='op'>=</span> <span class='va'>d_syn</span>, na.action <span class='op'>=</span> <span class='va'>na.omit</span>,
+ start <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>parent_0 <span class='op'>=</span> <span class='fl'>100</span>, lrc <span class='op'>=</span> <span class='op'>-</span><span class='fl'>3</span><span class='op'>)</span><span class='op'>)</span>
+<span class='kw'>if</span> <span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/length.html'>length</a></span><span class='op'>(</span><span class='fu'>findFunction</span><span class='op'>(</span><span class='st'>"varConstProp"</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>&gt;</span> <span class='fl'>0</span><span class='op'>)</span> <span class='op'>{</span>
+ <span class='va'>f_gnls_tc</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/gnls.html'>gnls</a></span><span class='op'>(</span><span class='va'>value</span> <span class='op'>~</span> <span class='fu'><a href='https://rdrr.io/r/stats/SSasymp.html'>SSasymp</a></span><span class='op'>(</span><span class='va'>time</span>, <span class='fl'>0</span>, <span class='va'>parent_0</span>, <span class='va'>lrc</span><span class='op'>)</span>,
+ data <span class='op'>=</span> <span class='va'>d_syn</span>, na.action <span class='op'>=</span> <span class='va'>na.omit</span>,
+ start <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>parent_0 <span class='op'>=</span> <span class='fl'>100</span>, lrc <span class='op'>=</span> <span class='op'>-</span><span class='fl'>3</span><span class='op'>)</span>,
+ weights <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/varConstProp.html'>varConstProp</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span>
+ <span class='va'>f_gnls_tc_sf</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/gnls.html'>gnls</a></span><span class='op'>(</span><span class='va'>value</span> <span class='op'>~</span> <span class='fu'><a href='https://rdrr.io/r/stats/SSasymp.html'>SSasymp</a></span><span class='op'>(</span><span class='va'>time</span>, <span class='fl'>0</span>, <span class='va'>parent_0</span>, <span class='va'>lrc</span><span class='op'>)</span>,
+ data <span class='op'>=</span> <span class='va'>d_syn</span>, na.action <span class='op'>=</span> <span class='va'>na.omit</span>,
+ start <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>parent_0 <span class='op'>=</span> <span class='fl'>100</span>, lrc <span class='op'>=</span> <span class='op'>-</span><span class='fl'>3</span><span class='op'>)</span>,
+ control <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/list.html'>list</a></span><span class='op'>(</span>sigma <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span>,
+ weights <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/pkg/nlme/man/varConstProp.html'>varConstProp</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span>
+<span class='op'>}</span>
+<span class='va'>f_mkin</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='va'>d_syn</span>, error_model <span class='op'>=</span> <span class='st'>"const"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
+<span class='va'>f_mkin_tc</span> <span class='op'>&lt;-</span> <span class='fu'><a href='mkinfit.html'>mkinfit</a></span><span class='op'>(</span><span class='st'>"SFO"</span>, <span class='va'>d_syn</span>, error_model <span class='op'>=</span> <span class='st'>"tc"</span>, quiet <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
+<span class='fu'><a href='plot.mkinfit.html'>plot_res</a></span><span class='op'>(</span><span class='va'>f_mkin_tc</span>, standardized <span class='op'>=</span> <span class='cn'>TRUE</span><span class='op'>)</span>
+</div><div class='img'><img src='sigma_twocomp-1.png' alt='' width='700' height='433' /></div><div class='input'><span class='fu'><a href='https://rdrr.io/r/stats/AIC.html'>AIC</a></span><span class='op'>(</span><span class='va'>f_nls</span>, <span class='va'>f_gnls</span>, <span class='va'>f_gnls_tc</span>, <span class='va'>f_gnls_tc_sf</span>, <span class='va'>f_mkin</span>, <span class='va'>f_mkin_tc</span><span class='op'>)</span>
+</div><div class='output co'>#&gt; df AIC
+#&gt; f_nls 3 114.4817
+#&gt; f_gnls 3 114.4817
+#&gt; f_gnls_tc 5 103.6447
+#&gt; f_gnls_tc_sf 4 101.6447
+#&gt; f_mkin 3 114.4817
+#&gt; f_mkin_tc 4 101.6446</div></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">
@@ -204,7 +238,7 @@ measurement error in analytical chemistry. Technometrics 37(2), 176-184.</p>
</div>
<div class="pkgdown">
- <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p>
+ <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>
</footer>

Contact - Imprint