diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2022-11-17 14:54:20 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2022-11-17 14:56:25 +0100 |
commit | e5d1df9a9b1f0951d7dfbaf24eee4294470b73e2 (patch) | |
tree | 18740ef050a68d1a6fe91f1bd2fdfdd97ac6448b /docs/reference/add_err.html | |
parent | 90354f5cd9e095f9ef98424689a2716770b248d4 (diff) |
Complete update of online docs for v1.2.0
Diffstat (limited to 'docs/reference/add_err.html')
-rw-r--r-- | docs/reference/add_err.html | 139 |
1 files changed, 81 insertions, 58 deletions
diff --git a/docs/reference/add_err.html b/docs/reference/add_err.html index 3a129533..4332ba05 100644 --- a/docs/reference/add_err.html +++ b/docs/reference/add_err.html @@ -19,7 +19,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-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.1.0</span> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.2.0</span> </span> </div> @@ -46,19 +46,25 @@ may depend on the predicted value and is specified as a standard deviation."><!- <a href="../articles/web_only/dimethenamid_2018.html">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models</a> </li> <li> - <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> + <a href="../articles/web_only/multistart.html">Short demo of the multistart method</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/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a> + </li> + <li> <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a> </li> <li> <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a> </li> <li> - <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a> + <a href="../articles/web_only/benchmarks.html">Benchmark timings for mkin</a> + </li> + <li> + <a href="../articles/web_only/saem_benchmarks.html">Benchmark timings for saem.mmkin</a> </li> </ul></li> <li> @@ -91,16 +97,16 @@ may depend on the predicted value and is specified as a standard deviation.</p> </div> <div id="ref-usage"> - <div class="sourceCode"><pre class="sourceCode r"><code><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" class="external-link">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></code></pre></div> + <div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">add_err</span><span class="op">(</span></span> +<span> <span class="va">prediction</span>,</span> +<span> <span class="va">sdfunc</span>,</span> +<span> secondary <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"M1"</span>, <span class="st">"M2"</span><span class="op">)</span>,</span> +<span> n <span class="op">=</span> <span class="fl">10</span>,</span> +<span> LOD <span class="op">=</span> <span class="fl">0.1</span>,</span> +<span> reps <span class="op">=</span> <span class="fl">2</span>,</span> +<span> digits <span class="op">=</span> <span class="fl">1</span>,</span> +<span> seed <span class="op">=</span> <span class="cn">NA</span></span> +<span><span class="op">)</span></span></code></pre></div> </div> <div id="arguments"> @@ -108,29 +114,46 @@ may depend on the predicted value and is specified as a standard deviation.</p> <dl><dt>prediction</dt> <dd><p>A prediction from a kinetic model as produced by <code><a href="mkinpredict.html">mkinpredict</a></code>.</p></dd> + + <dt>sdfunc</dt> <dd><p>A function taking the predicted value as its only argument and returning a standard deviation that should be used for generating the random error terms for this value.</p></dd> + + <dt>secondary</dt> <dd><p>The names of state variables that should have an initial value of zero</p></dd> + + <dt>n</dt> <dd><p>The number of datasets to be generated.</p></dd> + + <dt>LOD</dt> <dd><p>The limit of detection (LOD). Values that are below the LOD after adding the random error will be set to NA.</p></dd> + + <dt>reps</dt> <dd><p>The number of replicates to be generated within the datasets.</p></dd> + + <dt>digits</dt> <dd><p>The number of digits to which the values will be rounded.</p></dd> + + <dt>seed</dt> <dd><p>The seed used for the generation of random numbers. If NA, the seed is not set.</p></dd> + </dl></div> <div id="value"> <h2>Value</h2> - <p>A list of datasets compatible with <code><a href="mmkin.html">mmkin</a></code>, i.e. the + + +<p>A list of datasets compatible with <code><a href="mmkin.html">mmkin</a></code>, i.e. the components of the list are datasets compatible with <code><a href="mkinfit.html">mkinfit</a></code>.</p> </div> <div id="references"> @@ -147,53 +170,53 @@ https://jrwb.de/posters/piacenza_2015.pdf</p> <div id="ref-examples"> <h2>Examples</h2> - <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"></span> -<span class="r-in"><span class="co"># The kinetic model</span></span> -<span class="r-in"><span class="va">m_SFO_SFO</span> <span class="op"><-</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="mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M1"</span><span class="op">)</span>,</span> -<span class="r-in"> M1 <span class="op">=</span> <span class="fu"><a href="mkinmod.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></span> + <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span></span></span> +<span class="r-in"><span><span class="co"># The kinetic model</span></span></span> +<span class="r-in"><span><span class="va">m_SFO_SFO</span> <span class="op"><-</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="mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M1"</span><span class="op">)</span>,</span></span> +<span class="r-in"><span> M1 <span class="op">=</span> <span class="fu"><a href="mkinmod.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></span></span> <span class="r-msg co"><span class="r-pr">#></span> Temporary DLL for differentials generated and loaded</span> -<span class="r-in"></span> -<span class="r-in"><span class="co"># Generate a prediction for a specific set of parameters</span></span> -<span class="r-in"><span class="va">sampling_times</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">0</span>, <span class="fl">1</span>, <span class="fl">3</span>, <span class="fl">7</span>, <span class="fl">14</span>, <span class="fl">28</span>, <span class="fl">60</span>, <span class="fl">90</span>, <span class="fl">120</span><span class="op">)</span></span> -<span class="r-in"></span> -<span class="r-in"><span class="co"># This is the prediction used for the "Type 2 datasets" on the Piacenza poster</span></span> -<span class="r-in"><span class="co"># from 2015</span></span> -<span class="r-in"><span class="va">d_SFO_SFO</span> <span class="op"><-</span> <span class="fu"><a href="mkinpredict.html">mkinpredict</a></span><span class="op">(</span><span class="va">m_SFO_SFO</span>,</span> -<span class="r-in"> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span>k_parent <span class="op">=</span> <span class="fl">0.1</span>, f_parent_to_M1 <span class="op">=</span> <span class="fl">0.5</span>,</span> -<span class="r-in"> k_M1 <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log</a></span><span class="op">(</span><span class="fl">2</span><span class="op">)</span><span class="op">/</span><span class="fl">1000</span><span class="op">)</span>,</span> -<span class="r-in"> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span>parent <span class="op">=</span> <span class="fl">100</span>, M1 <span class="op">=</span> <span class="fl">0</span><span class="op">)</span>,</span> -<span class="r-in"> <span class="va">sampling_times</span><span class="op">)</span></span> -<span class="r-in"></span> -<span class="r-in"><span class="co"># Add an error term with a constant (independent of the value) standard deviation</span></span> -<span class="r-in"><span class="co"># of 10, and generate three datasets</span></span> -<span class="r-in"><span class="va">d_SFO_SFO_err</span> <span class="op"><-</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> -<span class="r-in"></span> -<span class="r-in"><span class="co"># Name the datasets for nicer plotting</span></span> -<span class="r-in"><span class="fu"><a href="https://rdrr.io/r/base/names.html" class="external-link">names</a></span><span class="op">(</span><span class="va">d_SFO_SFO_err</span><span class="op">)</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/paste.html" class="external-link">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> -<span class="r-in"></span> -<span class="r-in"><span class="co"># Name the model in the list of models (with only one member in this case) for</span></span> -<span class="r-in"><span class="co"># nicer plotting later on. Be quiet and use only one core not to offend CRAN</span></span> -<span class="r-in"><span class="co"># checks</span></span> -<span class="r-in"><span class="co"># \dontrun{</span></span> -<span class="r-in"><span class="va">f_SFO_SFO</span> <span class="op"><-</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" class="external-link">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> -<span class="r-in"> <span class="va">d_SFO_SFO_err</span>, cores <span class="op">=</span> <span class="fl">1</span>,</span> -<span class="r-in"> quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span> -<span class="r-in"></span> -<span class="r-in"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="va">f_SFO_SFO</span><span class="op">)</span></span> +<span class="r-in"><span></span></span> +<span class="r-in"><span><span class="co"># Generate a prediction for a specific set of parameters</span></span></span> +<span class="r-in"><span><span class="va">sampling_times</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">0</span>, <span class="fl">1</span>, <span class="fl">3</span>, <span class="fl">7</span>, <span class="fl">14</span>, <span class="fl">28</span>, <span class="fl">60</span>, <span class="fl">90</span>, <span class="fl">120</span><span class="op">)</span></span></span> +<span class="r-in"><span></span></span> +<span class="r-in"><span><span class="co"># This is the prediction used for the "Type 2 datasets" on the Piacenza poster</span></span></span> +<span class="r-in"><span><span class="co"># from 2015</span></span></span> +<span class="r-in"><span><span class="va">d_SFO_SFO</span> <span class="op"><-</span> <span class="fu"><a href="mkinpredict.html">mkinpredict</a></span><span class="op">(</span><span class="va">m_SFO_SFO</span>,</span></span> +<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span>k_parent <span class="op">=</span> <span class="fl">0.1</span>, f_parent_to_M1 <span class="op">=</span> <span class="fl">0.5</span>,</span></span> +<span class="r-in"><span> k_M1 <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log</a></span><span class="op">(</span><span class="fl">2</span><span class="op">)</span><span class="op">/</span><span class="fl">1000</span><span class="op">)</span>,</span></span> +<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span>parent <span class="op">=</span> <span class="fl">100</span>, M1 <span class="op">=</span> <span class="fl">0</span><span class="op">)</span>,</span></span> +<span class="r-in"><span> <span class="va">sampling_times</span><span class="op">)</span></span></span> +<span class="r-in"><span></span></span> +<span class="r-in"><span><span class="co"># Add an error term with a constant (independent of the value) standard deviation</span></span></span> +<span class="r-in"><span><span class="co"># of 10, and generate three datasets</span></span></span> +<span class="r-in"><span><span class="va">d_SFO_SFO_err</span> <span class="op"><-</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></span> +<span class="r-in"><span></span></span> +<span class="r-in"><span><span class="co"># Name the datasets for nicer plotting</span></span></span> +<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/names.html" class="external-link">names</a></span><span class="op">(</span><span class="va">d_SFO_SFO_err</span><span class="op">)</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/paste.html" class="external-link">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></span> +<span class="r-in"><span></span></span> +<span class="r-in"><span><span class="co"># Name the model in the list of models (with only one member in this case) for</span></span></span> +<span class="r-in"><span><span class="co"># nicer plotting later on. Be quiet and use only one core not to offend CRAN</span></span></span> +<span class="r-in"><span><span class="co"># checks</span></span></span> +<span class="r-in"><span><span class="co"># \dontrun{</span></span></span> +<span class="r-in"><span><span class="va">f_SFO_SFO</span> <span class="op"><-</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" class="external-link">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></span> +<span class="r-in"><span> <span class="va">d_SFO_SFO_err</span>, cores <span class="op">=</span> <span class="fl">1</span>,</span></span> +<span class="r-in"><span> quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span> +<span class="r-in"><span></span></span> +<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="va">f_SFO_SFO</span><span class="op">)</span></span></span> <span class="r-plt img"><img src="add_err-1.png" alt="" width="700" height="433"></span> -<span class="r-in"></span> -<span class="r-in"><span class="co"># We would like to inspect the fit for dataset 3 more closely</span></span> -<span class="r-in"><span class="co"># Using double brackets makes the returned object an mkinfit object</span></span> -<span class="r-in"><span class="co"># instead of a list of mkinfit objects, so plot.mkinfit is used</span></span> -<span class="r-in"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">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></span> +<span class="r-in"><span></span></span> +<span class="r-in"><span><span class="co"># We would like to inspect the fit for dataset 3 more closely</span></span></span> +<span class="r-in"><span><span class="co"># Using double brackets makes the returned object an mkinfit object</span></span></span> +<span class="r-in"><span><span class="co"># instead of a list of mkinfit objects, so plot.mkinfit is used</span></span></span> +<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">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></span></span> <span class="r-plt img"><img src="add_err-2.png" alt="" width="700" height="433"></span> -<span class="r-in"></span> -<span class="r-in"><span class="co"># If we use single brackets, we should give two indices (model and dataset),</span></span> -<span class="r-in"><span class="co"># and plot.mmkin is used</span></span> -<span class="r-in"><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">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></span> +<span class="r-in"><span></span></span> +<span class="r-in"><span><span class="co"># If we use single brackets, we should give two indices (model and dataset),</span></span></span> +<span class="r-in"><span><span class="co"># and plot.mmkin is used</span></span></span> +<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">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></span></span> <span class="r-plt img"><img src="add_err-3.png" alt="" width="700" height="433"></span> -<span class="r-in"><span class="co"># }</span></span> -<span class="r-in"></span> +<span class="r-in"><span><span class="co"># }</span></span></span> +<span class="r-in"><span></span></span> </code></pre></div> </div> </div> @@ -208,7 +231,7 @@ https://jrwb.de/posters/piacenza_2015.pdf</p> </div> <div class="pkgdown"> - <p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.3.</p> + <p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.6.</p> </div> </footer></div> |