diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2023-02-13 05:19:08 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2023-02-13 05:19:08 +0100 |
commit | 8d1a84ac2190538ed3bac53a303064e281595868 (patch) | |
tree | acb894d85ab7ec87c4911c355a5264a77e08e34b /docs/reference/mmkin.html | |
parent | 51d63256a7b3020ee11931d61b4db97b9ded02c0 (diff) | |
parent | 4200e566ad2600f56bc3987669aeab88582139eb (diff) |
Merge branch 'main' into custom_lsoda_call
Diffstat (limited to 'docs/reference/mmkin.html')
-rw-r--r-- | docs/reference/mmkin.html | 171 |
1 files changed, 93 insertions, 78 deletions
diff --git a/docs/reference/mmkin.html b/docs/reference/mmkin.html index cbb46ab0..686c9310 100644 --- a/docs/reference/mmkin.html +++ b/docs/reference/mmkin.html @@ -20,7 +20,7 @@ datasets specified in its first two arguments."><!-- mathjax --><script src="htt </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> @@ -47,19 +47,25 @@ datasets specified in its first two arguments."><!-- mathjax --><script src="htt <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> @@ -92,16 +98,16 @@ datasets specified in its first two arguments.</p> </div> <div id="ref-usage"> - <div class="sourceCode"><pre class="sourceCode r"><code><span class="fu">mmkin</span><span class="op">(</span> - models <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">"SFO"</span>, <span class="st">"FOMC"</span>, <span class="st">"DFOP"</span><span class="op">)</span>, - <span class="va">datasets</span>, - cores <span class="op">=</span> <span class="kw">if</span> <span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Sys.info.html" class="external-link">Sys.info</a></span><span class="op">(</span><span class="op">)</span><span class="op">[</span><span class="st">"sysname"</span><span class="op">]</span> <span class="op">==</span> <span class="st">"Windows"</span><span class="op">)</span> <span class="fl">1</span> <span class="kw">else</span> <span class="fu">parallel</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/r/parallel/detectCores.html" class="external-link">detectCores</a></span><span class="op">(</span><span class="op">)</span>, - cluster <span class="op">=</span> <span class="cn">NULL</span>, - <span class="va">...</span> -<span class="op">)</span> - -<span class="co"># S3 method for mmkin</span> -<span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">x</span>, <span class="va">...</span><span class="op">)</span></code></pre></div> + <div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">mmkin</span><span class="op">(</span></span> +<span> models <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">"SFO"</span>, <span class="st">"FOMC"</span>, <span class="st">"DFOP"</span><span class="op">)</span>,</span> +<span> <span class="va">datasets</span>,</span> +<span> cores <span class="op">=</span> <span class="kw">if</span> <span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Sys.info.html" class="external-link">Sys.info</a></span><span class="op">(</span><span class="op">)</span><span class="op">[</span><span class="st">"sysname"</span><span class="op">]</span> <span class="op">==</span> <span class="st">"Windows"</span><span class="op">)</span> <span class="fl">1</span> <span class="kw">else</span> <span class="fu">parallel</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/r/parallel/detectCores.html" class="external-link">detectCores</a></span><span class="op">(</span><span class="op">)</span>,</span> +<span> cluster <span class="op">=</span> <span class="cn">NULL</span>,</span> +<span> <span class="va">...</span></span> +<span><span class="op">)</span></span> +<span></span> +<span><span class="co"># S3 method for mmkin</span></span> +<span><span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">x</span>, <span class="va">...</span><span class="op">)</span></span></code></pre></div> </div> <div id="arguments"> @@ -110,9 +116,13 @@ datasets specified in its first two arguments.</p> <dd><p>Either a character vector of shorthand names like <code>c("SFO", "FOMC", "DFOP", "HS", "SFORB")</code>, or an optionally named list of <code><a href="mkinmod.html">mkinmod</a></code> objects.</p></dd> + + <dt>datasets</dt> <dd><p>An optionally named list of datasets suitable as observed data for <code><a href="mkinfit.html">mkinfit</a></code>.</p></dd> + + <dt>cores</dt> <dd><p>The number of cores to be used for multicore processing. This is only used when the <code>cluster</code> argument is <code>NULL</code>. On Windows @@ -120,17 +130,29 @@ machines, cores > 1 is not supported, you need to use the <code>cluster</code argument to use multiple logical processors. Per default, all cores detected by <code><a href="https://rdrr.io/r/parallel/detectCores.html" class="external-link">parallel::detectCores()</a></code> are used, except on Windows where the default is 1.</p></dd> + + <dt>cluster</dt> -<dd><p>A cluster as returned by <code><a href="https://rdrr.io/r/parallel/makeCluster.html" class="external-link">makeCluster</a></code> to be used +<dd><p>A cluster as returned by <code>makeCluster</code> to be used for parallel execution.</p></dd> + + <dt>...</dt> <dd><p>Not used.</p></dd> + + <dt>x</dt> <dd><p>An mmkin object.</p></dd> + </dl></div> <div id="value"> <h2>Value</h2> - <p>A two-dimensional <code><a href="https://rdrr.io/r/base/array.html" class="external-link">array</a></code> of <code><a href="mkinfit.html">mkinfit</a></code>objects and/or try-errors that can be indexed using the model names for the + + +<p>A two-dimensional <code><a href="https://rdrr.io/r/base/array.html" class="external-link">array</a></code> of <code><a href="mkinfit.html">mkinfit</a></code></p> + + +<p>objects and/or try-errors that can be indexed using the model names for the first index (row index) and the dataset names for the second index (column index).</p> </div> @@ -146,33 +168,33 @@ plotting.</p></div> <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"># \dontrun{</span></span> -<span class="r-in"><span class="va">m_synth_SFO_lin</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="st">"M2"</span><span class="op">)</span>,</span> -<span class="r-in"> M2 <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"># \dontrun{</span></span></span> +<span class="r-in"><span><span class="va">m_synth_SFO_lin</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="st">"M2"</span><span class="op">)</span>,</span></span> +<span class="r-in"><span> M2 <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="va">m_synth_FOMC_lin</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">"FOMC"</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="st">"M2"</span><span class="op">)</span>,</span> -<span class="r-in"> M2 <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 class="r-in"><span></span></span> +<span class="r-in"><span><span class="va">m_synth_FOMC_lin</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">"FOMC"</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="st">"M2"</span><span class="op">)</span>,</span></span> +<span class="r-in"><span> M2 <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="va">models</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>SFO_lin <span class="op">=</span> <span class="va">m_synth_SFO_lin</span>, FOMC_lin <span class="op">=</span> <span class="va">m_synth_FOMC_lin</span><span class="op">)</span></span> -<span class="r-in"><span class="va">datasets</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/lapply.html" class="external-link">lapply</a></span><span class="op">(</span><span class="va">synthetic_data_for_UBA_2014</span><span class="op">[</span><span class="fl">1</span><span class="op">:</span><span class="fl">3</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> -<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">datasets</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="va">time_default</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html" class="external-link">system.time</a></span><span class="op">(</span><span class="va">fits.0</span> <span class="op"><-</span> <span class="fu">mmkin</span><span class="op">(</span><span class="va">models</span>, <span class="va">datasets</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span><span class="op">)</span></span> -<span class="r-in"><span class="va">time_1</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html" class="external-link">system.time</a></span><span class="op">(</span><span class="va">fits.4</span> <span class="op"><-</span> <span class="fu">mmkin</span><span class="op">(</span><span class="va">models</span>, <span class="va">datasets</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="op">)</span></span> -<span class="r-in"></span> -<span class="r-in"><span class="va">time_default</span></span> +<span class="r-in"><span></span></span> +<span class="r-in"><span><span class="va">models</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>SFO_lin <span class="op">=</span> <span class="va">m_synth_SFO_lin</span>, FOMC_lin <span class="op">=</span> <span class="va">m_synth_FOMC_lin</span><span class="op">)</span></span></span> +<span class="r-in"><span><span class="va">datasets</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/lapply.html" class="external-link">lapply</a></span><span class="op">(</span><span class="va">synthetic_data_for_UBA_2014</span><span class="op">[</span><span class="fl">1</span><span class="op">:</span><span class="fl">3</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></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">datasets</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="va">time_default</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html" class="external-link">system.time</a></span><span class="op">(</span><span class="va">fits.0</span> <span class="op"><-</span> <span class="fu">mmkin</span><span class="op">(</span><span class="va">models</span>, <span class="va">datasets</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span><span class="op">)</span></span></span> +<span class="r-in"><span><span class="va">time_1</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/system.time.html" class="external-link">system.time</a></span><span class="op">(</span><span class="va">fits.4</span> <span class="op"><-</span> <span class="fu">mmkin</span><span class="op">(</span><span class="va">models</span>, <span class="va">datasets</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="op">)</span></span></span> +<span class="r-in"><span></span></span> +<span class="r-in"><span><span class="va">time_default</span></span></span> <span class="r-out co"><span class="r-pr">#></span> user system elapsed </span> -<span class="r-out co"><span class="r-pr">#></span> 35.152 1.185 8.439 </span> -<span class="r-in"><span class="va">time_1</span></span> +<span class="r-out co"><span class="r-pr">#></span> 5.526 0.809 2.006 </span> +<span class="r-in"><span><span class="va">time_1</span></span></span> <span class="r-out co"><span class="r-pr">#></span> user system elapsed </span> -<span class="r-out co"><span class="r-pr">#></span> 14.744 0.008 14.768 </span> -<span class="r-in"></span> -<span class="r-in"><span class="fu"><a href="endpoints.html">endpoints</a></span><span class="op">(</span><span class="va">fits.0</span><span class="op">[[</span><span class="st">"SFO_lin"</span>, <span class="fl">2</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></span> +<span class="r-out co"><span class="r-pr">#></span> 5.403 0.008 5.412 </span> +<span class="r-in"><span></span></span> +<span class="r-in"><span><span class="fu"><a href="endpoints.html">endpoints</a></span><span class="op">(</span><span class="va">fits.0</span><span class="op">[[</span><span class="st">"SFO_lin"</span>, <span class="fl">2</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></span></span> <span class="r-out co"><span class="r-pr">#></span> $ff</span> <span class="r-out co"><span class="r-pr">#></span> parent_M1 parent_sink M1_M2 M1_sink </span> <span class="r-out co"><span class="r-pr">#></span> 0.7340481 0.2659519 0.7505683 0.2494317 </span> @@ -180,51 +202,44 @@ plotting.</p></div> <span class="r-out co"><span class="r-pr">#></span> $distimes</span> <span class="r-out co"><span class="r-pr">#></span> DT50 DT90</span> <span class="r-out co"><span class="r-pr">#></span> parent 0.877769 2.915885</span> -<span class="r-out co"><span class="r-pr">#></span> M1 2.325744 7.725955</span> -<span class="r-out co"><span class="r-pr">#></span> M2 33.720111 112.015785</span> +<span class="r-out co"><span class="r-pr">#></span> M1 2.325744 7.725956</span> +<span class="r-out co"><span class="r-pr">#></span> M2 33.720100 112.015749</span> <span class="r-out co"><span class="r-pr">#></span> </span> -<span class="r-in"></span> -<span class="r-in"><span class="co"># plot.mkinfit handles rows or columns of mmkin result objects</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">fits.0</span><span class="op">[</span><span class="fl">1</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"># plot.mkinfit handles rows or columns of mmkin result objects</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">fits.0</span><span class="op">[</span><span class="fl">1</span>, <span class="op">]</span><span class="op">)</span></span></span> <span class="r-plt img"><img src="mmkin-1.png" alt="" width="700" height="433"></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">fits.0</span><span class="op">[</span><span class="fl">1</span>, <span class="op">]</span>, obs_var <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 class="op">)</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">fits.0</span><span class="op">[</span><span class="fl">1</span>, <span class="op">]</span>, obs_var <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 class="op">)</span></span></span> <span class="r-plt img"><img src="mmkin-2.png" alt="" width="700" height="433"></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">fits.0</span><span class="op">[</span>, <span class="fl">1</span><span class="op">]</span><span class="op">)</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">fits.0</span><span class="op">[</span>, <span class="fl">1</span><span class="op">]</span><span class="op">)</span></span></span> <span class="r-plt img"><img src="mmkin-3.png" alt="" width="700" height="433"></span> -<span class="r-in"><span class="co"># Use double brackets to extract a single mkinfit object, which will be plotted</span></span> -<span class="r-in"><span class="co"># by plot.mkinfit and can be plotted using plot_sep</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">fits.0</span><span class="op">[[</span><span class="fl">1</span>, <span class="fl">1</span><span class="op">]</span><span class="op">]</span>, sep_obs <span class="op">=</span> <span class="cn">TRUE</span>, show_residuals <span class="op">=</span> <span class="cn">TRUE</span>, show_errmin <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span> +<span class="r-in"><span><span class="co"># Use double brackets to extract a single mkinfit object, which will be plotted</span></span></span> +<span class="r-in"><span><span class="co"># by plot.mkinfit and can be plotted using plot_sep</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">fits.0</span><span class="op">[[</span><span class="fl">1</span>, <span class="fl">1</span><span class="op">]</span><span class="op">]</span>, sep_obs <span class="op">=</span> <span class="cn">TRUE</span>, show_residuals <span class="op">=</span> <span class="cn">TRUE</span>, show_errmin <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span> <span class="r-plt img"><img src="mmkin-4.png" alt="" width="700" height="433"></span> -<span class="r-in"><span class="fu"><a href="plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">fits.0</span><span class="op">[[</span><span class="fl">1</span>, <span class="fl">1</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></span> -<span class="r-in"><span class="co"># Plotting with mmkin (single brackets, extracting an mmkin object) does not</span></span> -<span class="r-in"><span class="co"># allow to plot the observed variables separately</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">fits.0</span><span class="op">[</span><span class="fl">1</span>, <span class="fl">1</span><span class="op">]</span><span class="op">)</span></span> +<span class="r-in"><span><span class="fu"><a href="plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">fits.0</span><span class="op">[[</span><span class="fl">1</span>, <span class="fl">1</span><span class="op">]</span><span class="op">]</span><span class="op">)</span></span></span> +<span class="r-in"><span><span class="co"># Plotting with mmkin (single brackets, extracting an mmkin object) does not</span></span></span> +<span class="r-in"><span><span class="co"># allow to plot the observed variables separately</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">fits.0</span><span class="op">[</span><span class="fl">1</span>, <span class="fl">1</span><span class="op">]</span><span class="op">)</span></span></span> <span class="r-plt img"><img src="mmkin-5.png" alt="" width="700" height="433"></span> -<span class="r-in"></span> -<span class="r-in"><span class="co"># On Windows, we can use multiple cores by making a cluster using the parallel</span></span> -<span class="r-in"><span class="co"># package, which gets loaded with mkin, and passing it to mmkin, e.g.</span></span> -<span class="r-in"><span class="va">cl</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/parallel/makeCluster.html" class="external-link">makePSOCKcluster</a></span><span class="op">(</span><span class="fl">12</span><span class="op">)</span></span> -<span class="r-in"><span class="va">f</span> <span class="op"><-</span> <span class="fu">mmkin</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="st">"SFO"</span>, <span class="st">"FOMC"</span>, <span class="st">"DFOP"</span><span class="op">)</span>,</span> -<span class="r-in"> <span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span>A <span class="op">=</span> <span class="va">FOCUS_2006_A</span>, B <span class="op">=</span> <span class="va">FOCUS_2006_B</span>, C <span class="op">=</span> <span class="va">FOCUS_2006_C</span>, D <span class="op">=</span> <span class="va">FOCUS_2006_D</span><span class="op">)</span>,</span> -<span class="r-in"> cluster <span class="op">=</span> <span class="va">cl</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span> -<span class="r-in"><span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">f</span><span class="op">)</span></span> -<span class="r-out co"><span class="r-pr">#></span> <mmkin> object</span> -<span class="r-out co"><span class="r-pr">#></span> Status of individual fits:</span> -<span class="r-out co"><span class="r-pr">#></span> </span> -<span class="r-out co"><span class="r-pr">#></span> dataset</span> -<span class="r-out co"><span class="r-pr">#></span> model A B C D </span> -<span class="r-out co"><span class="r-pr">#></span> SFO OK OK OK OK</span> -<span class="r-out co"><span class="r-pr">#></span> FOMC C OK OK OK</span> -<span class="r-out co"><span class="r-pr">#></span> DFOP OK OK OK OK</span> -<span class="r-out co"><span class="r-pr">#></span> </span> -<span class="r-out co"><span class="r-pr">#></span> OK: No warnings</span> -<span class="r-out co"><span class="r-pr">#></span> C: Optimisation did not converge:</span> -<span class="r-out co"><span class="r-pr">#></span> false convergence (8)</span> -<span class="r-in"><span class="co"># We get false convergence for the FOMC fit to FOCUS_2006_A because this</span></span> -<span class="r-in"><span class="co"># dataset is really SFO, and the FOMC fit is overparameterised</span></span> -<span class="r-in"><span class="fu"><a href="https://rdrr.io/r/parallel/makeCluster.html" class="external-link">stopCluster</a></span><span class="op">(</span><span class="va">cl</span><span class="op">)</span></span> -<span class="r-in"><span class="co"># }</span></span> -<span class="r-in"></span> +<span class="r-in"><span></span></span> +<span class="r-in"><span><span class="co"># On Windows, we can use multiple cores by making a cluster using the parallel</span></span></span> +<span class="r-in"><span><span class="co"># package, which gets loaded with mkin, and passing it to mmkin, e.g.</span></span></span> +<span class="r-in"><span><span class="va">cl</span> <span class="op"><-</span> <span class="fu">makePSOCKcluster</span><span class="op">(</span><span class="fl">12</span><span class="op">)</span></span></span> +<span class="r-err co"><span class="r-pr">#></span> <span class="error">Error in makePSOCKcluster(12):</span> could not find function "makePSOCKcluster"</span> +<span class="r-in"><span><span class="va">f</span> <span class="op"><-</span> <span class="fu">mmkin</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="st">"SFO"</span>, <span class="st">"FOMC"</span>, <span class="st">"DFOP"</span><span class="op">)</span>,</span></span> +<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span>A <span class="op">=</span> <span class="va">FOCUS_2006_A</span>, B <span class="op">=</span> <span class="va">FOCUS_2006_B</span>, C <span class="op">=</span> <span class="va">FOCUS_2006_C</span>, D <span class="op">=</span> <span class="va">FOCUS_2006_D</span><span class="op">)</span>,</span></span> +<span class="r-in"><span> cluster <span class="op">=</span> <span class="va">cl</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span> +<span class="r-err co"><span class="r-pr">#></span> <span class="error">Error in system.time({ if (is.null(cluster)) { results <- parallel::mclapply(as.list(1:n.fits), fit_function, mc.cores = cores, mc.preschedule = FALSE) } else { results <- parallel::parLapply(cluster, as.list(1:n.fits), fit_function) }}):</span> object 'cl' not found</span> +<span class="r-msg co"><span class="r-pr">#></span> Timing stopped at: 0 0 0</span> +<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">f</span><span class="op">)</span></span></span> +<span class="r-err co"><span class="r-pr">#></span> <span class="error">Error in print(f):</span> object 'f' not found</span> +<span class="r-in"><span><span class="co"># We get false convergence for the FOMC fit to FOCUS_2006_A because this</span></span></span> +<span class="r-in"><span><span class="co"># dataset is really SFO, and the FOMC fit is overparameterised</span></span></span> +<span class="r-in"><span><span class="fu">stopCluster</span><span class="op">(</span><span class="va">cl</span><span class="op">)</span></span></span> +<span class="r-err co"><span class="r-pr">#></span> <span class="error">Error in stopCluster(cl):</span> could not find function "stopCluster"</span> +<span class="r-in"><span><span class="co"># }</span></span></span> +<span class="r-in"><span></span></span> </code></pre></div> </div> </div> @@ -239,7 +254,7 @@ plotting.</p></div> </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> |